function mouseEnter($this)
{
		$this.one("mouseenter", function(e){	$this.children('img').effect("bounce", { times:3, distance:10 }, 200); mouseLeave($this); });
}

function mouseLeave($this)
{
		$this.one("mouseleave", function(){ mouseEnter($this);	});	
}

function close_showcase ()
{
	$('#showcase_container').fadeOut(600);
	$('#header').delay(600).animate({height:'125px'}, {duration:1000, easing:'easeInOutBack'} );
}

function open_showcase ()
{
	$('#header').animate({height:'620px'}, {duration:1000, easing:'easeInOutBack'} );
	$('#showcase_container').delay(600).fadeIn(600);
}

/*** 
DOC READY
***/
$(document).ready(function()
{
	$timeout = 1000;
	
	$(window).politeWarning(6);

	$(function() {
		var zIndexNumber = 999;
		$('div,a,span').each(function() {
					
					// Dont change zindex for certain elements
					switch ($(this).attr('id'))
					{
						case 'TB_window':
						case 'TB_overlay':
						case 'TB_load':
						case 'footer':
						// Do nothing
						break;
						
						default:
						$(this).css('zIndex', zIndexNumber);
						zIndexNumber -= 10;
						break;
					}
		});
	});
		
	$('.magnify').click( function(){
								  
		$(this).attr('href').tooltip({
				position: "bottom center",
				offset: [-75, -30],
				opacity: 0.8,
				effect: 'fade',
		
				// position tooltips relative to the parent scrollable
				relative: true
			});
	});
	
	// Write slide UL to #showcase as causes W3C error if loaded on page
	$('#showcase').html('<ul class="slide"></ul>');
	
	// setup ul.tabs to work as tabs for each div directly under div.panes
	if ($("#contact-tabs").length) $("#contact-tabs").tabs("#contact-panes > div", {effect: 'fade', fadeOutSpeed: 400})

	$('#portfolio li, #clients li.more').click( function ($e)
	{
		
		$type = '';

		switch ($(this).parent().attr('id'))
		{
			case 'portfolio':
			$type = 'portfolio';
			break;
			
			case 'clients':
			$type = 'case_study';
			break;
		}
		
		$('html,body').animate({scrollTop:$('#wrapper').offset().top},{duration:500, easing:'easeInOutBack'} );
		
		$('#showcase_container .loader').fadeIn(300);
		$('#showcase ul li').fadeOut(300);
		
		$('#showcase').attr('class', $(this).attr('id') );

		open_showcase();
		
		$client_name = $('.client-name', this).html();
		
		// Run Ajax portfolio request
		
		if ($('#showcase ul li').html()) $timeout = 500;

		setTimeout("ajaxPortfolio($type)", $timeout);

	});
	
	// Portfolio Animation
	$('#portfolio li').hover(function(){
		$("div", this).stop().animate({bottom:'0px'},{queue:false,duration:160});
	}, function() {
		$("div", this).stop().animate({bottom:'-65px'},{queue:false,duration:160});
	});
	
	$('#contact-tabs li.left').click( function(){
		$(this).parent().css('background-position', '0 -31px');
		$('.address.kent').css('display', 'block');
		$('.address.london').css('display', 'none');
	});
	
	$('#contact-tabs li.right').click( function(){
		$(this).parent().css('background-position', '0 -1px');
		$('.address.kent').css('display', 'none');
		$('.address.london').css('display', 'block');
	});

	// Service page bouncing effect on hover
	if ($('.service').length)
	{
		$('.service a').one("mouseenter", function(e){	
			
			$(this).children('img').effect("bounce", { times:3, distance:10 }, 200); mouseLeave($(this));

		});
	}
	
	// Form Submission
	$('#contact-form .submit').click( function (){ 
				$(this).parent().submit();							  
	 });
	 
	 // Comment Submission
	 $('#post-comment .submit').click( function()
	{
			
			$(this).css('display', 'none');
			$(this).next().css('display', 'block');
			$('#post-comment .msg').remove();
			
			$.ajax(
			{
				type: "POST",
				url: "/ajax.php?q=post_comment",
				data: {id: $('#id').val(), name: $('#name').val(), email: $('#email').val(), comment: $('#comment').val(), recaptcha_challenge_field: $('#recaptcha_challenge_field').val(), recaptcha_response_field: $('#recaptcha_response_field').val(), title: $('#title').val(), type: $('#type').val() },
				success: function($data)
				{
					
					if ($data)
					{
						$data = eval('(' + $data + ')');
						$msg = $data['msg'];
						
						$('#post-comment .ajaxloader').delay(500).fadeOut(500, function (){
						
							$('#post-comment .ajaxloader').parent().append('<p class="msg"></p>'); 
							$('#post-comment-box .msg').html($msg);
							$('#post-comment-box .msg').children().fadeIn(500);
							$('#post-comment .submit').fadeIn(500);
							Recaptcha.reload();
							
							if ($data['status'] == 1)
							{
									$('#name').val('');
									$('#email').val('');
									$('#comment').val('');
							}
							
						});
					}
				}
			});		
	});
	
	// Newsletter Submission
	$('#newsletter .submit').click( function (){ 
	  	//
		$(this).parent().children('.loader').fadeIn(500);
		$('#newsletter .msg').fadeOut(500).remove();
		
		$.ajax(
		{
			type: "POST",
			url: "/ajax.php?q=newsletter",
			data: {email: $('#newsletter_email').val()},
			async: false,
			success: function($data)
			{
				$data = $data.replace(/"/g, '');
				
				if ($data)
				{
					$('.loader').delay(500).fadeOut(500, function (){;
						
						$('#newsletter').append('<p class="msg">' + $data + '</p>');

					});
				}
			}
		});

	  });
	  
	

	// Newsletter Button Click Expose
	$('.promobutton').click(function(){
	
			$('html,body').animate({scrollTop:$('#newsletter').offset().top},{duration:1200, easing:'easeInBack'} );
			
			// place a mask but let selected elements show through (expose)
			$("#newsletter").expose({
				
				color: "#8AAEB2",
				onLoad: function() {$("#newsletter").addClass('expose'); $("#newsletter .grey").css('display', 'none'); $("#newsletter input").css('color', '#F9591A') },
				onClose: function() {$("#newsletter").removeClass('expose'); $("#newsletter .grey").css('display', ''); $("#newsletter input").css('color', '#999999') }
			});
	});
	
	if ($('.success').length) $('.success').delay(500).slideDown('slow');
	if ($('.error').length) $('.error').delay(500).slideDown('slow');
	
	// If the splash container is found then animate it with slides
	if ($('#splash div ul').length)
	{
		$('#splash div ul').anythingSlider({
		  // Appearance
		  width               : null,      // Override the default CSS width
		  height              : null,      // Override the default CSS height
		  resizeContents      : false,      // If true, solitary images/objects in the panel will expand to fit the viewport
		
		  // Navigation
		  startPanel          : 1,         // This sets the initial panel
		  hashTags            : false,      // Should links change the hashtag in the URL?
		  buildArrows         : false,      // If true, builds the forwards and backwards buttons
		  buildNavigation     : false,      // If true, buildsa list of anchor links to link to each panel
		  navigationFormatter : null,      // Details at the top of the file on this use (advanced use)
		  forwardText         : "&raquo;", // Link text used to move the slider forward (hidden by CSS, replaced with arrow image)
		  backText            : "&laquo;", // Link text used to move the slider back (hidden by CSS, replace with arrow image)
		
		  // Slideshow options
		  autoPlay            : true,      // This turns off the entire slideshow FUNCTIONALY, not just if it starts running or not
		  startStopped        : false,     // If autoPlay is on, this can force it to start stopped
		  pauseOnHover        : false,      // If true & the slideshow is active, the slideshow will pause on hover
		  resumeOnVideoEnd    : true,      // If true & the slideshow is active & a youtube video is playing, it will pause the autoplay until the video has completed
		  stopAtEnd           : false,     // If true & the slideshow is active, the slideshow will stop on the last page
		  playRtl             : false,     // If true, the slideshow will move right-to-left
		  startText           : "",   // Start button text
		  stopText            : "",    // Stop button text
		  delay               : 7000,      // How long between slideshow transitions in AutoPlay mode (in milliseconds)
		  animationTime       : 1500,       // How long the slideshow transition takes (in milliseconds)
		  easing              : "easeInOutQuint"    // Anything other than "linear" or "swing" requires the easing plugin
		});
	}
	
	if ($('.sub_slider').length>0)
	{
		// Sub Page Slider
		sub_slider_area=".sub_slider";	

		$(sub_slider_area).cycle({ 
			fx:     'fade', 
			timeout:  4000,
			pager:'.sub_slider_pager',
			cleartype:  1,
			 pause: 1
		});
		
	}
	
	// Remove 'enter email' on newsletter sign up input field
	$('#newsletter_email').focus(function(){
		if ($(this).val() == 'e-mail address') $(this).val('');
	});
	
	$('#newsletter_email').blur(function(){
		if (!$('#newsletter_email').val())  $(this).val('e-mail address');
	});
	
	if ($('#services-nav').length)
	{
		$('#services-nav li').hover(function(){					

			$(this).animate(
				{left:"-6px"}, 
				{ duration:50, easing:'easeInSine'} 
			);
			
			$(this).delay(50).animate(
				{left:"0px"}, 
				{duration:150,easing:'easeOutSine'}
			);

		}, function(){ $(this).css('left', 0).stop(); });
		
	}
	
	
	if ($('#submenu').length)
	{
		$('#submenu li a').hover(function(){					
			$(this).stop().animate(
				{paddingLeft:"15px"}, 
				{duration:200}, {easing: 'easeInOutQuad'} )
			},function(){
			$(this).stop().animate(
				{paddingLeft:"10px"}, 
				{duration:100}, {easing: 'easeInOutQuad'} )
			})
	}
	
	// create custom animation algorithm for jQuery called "drop" 
	$.easing.drop = function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	};
	
	// Preload images
	preload(['/assets/images/ajax-loader.gif',]);
		
	
		/*** Fade in content elements ***/
	//if (!$('#gMap').length) // Fade in causes non load conflict with Google Maps
	//{
	//	$('.content-wrapper p').css('display', 'none');
	//	$('.content-wrapper p').fadeIn(1000); 
	//}
					
}); // End doc ready

// On window load. This waits until images have loaded which is essential
$(window).load(function(){
	
	// Fade in images so there isn't a color "pop" document load and then on window load
	$(".grey").animate({opacity:0.5},500);
	
	// clone image
	$('.grey').each(function(){
		var el = $(this);
		el.css({"position":"absolute"}).wrap("<div class='img_wrapper' style='display: inline-block'>").clone().addClass('img_grayscale').css({"position":"absolute","z-index":"998","opacity":"0"}).insertBefore(el).queue(function(){
			var el = $(this);
			el.parent().css({"width":this.width,"height":this.height});
			el.dequeue();
		});
		this.src = grayscale(this.src);
	});
	
	
	// Fade image 
	$('.grey').mouseover(function(){
		$(this).parent().find('img:first').stop().animate({opacity:1}, 500);
	})
	$('.img_grayscale').mouseout(function(){
		$(this).stop().animate({opacity:0}, 500);
	});		
//);
});



// Grayscale w canvas method
function grayscale(src){
	var canvas = document.createElement('canvas');
	var ctx = canvas.getContext('2d');
	var imgObj = new Image();
	imgObj.src = src;
	canvas.width = imgObj.width;
	canvas.height = imgObj.height; 
	ctx.drawImage(imgObj, 0, 0); 
	var imgPixels = ctx.getImageData(0, 0, canvas.width, canvas.height);
	for(var y = 0; y < imgPixels.height; y++){
		for(var x = 0; x < imgPixels.width; x++){
			var i = (y * 4) * imgPixels.width + x * 4;
			var avg = (imgPixels.data[i] + imgPixels.data[i + 1] + imgPixels.data[i + 2]) / 3;
			imgPixels.data[i] = avg; 
			imgPixels.data[i + 1] = avg; 
			imgPixels.data[i + 2] = avg;
		}
	}
	ctx.putImageData(imgPixels, 0, 0, 0, 0, imgPixels.width, imgPixels.height);
	return canvas.toDataURL();
}


function ajaxPortfolio($type)
{
	 $.ajax({
		  type: "POST",
		  url: "/ajax.php?q=" + $type,
		  data: {client_id: $('#showcase').attr('class')},
		  async: false,
		  success: function($data)
		  {
			  $data = eval('(' + $data + ')');
			//  $count = 1;
			  
			   $('#showcase ul.slide').html('');
			   if ($('.anythingSlider').length) $('#showcase_container').html('<img src="/assets/images/ajax-loader.gif" alt="Loading" class="loader" /><div id="showcase"><ul class="slide"></ul></div>');
			   
			   $('#showcase_container .loader').fadeOut(300);
			  
			  $.each($data, function(i)
			  {
					$id = $data[i]['id'];
				  	
					if ($type == 'portfolio')
					{
						$title = $data[i]['image_array']['title']; 
			  			$image = $data[i]['image_array']['image'];	
						
						$('#showcase ul.slide').append('<li><img src="/assets/images/portfolio/' + $image + '" alt="' + $title + '"  title="' + $title + '" /><h4 class="title">' + $client_name + '</h4><p class="text">' + $title + '</p></li>');
					}
					else 
					{
						$brief = $data[i]['brief'];
						$solution = $data[i]['solution'];
						$result = $data[i]['result'];
	
						for ($i = 0; $i <= 2; $i++)
						{
							$image = false;
							$title = false;
							if ($data[i]['image_array'][$i]) $title = $data[i]['image_array'][$i]['title']; 
							if ($data[i]['image_array'][$i]) $image = $data[i]['image_array'][$i]['image'];	 
							
							$('#showcase ul.slide').append('<li><img src="/assets/images/case-studies/' + $image + '" alt="' + $title + '"  title="' + $title + '" /><div class="text-column"></div></li>');
							
							if ($i == 0) $('#showcase ul .text-column:last').html('<h4>Client</h4><p>' + $client_name + '</p><h4>Project</h4><p>' + $brief + '</p>');
							if ($i == 1) $('#showcase ul .text-column:last').html('<h4>Solution</h4><p>' + $solution + '</p>');
							if ($i == 2) $('#showcase ul .text-column:last').html('<h4>Result</h4>' + $result);
							

						}
					}
					
			  });// end each
			  
			  if (!$data[0]) $('#showcase ul.slide').append('<li><p class="sorry">Sorry, no portfolio items were found for this client.</p></li>');
			  
			  $('#showcase ul.slide').css('display', 'none');
			  $('#showcase ul.slide').css('opacity', 0);
			  
			  if ( $('#showcase ul.slide').html() || !$('#showcase .anythingWindow') )
			 {
				 $('#showcase ul.slide').anythingSlider({
					  // Appearance
					  width               : null,      // Override the default CSS width
					  height              : null,      // Override the default CSS height
					  resizeContents      : false,      // If true, solitary images/objects in the panel will expand to fit the viewport
					
					  // Navigation
					  startPanel          : 1,         // This sets the initial panel
					  hashTags            : false,      // Should links change the hashtag in the URL?
					  buildArrows         : true,      // If true, builds the forwards and backwards buttons
					  buildNavigation     : true,      // If true, buildsa list of anchor links to link to each panel
					  navigationFormatter : null,      // Details at the top of the file on this use (advanced use)
					  forwardText         : "", // Link text used to move the slider forward (hidden by CSS, replaced with arrow image)
					  backText            : "", // Link text used to move the slider back (hidden by CSS, replace with arrow image)
					
					  // Slideshow options
					//  infiniteSlides : false,
					  autoPlay            : false,      // This turns off the entire slideshow FUNCTIONALY, not just if it starts running or not
					  startStopped        : false,     // If autoPlay is on, this can force it to start stopped
					  pauseOnHover        : false,      // If true & the slideshow is active, the slideshow will pause on hover
					  resumeOnVideoEnd    : false,      // If true & the slideshow is active & a youtube video is playing, it will pause the autoplay until the video has completed
					  stopAtEnd           : false,     // If true & the slideshow is active, the slideshow will stop on the last page
					  playRtl             : false,     // If true, the slideshow will move right-to-left
					  startText           : "",   // Start button text
					  stopText            : "",    // Stop button text
					  delay               : 5000,      // How long between slideshow transitions in AutoPlay mode (in milliseconds)
					  animationTime       : 500,       // How long the slideshow transition takes (in milliseconds)
					  easing              : "easeInOutQuint"    // Anything other than "linear" or "swing" requires the easing plugin
					});
			 }		

			}// end success
			
	  }); // end ajax request
	 if ($type != 'portfolio') $('.anythingSlider').attr('id', 'case_study');
	
	 // If case study image detected then automatically adjust margin-top of images so they are vertically centered
	$('#showcase #case_study li img').each( function()
	 {
		if ($(this).attr('height')) $('#showcase #case_study li img').css('marginTop', '-' + ($(this).attr('height') / 2) + 'px'); 
	 });
	
	$('#showcase_container').append('<span class="collapse">Collapse</span>');
	$('.collapse').click( function (){ close_showcase(); });
	
	  $('#showcase ul.slide').delay(100).fadeIn(500, function() {
															  
			 $('#showcase ul.slide').parent().scrollLeft(950);
			 $('#showcase ul.slide').animate({opacity: 1}, 500);

	  });
}

function preload(arrayOfImages) {
    $(arrayOfImages).each(function(){
        $('<img/>')[0].src = this;
    });
}


/**  Background Position Animation - jQuery Extension **/
(function($) {
	if(!document.defaultView || !document.defaultView.getComputedStyle){ // IE6-IE8
		var oldCurCSS = jQuery.curCSS;
		jQuery.curCSS = function(elem, name, force){
			if(name === 'background-position'){
				name = 'backgroundPosition';
			}
			if(name !== 'backgroundPosition' || !elem.currentStyle || elem.currentStyle[ name ]){
				return oldCurCSS.apply(this, arguments);
			}
			var style = elem.style;
			if ( !force && style && style[ name ] ){
				return style[ name ];
			}
			return oldCurCSS(elem, 'backgroundPositionX', force) +' '+ oldCurCSS(elem, 'backgroundPositionY', force);
		};
	}
	
	var oldAnim = $.fn.animate;
	$.fn.animate = function(prop){
		if('background-position' in prop){
			prop.backgroundPosition = prop['background-position'];
			delete prop['background-position'];
		}
		if('backgroundPosition' in prop){
			prop.backgroundPosition = '('+ prop.backgroundPosition;
		}
		return oldAnim.apply(this, arguments);
	};
	
	function toArray(strg){
		strg = strg.replace(/left|top/g,'0px');
		strg = strg.replace(/right|bottom/g,'100%');
		strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");
		var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);
		return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];
	}
	
	$.fx.step. backgroundPosition = function(fx) {
		if (!fx.bgPosReady) {
			var start = $.curCSS(fx.elem,'backgroundPosition');
			
			if(!start){//FF2 no inline-style fallback
				start = '0px 0px';
			}
			
			start = toArray(start);
			
			fx.start = [start[0],start[2]];
			
			var end = toArray(fx.options.curAnim.backgroundPosition);
			fx.end = [end[0],end[2]];
			
			fx.unit = [end[1],end[3]];
			fx.bgPosReady = true;
		}
		//return;
		var nowPosX = [];
		nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
		nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];           
		fx.elem.style.backgroundPosition = nowPosX[0]+' '+nowPosX[1];

	};
})(jQuery);

/******/




/**** PLUGINS APPEAR BELOW ***/



/**
 * @author Alexander Farkas
 * v. 1.02
 */
(function($) {
	$.extend($.fx.step,{
	    backgroundPosition: function(fx) {
            if (fx.state === 0 && typeof fx.end == 'string') {
                var start = $.curCSS(fx.elem,'backgroundPosition');
                start = toArray(start);
                fx.start = [start[0],start[2]];
                var end = toArray(fx.end);
                fx.end = [end[0],end[2]];
                fx.unit = [end[1],end[3]];
			}
            var nowPosX = [];
            nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
            nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];
            fx.elem.style.backgroundPosition = nowPosX[0]+' '+nowPosX[1];

           function toArray(strg){
               strg = strg.replace(/left|top/g,'0px');
               strg = strg.replace(/right|bottom/g,'100%');
               strg = strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");
               var res = strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);
               return [parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];
           }
        }
	});
})(jQuery);



/*
 * jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php
 *
 * Uses the built In easIng capabilities added In jQuery 1.1
 * to offer multiple easIng options
 *
 * Copyright (c) 2007 George Smith
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 */

// t: current time, b: begInnIng value, c: change In value, d: duration

jQuery.extend( jQuery.easing,
{
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});


/*
 AnythingSlider v1.5.9 minified using Google Closure Compiler
 By Chris Coyier: http://css-tricks.com
 with major improvements by Doug Neiner: http://pixelgraphics.us/
 based on work by Remy Sharp: http://jqueryfordesigners.com/
*/

(function(c){c.anythingSlider=function(h,i){var a=this;a.$el=c(h).addClass("anythingBase").wrap('<div class="anythingSlider"><div class="anythingWindow" /></div>');a.$el.data("AnythingSlider",a);a.init=function(){a.options=c.extend({},c.anythingSlider.defaults,i);c.isFunction(a.options.onBeforeInitialize)&&a.$el.bind("before_initialize",a.options.onBeforeInitialize);a.$el.trigger("before_initialize",a);a.$wrapper=a.$el.parent().closest("div.anythingSlider").addClass("anythingSlider-"+a.options.theme); a.$window=a.$el.closest("div.anythingWindow");a.$controls=c('<div class="anythingControls"></div>').appendTo(a.options.appendControlsTo!==null&&c(a.options.appendControlsTo).length?c(a.options.appendControlsTo):a.$wrapper);a.win=window;a.$win=c(a.win);a.$nav=c('<ul class="thumbNav" />').appendTo(a.$controls);a.timer=null;a.flag=!1;a.playing=!1;a.hovered=!1;a.panelSize=[];a.currentPage=a.options.startPanel;a.adjustLimit=a.options.infiniteSlides?0:1;a.options.playRtl&&a.$wrapper.addClass("rtl");a.options.easing!== "swing"&&a.$el.css("margin-left","100px");a.original=[a.options.autoPlay,a.options.buildNavigation,a.options.buildArrows];a.updateSlider();a.$lastPage=a.$currentPage;a.runTimes=c("div.anythingSlider").index(a.$wrapper)+1;a.regex=RegExp("panel"+a.runTimes+"-(\\d+)","i");if(!c.isFunction(c.easing[a.options.easing]))a.options.easing="swing";a.options.theme!=="default"&&!c("link[href*="+a.options.theme+"]").length&&c("head").append('<link rel="stylesheet" href="'+a.options.themeDirectory.replace(/\{themeName\}/g, a.options.theme)+'" type="text/css" />');a.options.pauseOnHover&&a.$wrapper.hover(function(){a.playing&&(a.$el.trigger("slideshow_paused",a),a.clearTimer(!0))},function(){a.playing&&(a.$el.trigger("slideshow_unpaused",a),a.startStop(a.playing,!0))});var b,e=a.options.hashTags?a.gotoHash()||a.options.startPanel:a.options.startPanel;a.setCurrentPage(e,!1);a.slideControls(!1);a.$wrapper.bind("mouseenter mouseleave",function(b){a.hovered=b.type==="mouseenter"?!0:!1;a.slideControls(a.hovered,!1)});a.options.enableKeyboard&& c(document).keyup(function(b){if(a.$wrapper.is(".activeSlider")&&!b.target.tagName.match("TEXTAREA|INPUT|SELECT"))switch(b.which){case 39:a.goForward();break;case 37:a.goBack()}});b="slideshow_paused slideshow_unpaused slide_init slide_begin slideshow_stop slideshow_start initialized swf_completed".split(" ");c.each("onShowPause onShowUnpause onSlideInit onSlideBegin onShowStop onShowStart onInitialized onSWFComplete".split(" "),function(e,f){c.isFunction(a.options[f])&&a.$el.bind(b[e],a.options[f])}); c.isFunction(a.options.onSlideComplete)&&a.$el.bind("slide_complete",function(){setTimeout(function(){a.options.onSlideComplete(a)},0)});a.$el.trigger("initialized",a)};a.updateSlider=function(){a.$el.find("li.cloned").remove();a.$nav.empty();a.$items=a.$el.find("> li");a.pages=a.$items.length;a.options.resizeContents&&(a.options.width&&a.$wrapper.add(a.$items).css("width",a.options.width),a.options.height&&a.$wrapper.add(a.$items).css("height",a.options.height));a.pages===1?(a.options.autoPlay=!1, a.options.buildNavigation=!1,a.options.buildArrows=!1,a.$controls.hide(),a.$nav.hide(),a.$forward&&a.$forward.add(a.$back).hide()):(a.options.autoPlay=a.original[0],a.options.buildNavigation=a.original[1],a.options.buildArrows=a.original[2],a.$controls.show(),a.$nav.show(),a.$forward&&a.$forward.add(a.$back).show());a.buildNavigation();if(a.options.autoPlay)a.playing=!a.options.startStopped,a.buildAutoPlay();a.options.buildArrows&&a.buildNextBackButtons();a.$el.prepend(a.options.infiniteSlides?a.$items.filter(":last").clone().addClass("cloned").removeAttr("id"): c('<li class="cloned" />'));a.$el.append(a.options.infiniteSlides?a.$items.filter(":first").clone().addClass("cloned").removeAttr("id"):c('<li class="cloned" />'));a.$el.find("li.cloned").each(function(){c(this).html(c(this).html().replace(/<a/gi,"<span").replace(/\/a>/gi,"/span>"));c(this).find("[id]").removeAttr("id")});a.$items=a.$el.find("> li").addClass("panel");a.setDimensions();a.options.resizeContents||a.$win.load(function(){a.setDimensions()});if(a.currentPage>a.pages)a.currentPage=a.pages, a.setCurrentPage(a.pages,!1);a.$nav.find("a").eq(a.currentPage-1).addClass("cur");a.$controls.show();a.hasEmb=a.$items.find("embed[src*=youtube]").length;a.hasSwfo=typeof swfobject!=="undefined"&&swfobject.hasOwnProperty("embedSWF")&&c.isFunction(swfobject.embedSWF)?!0:!1;a.hasEmb&&a.hasSwfo&&a.$items.find("embed[src*=youtube]").each(function(b){var e=c(this).parent()[0].tagName==="OBJECT"?c(this).parent():c(this);e.wrap('<div id="ytvideo'+b+'"></div>');swfobject.embedSWF(c(this).attr("src")+"&enablejsapi=1&version=3&playerapiid=ytvideo"+ b,"ytvideo"+b,e.attr("width"),e.attr("height"),"10",null,null,{allowScriptAccess:"always",wmode:a.options.addWmodeToObject,allowfullscreen:!0},{"class":e.attr("class"),style:e.attr("style")},function(){b>=a.hasEmb-1&&a.$el.trigger("swf_completed",a)})});a.$items.find("a").unbind("focus").bind("focus",function(b){a.$items.find(".focusedLink").removeClass("focusedLink");c(this).addClass("focusedLink");var e=c(this).closest(".panel");e.is(".activePage")||(a.gotoPage(a.$items.index(e)),b.preventDefault())})}; a.buildNavigation=function(){var b,e,d;a.options.buildNavigation&&a.pages>1&&a.$items.filter(":not(.cloned)").each(function(f){var g=f+1;e=(g===1?"first":"")+(g===a.pages?"last":"");d=c('<a href="#"></a>').addClass("panel"+g).wrap('<li class="'+e+'" />');a.$nav.append(d.parent());c.isFunction(a.options.navigationFormatter)?(b=a.options.navigationFormatter(g,c(this)),d.html(b),parseInt(d.css("text-indent"),10)<0&&d.addClass(a.options.tooltipClass).attr("title",b)):d.text(g);d.bind(a.options.clickControls, function(b){if(!a.flag&&a.options.enableNavigation)a.flag=!0,setTimeout(function(){a.flag=!1},100),a.gotoPage(g),a.options.hashTags&&a.setHash(g);b.preventDefault()})})};a.buildNextBackButtons=function(){if(!a.$forward)a.$forward=c('<span class="arrow forward"><a href="#">'+a.options.forwardText+"</a></span>"),a.$back=c('<span class="arrow back"><a href="#">'+a.options.backText+"</a></span>"),a.$back.bind(a.options.clickArrows,function(b){a.goBack();b.preventDefault()}),a.$forward.bind(a.options.clickArrows, function(b){a.goForward();b.preventDefault()}),a.$back.add(a.$forward).find("a").bind("focusin focusout",function(){c(this).toggleClass("hover")}),a.$wrapper.prepend(a.$forward).prepend(a.$back),a.$arrowWidth=a.$forward.width()};a.buildAutoPlay=function(){if(!a.$startStop)a.$startStop=c("<a href='#' class='start-stop'></a>").html(a.playing?a.options.stopText:a.options.startText),a.$controls.prepend(a.$startStop),a.$startStop.bind(a.options.clickSlideshow,function(b){a.options.enablePlay&&(a.startStop(!a.playing), a.playing&&(a.options.playRtl?a.goBack(!0):a.goForward(!0)));b.preventDefault()}).bind("focusin focusout",function(){c(this).toggleClass("hover")}),a.startStop(a.playing)};a.setDimensions=function(){var b,e,d,f,g,h=parseInt(a.$el.css("margin-left"),10),i=a.$window.width(),j=a.$win.width();a.$items.each(function(k){d=c(this).children("*");a.options.resizeContents?(b=parseInt(a.options.width,10)||i,e=parseInt(a.options.height,10)||a.$window.height(),c(this).css({width:b,height:e}),d.length===1&&(d.css({width:"100%", height:"100%"}),d[0].tagName==="OBJECT"&&d.find("embed").andSelf().attr({width:"100%",height:"100%"}))):(b=c(this).width(),g=b>=j?!0:!1,d.length===1&&g&&(f=d.width()>=j?i:d.width(),c(this).css("width",f),d.css("max-width",f),b=f),b=g?a.options.width||i:b,c(this).css("width",b),e=c(this).outerHeight(),c(this).css("height",e));a.panelSize[k]=[b,e,h];h+=b});a.$el.css("width",h<a.options.maxOverallWidth?h:a.options.maxOverallWidth)};a.gotoPage=function(b,c,d){if(a.pages!==1){a.$lastPage=a.$currentPage; if(typeof b!=="number")b=a.options.startPage,a.setCurrentPage(a.options.startPage);if(!a.hasEmb||!a.checkVideo(a.playing))b>a.pages+1-a.adjustLimit&&(b=!a.options.infiniteSlides&&!a.options.stopAtEnd?1:a.pages),b<a.adjustLimit&&(b=!a.options.infiniteSlides&&!a.options.stopAtEnd?a.pages:1),a.currentPage=b>a.pages?a.pages:b<1?1:a.currentPage,a.$currentPage=a.$items.eq(a.currentPage-1),a.exactPage=b,a.$el.trigger("slide_init",a),a.slideControls(!0,!1),c!==!0&&(c=!1),(!c||a.options.stopAtEnd&&b===a.pages)&& a.startStop(!1),a.$el.trigger("slide_begin",a),a.options.resizeContents||a.$wrapper.filter(":not(:animated)").animate({width:a.panelSize[b][0],height:a.panelSize[b][1]},{queue:!1,duration:a.options.animationTime,easing:a.options.easing}),a.$window.filter(":not(:animated)").animate({scrollLeft:a.panelSize[b][2]},{queue:!1,duration:a.options.animationTime,easing:a.options.easing,complete:function(){a.endAnimation(b,d)}})}};a.endAnimation=function(b,e){b===0?(a.$window.scrollLeft(a.panelSize[a.pages][2]), b=a.pages):b>a.pages&&(a.$window.scrollLeft(a.panelSize[1][2]),b=1);a.exactPage=b;a.setCurrentPage(b,!1);a.$items.removeClass("activePage").eq(b).addClass("activePage");a.hovered||a.slideControls(!1);if(a.hasEmb){var d=a.$currentPage.find("object[id*=ytvideo], embed[id*=ytvideo]");d.length&&c.isFunction(d[0].getPlayerState)&&d[0].getPlayerState()>0&&d[0].getPlayerState()!==5&&d[0].playVideo()}a.$el.trigger("slide_complete",a);typeof e==="function"&&e(a);a.options.autoPlayLocked&&!a.playing&&setTimeout(function(){a.startStop(!0)}, a.options.resumeDelay-a.options.delay)};a.setCurrentPage=function(b,e){b>a.pages+1-a.adjustLimit&&(b=a.pages-a.adjustLimit);b<a.adjustLimit&&(b=1);a.options.buildNavigation&&(a.$nav.find(".cur").removeClass("cur"),a.$nav.find("a").eq(b-1).addClass("cur"));!a.options.infiniteSlides&&a.options.stopAtEnd&&(a.$wrapper.find("span.forward")[b===a.pages?"addClass":"removeClass"]("disabled"),a.$wrapper.find("span.back")[b===1?"addClass":"removeClass"]("disabled"),b===a.pages&&a.playing&&a.startStop());e|| (a.$wrapper.css({width:a.panelSize[b][0],height:a.panelSize[b][1]}),a.$wrapper.scrollLeft(0),a.$window.scrollLeft(a.panelSize[b][2]));a.currentPage=b;a.$currentPage=a.$items.eq(b).addClass("activePage");a.$wrapper.is(".activeSlider")||(c(".activeSlider").removeClass("activeSlider"),a.$wrapper.addClass("activeSlider"))};a.goForward=function(b){b!==!0&&(b=!1,a.startStop(!1));a.gotoPage(a.currentPage+1,b)};a.goBack=function(b){b!==!0&&(b=!1,a.startStop(!1));a.gotoPage(a.currentPage-1,b)};a.gotoHash= function(){var b=a.win.location.hash.match(a.regex);return b===null?"":parseInt(b[1],10)};a.setHash=function(b){var c="panel"+a.runTimes+"-",d=a.win.location.hash;if(typeof d!=="undefined")a.win.location.hash=d.indexOf(c)>0?d.replace(a.regex,c+b):d+"&"+c+b};a.slideControls=function(b){var c=b?0:a.options.animationTime,d=b?a.options.animationTime:0,f=b?1:0,g=b?0:1;a.options.toggleControls&&a.$controls.stop(!0,!0).delay(c)[b?"slideDown":"slideUp"](a.options.animationTime/2).delay(d);a.options.buildArrows&& a.options.toggleArrows&&(!a.hovered&&a.playing&&(g=1,f=0),a.$forward.stop(!0,!0).delay(c).animate({right:g*a.$arrowWidth,opacity:f},a.options.animationTime/2),a.$back.stop(!0,!0).delay(c).animate({left:g*a.$arrowWidth,opacity:f},a.options.animationTime/2))};a.clearTimer=function(b){a.timer&&(a.win.clearInterval(a.timer),b||a.$el.trigger("slideshow_stop",a))};a.startStop=function(b,c){b!==!0&&(b=!1);b&&!c&&a.$el.trigger("slideshow_start",a);a.playing=b;a.options.autoPlay&&(a.$startStop.toggleClass("playing", b).html(b?a.options.stopText:a.options.startText),parseInt(a.$startStop.css("text-indent"),10)<0&&a.$startStop.addClass(a.options.tooltipClass).attr("title",b?"Stop":"Start"));b?(a.clearTimer(!0),a.timer=a.win.setInterval(function(){if(!a.hasEmb||!a.checkVideo(b))a.options.playRtl?a.goBack(!0):a.goForward(!0)},a.options.delay)):a.clearTimer()};a.checkVideo=function(b){var e,d,f=!1;a.$items.find("object[id*=ytvideo], embed[id*=ytvideo]").each(function(){e=c(this);e.length&&c.isFunction(e[0].getPlayerState)&& (d=e[0].getPlayerState(),b&&(d===1||d>2)&&a.$items.index(e.closest("li.panel"))===a.currentPage&&a.options.resumeOnVideoEnd?f=!0:d>0&&e[0].pauseVideo())});return f};a.init()};c.anythingSlider.defaults={width:null,height:null,resizeContents:!0,tooltipClass:"tooltip",theme:"default",themeDirectory:"css/theme-{themeName}.css",startPanel:1,hashTags:!0,infiniteSlides:!0,enableKeyboard:!0,buildArrows:!0,toggleArrows:!1,buildNavigation:!0,enableNavigation:!0,toggleControls:!1,appendControlsTo:null,navigationFormatter:null, forwardText:"&raquo;",backText:"&laquo;",enablePlay:!0,autoPlay:!0,autoPlayLocked:!1,startStopped:!1,pauseOnHover:!0,resumeOnVideoEnd:!0,stopAtEnd:!1,playRtl:!1,startText:"Start",stopText:"Stop",delay:3E3,resumeDelay:15E3,animationTime:600,easing:"swing",clickArrows:"click",clickControls:"click focusin",clickSlideshow:"click",addWmodeToObject:"opaque",maxOverallWidth:32766};c.fn.anythingSlider=function(h,i){return this.each(function(){var a,b=c(this).data("AnythingSlider");(typeof h).match("object|undefined")? b?b.updateSlider():new c.anythingSlider(this,h):/\d/.test(h)&&!isNaN(h)&&b&&(a=typeof h==="number"?h:parseInt(c.trim(h),10),a>=1&&a<=b.pages&&b.gotoPage(a,!1,i))})}})(jQuery);



/* Polite ie warning v1.1
* http://politeIeWarning.blogspot.com/
* Copyright 2010, nathaNJamal
* Dual licensed under the MIT or GPL Version 2 licenses.*/
(function ($) { $.fn.politeWarning = function (ver, msg) { if (!ver) ver = 7; if (!msg) msg = 'We do not support Internet Explorer 6. Please upgrade your browser for the best viewing experience.'; var banner = '<div id="ieWarning"><span id="ieWarningTxt" class="shadow">' + msg + '</span> <a href="#" id="closeWarning">X</a></div>'; if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { var ieversion = new Number(RegExp.$1); if (ieversion <= ver) { $('body').append(banner); $("#ieWarning").width($(window).width()); setTimeout('$("#ieWarning").animate({"top":"0px"},1000);', 1500) } } $('#closeWarning').click(function () { $("#ieWarning").animate({ "top": "0px" }, 500) }) } })(jQuery);

/*
 * jQuery Cycle Plugin (with Transition Definitions)
 * Examples and documentation at: http://jquery.malsup.com/cycle/
 * Copyright (c) 2007-2009 M. Alsup
 * Version: 2.72 (09-SEP-2009)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * Requires: jQuery v1.2.6 or later
 *
 * Originally based on the work of:
 *	1) Matt Oakes
 *	2) Torsten Baldes (http://medienfreunde.com/lab/innerfade/)
 *	3) Benjamin Sterling (http://www.benjaminsterling.com/experiments/jqShuffle/)
 */
(function($){var ver="2.72";if($.support==undefined){$.support={opacity:!($.browser.msie)};}function debug(s){if($.fn.cycle.debug){log(s);}}function log(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments," "));}}$.fn.cycle=function(options,arg2){var o={s:this.selector,c:this.context};if(this.length===0&&options!="stop"){if(!$.isReady&&o.s){log("DOM not ready, queuing slideshow");$(function(){$(o.s,o.c).cycle(options,arg2);});return this;}log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)"));return this;}return this.each(function(){var opts=handleArguments(this,options,arg2);if(opts===false){return;}if(this.cycleTimeout){clearTimeout(this.cycleTimeout);}this.cycleTimeout=this.cyclePause=0;var $cont=$(this);var $slides=opts.slideExpr?$(opts.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<2){log("terminating; too few slides: "+els.length);return;}var opts2=buildOptions($cont,$slides,els,opts,o);if(opts2===false){return;}var startTime=opts2.continuous?10:getTimeout(opts2.currSlide,opts2.nextSlide,opts2,!opts2.rev);if(startTime){startTime+=(opts2.delay||0);if(startTime<10){startTime=10;}debug("first timeout: "+startTime);this.cycleTimeout=setTimeout(function(){go(els,opts2,0,!opts2.rev);},startTime);}});};function handleArguments(cont,options,arg2){if(cont.cycleStop==undefined){cont.cycleStop=0;}if(options===undefined||options===null){options={};}if(options.constructor==String){switch(options){case"stop":cont.cycleStop++;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);}cont.cycleTimeout=0;$(cont).removeData("cycle.opts");return false;case"pause":cont.cyclePause=1;return false;case"resume":cont.cyclePause=0;if(arg2===true){options=$(cont).data("cycle.opts");if(!options){log("options not found, can not resume");return false;}if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}go(options.elements,options,1,1);}return false;case"prev":case"next":var opts=$(cont).data("cycle.opts");if(!opts){log('options not found, "prev/next" ignored');return false;}$.fn.cycle[options](opts);return false;default:options={fx:options};}return options;}else{if(options.constructor==Number){var num=options;options=$(cont).data("cycle.opts");if(!options){log("options not found, can not advance slide");return false;}if(num<0||num>=options.elements.length){log("invalid slide index: "+num);return false;}options.nextSlide=num;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}if(typeof arg2=="string"){options.oneTimeFx=arg2;}go(options.elements,options,1,num>=options.currSlide);return false;}}return options;}function removeFilter(el,opts){if(!$.support.opacity&&opts.cleartype&&el.style.filter){try{el.style.removeAttribute("filter");}catch(smother){}}}function buildOptions($cont,$slides,els,options,o){var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});if(opts.autostop){opts.countdown=opts.autostopCount||els.length;}var cont=$cont[0];$cont.data("cycle.opts",opts);opts.$cont=$cont;opts.stopCount=cont.cycleStop;opts.elements=els;opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];opts.after.unshift(function(){opts.busy=0;});if(!$.support.opacity&&opts.cleartype){opts.after.push(function(){removeFilter(this,opts);});}if(opts.continuous){opts.after.push(function(){go(els,opts,0,!opts.rev);});}saveOriginalOpts(opts);if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($slides);}if($cont.css("position")=="static"){$cont.css("position","relative");}if(opts.width){$cont.width(opts.width);}if(opts.height&&opts.height!="auto"){$cont.height(opts.height);}if(opts.startingSlide){opts.startingSlide=parseInt(opts.startingSlide);}if(opts.random){opts.randomMap=[];for(var i=0;i<els.length;i++){opts.randomMap.push(i);}opts.randomMap.sort(function(a,b){return Math.random()-0.5;});opts.randomIndex=0;opts.startingSlide=opts.randomMap[0];}else{if(opts.startingSlide>=els.length){opts.startingSlide=0;}}opts.currSlide=opts.startingSlide=opts.startingSlide||0;var first=opts.startingSlide;$slides.css({position:"absolute",top:0,left:0}).hide().each(function(i){var z=first?i>=first?els.length-(i-first):first-i:els.length-i;$(this).css("z-index",z);});$(els[first]).css("opacity",1).show();removeFilter(els[first],opts);if(opts.fit&&opts.width){$slides.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}var reshape=opts.containerResize&&!$cont.innerHeight();if(reshape){var maxw=0,maxh=0;for(var j=0;j<els.length;j++){var $e=$(els[j]),e=$e[0],w=$e.outerWidth(),h=$e.outerHeight();if(!w){w=e.offsetWidth;}if(!h){h=e.offsetHeight;}maxw=w>maxw?w:maxw;maxh=h>maxh?h:maxh;}if(maxw>0&&maxh>0){$cont.css({width:maxw+"px",height:maxh+"px"});}}if(opts.pause){$cont.hover(function(){this.cyclePause++;},function(){this.cyclePause--;});}if(supportMultiTransitions(opts)===false){return false;}var requeue=false;options.requeueAttempts=options.requeueAttempts||0;$slides.each(function(){var $el=$(this);this.cycleH=(opts.fit&&opts.height)?opts.height:$el.height();this.cycleW=(opts.fit&&opts.width)?opts.width:$el.width();if($el.is("img")){var loadingIE=($.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);var loadingFF=($.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete);var loadingOp=($.browser.opera&&((this.cycleW==42&&this.cycleH==19)||(this.cycleW==37&&this.cycleH==17))&&!this.complete);var loadingOther=(this.cycleH==0&&this.cycleW==0&&!this.complete);if(loadingIE||loadingFF||loadingOp||loadingOther){if(o.s&&opts.requeueOnImageNotLoaded&&++options.requeueAttempts<100){log(options.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){$(o.s,o.c).cycle(options);},opts.requeueTimeout);requeue=true;return false;}else{log("could not determine size of image: "+this.src,this.cycleW,this.cycleH);}}}return true;});if(requeue){return false;}opts.cssBefore=opts.cssBefore||{};opts.animIn=opts.animIn||{};opts.animOut=opts.animOut||{};$slides.not(":eq("+first+")").css(opts.cssBefore);if(opts.cssFirst){$($slides[first]).css(opts.cssFirst);}if(opts.timeout){opts.timeout=parseInt(opts.timeout);if(opts.speed.constructor==String){opts.speed=$.fx.speeds[opts.speed]||parseInt(opts.speed);}if(!opts.sync){opts.speed=opts.speed/2;}while((opts.timeout-opts.speed)<250){opts.timeout+=opts.speed;}}if(opts.easing){opts.easeIn=opts.easeOut=opts.easing;}if(!opts.speedIn){opts.speedIn=opts.speed;}if(!opts.speedOut){opts.speedOut=opts.speed;}opts.slideCount=els.length;opts.currSlide=opts.lastSlide=first;if(opts.random){opts.nextSlide=opts.currSlide;if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{opts.nextSlide=opts.startingSlide>=(els.length-1)?0:opts.startingSlide+1;}if(!opts.multiFx){var init=$.fn.cycle.transitions[opts.fx];if($.isFunction(init)){init($cont,$slides,opts);}else{if(opts.fx!="custom"&&!opts.multiFx){log("unknown transition: "+opts.fx,"; slideshow terminating");return false;}}}var e0=$slides[first];if(opts.before.length){opts.before[0].apply(e0,[e0,e0,opts,true]);}if(opts.after.length>1){opts.after[1].apply(e0,[e0,e0,opts,true]);}if(opts.next){$(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?-1:1);});}if(opts.prev){$(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?1:-1);});}if(opts.pager){buildPager(els,opts);}exposeAddSlide(opts,els);return opts;}function saveOriginalOpts(opts){opts.original={before:[],after:[]};opts.original.cssBefore=$.extend({},opts.cssBefore);opts.original.cssAfter=$.extend({},opts.cssAfter);opts.original.animIn=$.extend({},opts.animIn);opts.original.animOut=$.extend({},opts.animOut);$.each(opts.before,function(){opts.original.before.push(this);});$.each(opts.after,function(){opts.original.after.push(this);});}function supportMultiTransitions(opts){var i,tx,txs=$.fn.cycle.transitions;if(opts.fx.indexOf(",")>0){opts.multiFx=true;opts.fxs=opts.fx.replace(/\s*/g,"").split(",");for(i=0;i<opts.fxs.length;i++){var fx=opts.fxs[i];tx=txs[fx];if(!tx||!txs.hasOwnProperty(fx)||!$.isFunction(tx)){log("discarding unknown transition: ",fx);opts.fxs.splice(i,1);i--;}}if(!opts.fxs.length){log("No valid transitions named; slideshow terminating.");return false;}}else{if(opts.fx=="all"){opts.multiFx=true;opts.fxs=[];for(p in txs){tx=txs[p];if(txs.hasOwnProperty(p)&&$.isFunction(tx)){opts.fxs.push(p);}}}}if(opts.multiFx&&opts.randomizeEffects){var r1=Math.floor(Math.random()*20)+30;for(i=0;i<r1;i++){var r2=Math.floor(Math.random()*opts.fxs.length);opts.fxs.push(opts.fxs.splice(r2,1)[0]);}debug("randomized fx sequence: ",opts.fxs);}return true;}function exposeAddSlide(opts,els){opts.addSlide=function(newSlide,prepend){var $s=$(newSlide),s=$s[0];if(!opts.autostopCount){opts.countdown++;}els[prepend?"unshift":"push"](s);if(opts.els){opts.els[prepend?"unshift":"push"](s);}opts.slideCount=els.length;$s.css("position","absolute");$s[prepend?"prependTo":"appendTo"](opts.$cont);if(prepend){opts.currSlide++;opts.nextSlide++;}if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($s);}if(opts.fit&&opts.width){$s.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}s.cycleH=(opts.fit&&opts.height)?opts.height:$s.height();s.cycleW=(opts.fit&&opts.width)?opts.width:$s.width();$s.css(opts.cssBefore);if(opts.pager){$.fn.cycle.createPagerAnchor(els.length-1,s,$(opts.pager),els,opts);}if($.isFunction(opts.onAddSlide)){opts.onAddSlide($s);}else{$s.hide();}};}$.fn.cycle.resetState=function(opts,fx){fx=fx||opts.fx;opts.before=[];opts.after=[];opts.cssBefore=$.extend({},opts.original.cssBefore);opts.cssAfter=$.extend({},opts.original.cssAfter);opts.animIn=$.extend({},opts.original.animIn);opts.animOut=$.extend({},opts.original.animOut);opts.fxFn=null;$.each(opts.original.before,function(){opts.before.push(this);});$.each(opts.original.after,function(){opts.after.push(this);});var init=$.fn.cycle.transitions[fx];if($.isFunction(init)){init(opts.$cont,$(opts.elements),opts);}};function go(els,opts,manual,fwd){if(manual&&opts.busy&&opts.manualTrump){$(els).stop(true,true);opts.busy=false;}if(opts.busy){return;}var p=opts.$cont[0],curr=els[opts.currSlide],next=els[opts.nextSlide];if(p.cycleStop!=opts.stopCount||p.cycleTimeout===0&&!manual){return;}if(!manual&&!p.cyclePause&&((opts.autostop&&(--opts.countdown<=0))||(opts.nowrap&&!opts.random&&opts.nextSlide<opts.currSlide))){if(opts.end){opts.end(opts);}return;}if(manual||!p.cyclePause){var fx=opts.fx;curr.cycleH=curr.cycleH||$(curr).height();curr.cycleW=curr.cycleW||$(curr).width();next.cycleH=next.cycleH||$(next).height();next.cycleW=next.cycleW||$(next).width();if(opts.multiFx){if(opts.lastFx==undefined||++opts.lastFx>=opts.fxs.length){opts.lastFx=0;}fx=opts.fxs[opts.lastFx];opts.currFx=fx;}if(opts.oneTimeFx){fx=opts.oneTimeFx;opts.oneTimeFx=null;}$.fn.cycle.resetState(opts,fx);if(opts.before.length){$.each(opts.before,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});}var after=function(){$.each(opts.after,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});};if(opts.nextSlide!=opts.currSlide){opts.busy=1;if(opts.fxFn){opts.fxFn(curr,next,opts,after,fwd);}else{if($.isFunction($.fn.cycle[opts.fx])){$.fn.cycle[opts.fx](curr,next,opts,after);}else{$.fn.cycle.custom(curr,next,opts,after,manual&&opts.fastOnEvent);}}}opts.lastSlide=opts.currSlide;if(opts.random){opts.currSlide=opts.nextSlide;if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{var roll=(opts.nextSlide+1)==els.length;opts.nextSlide=roll?0:opts.nextSlide+1;opts.currSlide=roll?els.length-1:opts.nextSlide-1;}if(opts.pager){$.fn.cycle.updateActivePagerLink(opts.pager,opts.currSlide);}}var ms=0;if(opts.timeout&&!opts.continuous){ms=getTimeout(curr,next,opts,fwd);}else{if(opts.continuous&&p.cyclePause){ms=10;}}if(ms>0){p.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev);},ms);}}$.fn.cycle.updateActivePagerLink=function(pager,currSlide){$(pager).find("a").removeClass("activeSlide").filter("a:eq("+currSlide+")").addClass("activeSlide");};function getTimeout(curr,next,opts,fwd){if(opts.timeoutFn){var t=opts.timeoutFn(curr,next,opts,fwd);while((t-opts.speed)<250){t+=opts.speed;}debug("calculated timeout: "+t+"; speed: "+opts.speed);if(t!==false){return t;}}return opts.timeout;}$.fn.cycle.next=function(opts){advance(opts,opts.rev?-1:1);};$.fn.cycle.prev=function(opts){advance(opts,opts.rev?1:-1);};function advance(opts,val){var els=opts.elements;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}if(opts.random&&val<0){opts.randomIndex--;if(--opts.randomIndex==-2){opts.randomIndex=els.length-2;}else{if(opts.randomIndex==-1){opts.randomIndex=els.length-1;}}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{if(opts.random){if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{opts.nextSlide=opts.currSlide+val;if(opts.nextSlide<0){if(opts.nowrap){return false;}opts.nextSlide=els.length-1;}else{if(opts.nextSlide>=els.length){if(opts.nowrap){return false;}opts.nextSlide=0;}}}}if($.isFunction(opts.prevNextClick)){opts.prevNextClick(val>0,opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,val>=0);return false;}function buildPager(els,opts){var $p=$(opts.pager);$.each(els,function(i,o){$.fn.cycle.createPagerAnchor(i,o,$p,els,opts);});$.fn.cycle.updateActivePagerLink(opts.pager,opts.startingSlide);}$.fn.cycle.createPagerAnchor=function(i,el,$p,els,opts){var a;if($.isFunction(opts.pagerAnchorBuilder)){a=opts.pagerAnchorBuilder(i,el);}else{a='<a href="#">'+(i+1)+"</a>";}if(!a){return;}var $a=$(a);if($a.parents("body").length===0){var arr=[];if($p.length>1){$p.each(function(){var $clone=$a.clone(true);$(this).append($clone);arr.push($clone);});$a=$(arr);}else{$a.appendTo($p);}}$a.bind(opts.pagerEvent,function(e){e.preventDefault();opts.nextSlide=i;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}if($.isFunction(opts.pagerClick)){opts.pagerClick(opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,opts.currSlide<i);return false;});if(opts.pagerEvent!="click"){$a.click(function(){return false;});}if(opts.pauseOnPagerHover){$a.hover(function(){opts.$cont[0].cyclePause++;},function(){opts.$cont[0].cyclePause--;});}};$.fn.cycle.hopsFromLast=function(opts,fwd){var hops,l=opts.lastSlide,c=opts.currSlide;if(fwd){hops=c>l?c-l:opts.slideCount-l;}else{hops=c<l?l-c:l+opts.slideCount-c;}return hops;};function clearTypeFix($slides){function hex(s){s=parseInt(s).toString(16);return s.length<2?"0"+s:s;}function getBg(e){for(;e&&e.nodeName.toLowerCase()!="html";e=e.parentNode){var v=$.css(e,"background-color");if(v.indexOf("rgb")>=0){var rgb=v.match(/\d+/g);return"#"+hex(rgb[0])+hex(rgb[1])+hex(rgb[2]);}if(v&&v!="transparent"){return v;}}return"#ffffff";}$slides.each(function(){$(this).css("background-color",getBg(this));});}$.fn.cycle.commonReset=function(curr,next,opts,w,h,rev){$(opts.elements).not(curr).hide();opts.cssBefore.opacity=1;opts.cssBefore.display="block";if(w!==false&&next.cycleW>0){opts.cssBefore.width=next.cycleW;}if(h!==false&&next.cycleH>0){opts.cssBefore.height=next.cycleH;}opts.cssAfter=opts.cssAfter||{};opts.cssAfter.display="none";$(curr).css("zIndex",opts.slideCount+(rev===true?1:0));$(next).css("zIndex",opts.slideCount+(rev===true?0:1));};$.fn.cycle.custom=function(curr,next,opts,cb,speedOverride){var $l=$(curr),$n=$(next);var speedIn=opts.speedIn,speedOut=opts.speedOut,easeIn=opts.easeIn,easeOut=opts.easeOut;$n.css(opts.cssBefore);if(speedOverride){if(typeof speedOverride=="number"){speedIn=speedOut=speedOverride;}else{speedIn=speedOut=1;}easeIn=easeOut=null;}var fn=function(){$n.animate(opts.animIn,speedIn,easeIn,cb);};$l.animate(opts.animOut,speedOut,easeOut,function(){if(opts.cssAfter){$l.css(opts.cssAfter);}if(!opts.sync){fn();}});if(opts.sync){fn();}};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(":eq("+opts.currSlide+")").css("opacity",0);opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.opacity=0;});opts.animIn={opacity:1};opts.animOut={opacity:0};opts.cssBefore={top:0,left:0};}};$.fn.cycle.ver=function(){return ver;};$.fn.cycle.defaults={fx:"fade",timeout:4000,timeoutFn:null,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,prevNextClick:null,prevNextEvent:"click",pager:null,pagerClick:null,pagerEvent:"click",pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!$.support.opacity,cleartypeNoBg:false,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0,manualTrump:true,requeueOnImageNotLoaded:true,requeueTimeout:250};})(jQuery);
/*
 * jQuery Cycle Plugin Transition Definitions
 * This script is a plugin for the jQuery Cycle Plugin
 * Examples and documentation at: http://malsup.com/jquery/cycle/
 * Copyright (c) 2007-2008 M. Alsup
 * Version:	 2.72
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
(function($){$.fn.cycle.transitions.none=function($cont,$slides,opts){opts.fxFn=function(curr,next,opts,after){$(next).show();$(curr).hide();after();};};$.fn.cycle.transitions.scrollUp=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssBefore={top:h,left:0};opts.cssFirst={top:0};opts.animIn={top:0};opts.animOut={top:-h};};$.fn.cycle.transitions.scrollDown=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssFirst={top:0};opts.cssBefore={top:-h,left:0};opts.animIn={top:0};opts.animOut={top:h};};$.fn.cycle.transitions.scrollLeft=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:0-w};};$.fn.cycle.transitions.scrollRight=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:-w,top:0};opts.animIn={left:0};opts.animOut={left:w};};$.fn.cycle.transitions.scrollHorz=function($cont,$slides,opts){$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts,fwd){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.left=fwd?(next.cycleW-1):(1-next.cycleW);opts.animOut.left=fwd?-curr.cycleW:curr.cycleW;});opts.cssFirst={left:0};opts.cssBefore={top:0};opts.animIn={left:0};opts.animOut={top:0};};$.fn.cycle.transitions.scrollVert=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push(function(curr,next,opts,fwd){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.top=fwd?(1-next.cycleH):(next.cycleH-1);opts.animOut.top=fwd?curr.cycleH:-curr.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0};opts.animIn={top:0};opts.animOut={left:0};};$.fn.cycle.transitions.slideX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;});opts.cssBefore={left:0,top:0,width:0};opts.animIn={width:"show"};opts.animOut={width:0};};$.fn.cycle.transitions.slideY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;});opts.cssBefore={left:0,top:0,height:0};opts.animIn={height:"show"};opts.animOut={height:0};};$.fn.cycle.transitions.shuffle=function($cont,$slides,opts){var i,w=$cont.css("overflow","visible").width();$slides.css({left:0,top:0});opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);});if(!opts.speedAdjusted){opts.speed=opts.speed/2;opts.speedAdjusted=true;}opts.random=0;opts.shuffle=opts.shuffle||{left:-w,top:15};opts.els=[];for(i=0;i<$slides.length;i++){opts.els.push($slides[i]);}for(i=0;i<opts.currSlide;i++){opts.els.push(opts.els.shift());}opts.fxFn=function(curr,next,opts,cb,fwd){var $el=fwd?$(curr):$(next);$(next).css(opts.cssBefore);var count=opts.slideCount;$el.animate(opts.shuffle,opts.speedIn,opts.easeIn,function(){var hops=$.fn.cycle.hopsFromLast(opts,fwd);for(var k=0;k<hops;k++){fwd?opts.els.push(opts.els.shift()):opts.els.unshift(opts.els.pop());}if(fwd){for(var i=0,len=opts.els.length;i<len;i++){$(opts.els[i]).css("z-index",len-i+count);}}else{var z=$(curr).css("z-index");$el.css("z-index",parseInt(z)+1+count);}$el.animate({left:0,top:0},opts.speedOut,opts.easeOut,function(){$(fwd?this:curr).hide();if(cb){cb();}});});};opts.cssBefore={display:"block",opacity:1,top:0,left:0};};$.fn.cycle.transitions.turnUp=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=next.cycleH;opts.animIn.height=next.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0,height:0};opts.animIn={top:0};opts.animOut={height:0};};$.fn.cycle.transitions.turnDown=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0,top:0,height:0};opts.animOut={height:0};};$.fn.cycle.transitions.turnLeft=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=next.cycleW;opts.animIn.width=next.cycleW;});opts.cssBefore={top:0,width:0};opts.animIn={left:0};opts.animOut={width:0};};$.fn.cycle.transitions.turnRight=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore={top:0,left:0,width:0};opts.animIn={left:0};opts.animOut={width:0};};$.fn.cycle.transitions.zoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false,true);opts.cssBefore.top=next.cycleH/2;opts.cssBefore.left=next.cycleW/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH};opts.animOut={width:0,height:0,top:curr.cycleH/2,left:curr.cycleW/2};});opts.cssFirst={top:0,left:0};opts.cssBefore={width:0,height:0};};$.fn.cycle.transitions.fadeZoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false);opts.cssBefore.left=next.cycleW/2;opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH};});opts.cssBefore={width:0,height:0};opts.animOut={opacity:0};};$.fn.cycle.transitions.blindX=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:w};};$.fn.cycle.transitions.blindY=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore={top:h,left:0};opts.animIn={top:0};opts.animOut={top:h};};$.fn.cycle.transitions.blindZ=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();var w=$cont.width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore={top:h,left:w};opts.animIn={top:0,left:0};opts.animOut={top:h,left:w};};$.fn.cycle.transitions.growX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=this.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:0};});opts.cssBefore={width:0,top:0};};$.fn.cycle.transitions.growY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=this.cycleH/2;opts.animIn={top:0,height:this.cycleH};opts.animOut={top:0};});opts.cssBefore={height:0,left:0};};$.fn.cycle.transitions.curtainX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true,true);opts.cssBefore.left=next.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:curr.cycleW/2,width:0};});opts.cssBefore={top:0,width:0};};$.fn.cycle.transitions.curtainY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false,true);opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,height:next.cycleH};opts.animOut={top:curr.cycleH/2,height:0};});opts.cssBefore={left:0,height:0};};$.fn.cycle.transitions.cover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);if(d=="right"){opts.cssBefore.left=-w;}else{if(d=="up"){opts.cssBefore.top=h;}else{if(d=="down"){opts.cssBefore.top=-h;}else{opts.cssBefore.left=w;}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0};};$.fn.cycle.transitions.uncover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(d=="right"){opts.animOut.left=w;}else{if(d=="up"){opts.animOut.top=-h;}else{if(d=="down"){opts.animOut.top=h;}else{opts.animOut.left=-w;}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0};};$.fn.cycle.transitions.toss=function($cont,$slides,opts){var w=$cont.css("overflow","visible").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(!opts.animOut.left&&!opts.animOut.top){opts.animOut={left:w*2,top:-h/2,opacity:0};}else{opts.animOut.opacity=0;}});opts.cssBefore={left:0,top:0};opts.animIn={left:0};};$.fn.cycle.transitions.wipe=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.cssBefore=opts.cssBefore||{};var clip;if(opts.clip){if(/l2r/.test(opts.clip)){clip="rect(0px 0px "+h+"px 0px)";}else{if(/r2l/.test(opts.clip)){clip="rect(0px "+w+"px "+h+"px "+w+"px)";}else{if(/t2b/.test(opts.clip)){clip="rect(0px "+w+"px 0px 0px)";}else{if(/b2t/.test(opts.clip)){clip="rect("+h+"px "+w+"px "+h+"px 0px)";}else{if(/zoom/.test(opts.clip)){var top=parseInt(h/2);var left=parseInt(w/2);clip="rect("+top+"px "+left+"px "+top+"px "+left+"px)";}}}}}}opts.cssBefore.clip=opts.cssBefore.clip||clip||"rect(0px 0px 0px 0px)";var d=opts.cssBefore.clip.match(/(\d+)/g);var t=parseInt(d[0]),r=parseInt(d[1]),b=parseInt(d[2]),l=parseInt(d[3]);opts.before.push(function(curr,next,opts){if(curr==next){return;}var $curr=$(curr),$next=$(next);$.fn.cycle.commonReset(curr,next,opts,true,true,false);opts.cssAfter.display="block";var step=1,count=parseInt((opts.speedIn/13))-1;(function f(){var tt=t?t-parseInt(step*(t/count)):0;var ll=l?l-parseInt(step*(l/count)):0;var bb=b<h?b+parseInt(step*((h-b)/count||1)):h;var rr=r<w?r+parseInt(step*((w-r)/count||1)):w;$next.css({clip:"rect("+tt+"px "+rr+"px "+bb+"px "+ll+"px)"});(step++<=count)?setTimeout(f,13):$curr.css("display","none");})();});opts.cssBefore={display:"block",opacity:1,top:0,left:0};opts.animIn={left:0};opts.animOut={left:0};};})(jQuery);



/*
 * Thickbox 3 - One Box To Rule Them All.
 * By Cody Lindley (http://www.codylindley.com)
 * Copyright (c) 2007 cody lindley
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
*/
var tb_pathToImage = "/assets/images/ajax-loader.gif";
eval(function(p,a,c,k,e,r){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--)r[e(c)]=k[c]||e(c);k=[function(e){return r[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}('$(o).2S(9(){1u(\'a.18, 3n.18, 3i.18\');1w=1p 1t();1w.L=2H});9 1u(b){$(b).s(9(){6 t=X.Q||X.1v||M;6 a=X.u||X.23;6 g=X.1N||P;19(t,a,g);X.2E();H P})}9 19(d,f,g){3m{3(2t o.v.J.2i==="2g"){$("v","11").r({A:"28%",z:"28%"});$("11").r("22","2Z");3(o.1Y("1F")===M){$("v").q("<U 5=\'1F\'></U><4 5=\'B\'></4><4 5=\'8\'></4>");$("#B").s(G)}}n{3(o.1Y("B")===M){$("v").q("<4 5=\'B\'></4><4 5=\'8\'></4>");$("#B").s(G)}}3(1K()){$("#B").1J("2B")}n{$("#B").1J("2z")}3(d===M){d=""}$("v").q("<4 5=\'K\'><1I L=\'"+1w.L+"\' /></4>");$(\'#K\').2y();6 h;3(f.O("?")!==-1){h=f.3l(0,f.O("?"))}n{h=f}6 i=/\\.2s$|\\.2q$|\\.2m$|\\.2l$|\\.2k$/;6 j=h.1C().2h(i);3(j==\'.2s\'||j==\'.2q\'||j==\'.2m\'||j==\'.2l\'||j==\'.2k\'){1D="";1G="";14="";1z="";1x="";R="";1n="";1r=P;3(g){E=$("a[@1N="+g+"]").36();25(D=0;((D<E.1c)&&(R===""));D++){6 k=E[D].u.1C().2h(i);3(!(E[D].u==f)){3(1r){1z=E[D].Q;1x=E[D].u;R="<1e 5=\'1X\'>&1d;&1d;<a u=\'#\'>2T &2R;</a></1e>"}n{1D=E[D].Q;1G=E[D].u;14="<1e 5=\'1U\'>&1d;&1d;<a u=\'#\'>&2O; 2N</a></1e>"}}n{1r=1b;1n="1t "+(D+1)+" 2L "+(E.1c)}}}S=1p 1t();S.1g=9(){S.1g=M;6 a=2x();6 x=a[0]-1M;6 y=a[1]-1M;6 b=S.z;6 c=S.A;3(b>x){c=c*(x/b);b=x;3(c>y){b=b*(y/c);c=y}}n 3(c>y){b=b*(y/c);c=y;3(b>x){c=c*(x/b);b=x}}13=b+30;1a=c+2G;$("#8").q("<a u=\'\' 5=\'1L\' Q=\'1o\'><1I 5=\'2F\' L=\'"+f+"\' z=\'"+b+"\' A=\'"+c+"\' 23=\'"+d+"\'/></a>"+"<4 5=\'2D\'>"+d+"<4 5=\'2C\'>"+1n+14+R+"</4></4><4 5=\'2A\'><a u=\'#\' 5=\'Z\' Q=\'1o\'>1l</a> 1k 1j 1s</4>");$("#Z").s(G);3(!(14==="")){9 12(){3($(o).N("s",12)){$(o).N("s",12)}$("#8").C();$("v").q("<4 5=\'8\'></4>");19(1D,1G,g);H P}$("#1U").s(12)}3(!(R==="")){9 1i(){$("#8").C();$("v").q("<4 5=\'8\'></4>");19(1z,1x,g);H P}$("#1X").s(1i)}o.1h=9(e){3(e==M){I=2w.2v}n{I=e.2u}3(I==27){G()}n 3(I==3k){3(!(R=="")){o.1h="";1i()}}n 3(I==3j){3(!(14=="")){o.1h="";12()}}};16();$("#K").C();$("#1L").s(G);$("#8").r({Y:"T"})};S.L=f}n{6 l=f.2r(/^[^\\?]+\\??/,\'\');6 m=2p(l);13=(m[\'z\']*1)+30||3h;1a=(m[\'A\']*1)+3g||3f;W=13-30;V=1a-3e;3(f.O(\'2j\')!=-1){1E=f.1B(\'3d\');$("#15").C();3(m[\'1A\']!="1b"){$("#8").q("<4 5=\'2f\'><4 5=\'1H\'>"+d+"</4><4 5=\'2e\'><a u=\'#\' 5=\'Z\' Q=\'1o\'>1l</a> 1k 1j 1s</4></4><U 1W=\'0\' 2d=\'0\' L=\'"+1E[0]+"\' 5=\'15\' 1v=\'15"+1f.2c(1f.1y()*2b)+"\' 1g=\'1m()\' J=\'z:"+(W+29)+"p;A:"+(V+17)+"p;\' > </U>")}n{$("#B").N();$("#8").q("<U 1W=\'0\' 2d=\'0\' L=\'"+1E[0]+"\' 5=\'15\' 1v=\'15"+1f.2c(1f.1y()*2b)+"\' 1g=\'1m()\' J=\'z:"+(W+29)+"p;A:"+(V+17)+"p;\'> </U>")}}n{3($("#8").r("Y")!="T"){3(m[\'1A\']!="1b"){$("#8").q("<4 5=\'2f\'><4 5=\'1H\'>"+d+"</4><4 5=\'2e\'><a u=\'#\' 5=\'Z\'>1l</a> 1k 1j 1s</4></4><4 5=\'F\' J=\'z:"+W+"p;A:"+V+"p\'></4>")}n{$("#B").N();$("#8").q("<4 5=\'F\' 3c=\'3b\' J=\'z:"+W+"p;A:"+V+"p;\'></4>")}}n{$("#F")[0].J.z=W+"p";$("#F")[0].J.A=V+"p";$("#F")[0].3a=0;$("#1H").11(d)}}$("#Z").s(G);3(f.O(\'37\')!=-1){$("#F").q($(\'#\'+m[\'26\']).1T());$("#8").24(9(){$(\'#\'+m[\'26\']).q($("#F").1T())});16();$("#K").C();$("#8").r({Y:"T"})}n 3(f.O(\'2j\')!=-1){16();3($.1q.35){$("#K").C();$("#8").r({Y:"T"})}}n{$("#F").34(f+="&1y="+(1p 33().32()),9(){16();$("#K").C();1u("#F a.18");$("#8").r({Y:"T"})})}}3(!m[\'1A\']){o.21=9(e){3(e==M){I=2w.2v}n{I=e.2u}3(I==27){G()}}}}31(e){}}9 1m(){$("#K").C();$("#8").r({Y:"T"})}9 G(){$("#2Y").N("s");$("#Z").N("s");$("#8").2X("2W",9(){$(\'#8,#B,#1F\').2V("24").N().C()});$("#K").C();3(2t o.v.J.2i=="2g"){$("v","11").r({A:"1Z",z:"1Z"});$("11").r("22","")}o.1h="";o.21="";H P}9 16(){$("#8").r({2U:\'-\'+20((13/2),10)+\'p\',z:13+\'p\'});3(!(1V.1q.2Q&&1V.1q.2P<7)){$("#8").r({38:\'-\'+20((1a/2),10)+\'p\'})}}9 2p(a){6 b={};3(!a){H b}6 c=a.1B(/[;&]/);25(6 i=0;i<c.1c;i++){6 d=c[i].1B(\'=\');3(!d||d.1c!=2){39}6 e=2a(d[0]);6 f=2a(d[1]);f=f.2r(/\\+/g,\' \');b[e]=f}H b}9 2x(){6 a=o.2M;6 w=1S.2o||1R.2o||(a&&a.1Q)||o.v.1Q;6 h=1S.1P||1R.1P||(a&&a.2n)||o.v.2n;1O=[w,h];H 1O}9 1K(){6 a=2K.2J.1C();3(a.O(\'2I\')!=-1&&a.O(\'3o\')!=-1){H 1b}}',62,211,'|||if|div|id|var||TB_window|function||||||||||||||else|document|px|append|css|click||href|body||||width|height|TB_overlay|remove|TB_Counter|TB_TempArray|TB_ajaxContent|tb_remove|return|keycode|style|TB_load|src|null|unbind|indexOf|false|title|TB_NextHTML|imgPreloader|block|iframe|ajaxContentH|ajaxContentW|this|display|TB_closeWindowButton||html|goPrev|TB_WIDTH|TB_PrevHTML|TB_iframeContent|tb_position||thickbox|tb_show|TB_HEIGHT|true|length|nbsp|span|Math|onload|onkeydown|goNext|Esc|or|close|tb_showIframe|TB_imageCount|Close|new|browser|TB_FoundURL|Key|Image|tb_init|name|imgLoader|TB_NextURL|random|TB_NextCaption|modal|split|toLowerCase|TB_PrevCaption|urlNoQuery|TB_HideSelect|TB_PrevURL|TB_ajaxWindowTitle|img|addClass|tb_detectMacXFF|TB_ImageOff|150|rel|arrayPageSize|innerHeight|clientWidth|self|window|children|TB_prev|jQuery|frameborder|TB_next|getElementById|auto|parseInt|onkeyup|overflow|alt|unload|for|inlineId||100||unescape|1000|round|hspace|TB_closeAjaxWindow|TB_title|undefined|match|maxHeight|TB_iframe|bmp|gif|png|clientHeight|innerWidth|tb_parseQuery|jpeg|replace|jpg|typeof|which|keyCode|event|tb_getPageSize|show|TB_overlayBG|TB_closeWindow|TB_overlayMacFFBGHack|TB_secondLine|TB_caption|blur|TB_Image|60|tb_pathToImage|mac|userAgent|navigator|of|documentElement|Prev|lt|version|msie|gt|ready|Next|marginLeft|trigger|fast|fadeOut|TB_imageOff|hidden||catch|getTime|Date|load|safari|get|TB_inline|marginTop|continue|scrollTop|TB_modal|class|TB_|45|440|40|630|input|188|190|substr|try|area|firefox'.split('|'),0,{}))
