

/*=====PAGE LAYOUTS==================*/

pageLayout_1 = new Array ();
	pageLayout_1[0] = '#layout-1';
	pageLayout_1[1] = new Array('grid-46','grid-46');

pageLayout_2 = new Array ();
	pageLayout_2[0] = '#layout-2';
	pageLayout_2[1] = new Array('grid-22','grid-22');

pageLayout_3 = new Array ();
	pageLayout_3[0] = '#layout-3';
	pageLayout_3[1] = new Array('grid-14','grid-14');

pageLayout_4 = new Array ();
	pageLayout_4[0] = '#layout-4';
	pageLayout_4[1] = new Array('grid-10','grid-10');


pageLayout = new Array (pageLayout_1, pageLayout_2, pageLayout_3, pageLayout_4);

currentLayout = pageLayout[0];

/*=====MODO CUSTOM ACCORDION==================*/


function modo_accordion(heading, active_class){
$(heading).click( function(){
	if ($(this).hasClass(active_class)){
		$(this).next().slideUp(500, 'easeInOutExpo');
		$(this).removeClass(active_class);
		}
	else{
	$(this).next().slideDown(500, 'easeInOutExpo');
	$(this).addClass(active_class);
	}
});

}


function reset_accordion(heading, active_class){
	$(heading).removeClass(active_class);
	$(heading).siblings().show();
	$(heading).addClass(active_class);
	
};


/*=====MODO CUSTOM INPUT LI SELECT==================*/

function modo_radio(parent_el){
	if($(parent_el).hasClass('disabled')){
	}
	else{
		$(parent_el).siblings().removeClass('selected');
		$(parent_el).addClass('selected');
		$(parent_el).children('input:radio').attr('checked','checked');
	}
}


/*=====DOM ARRAY TO INPUT FIELD==================*/

function sortable_loop(hidden_wrapper, this_element){
var sort_array = $(this_element).sortable("toArray");
var layout_pages = '';
for (i=0;i<sort_array.length;i++)
{	
	var killpageId = sort_array[i].replace('pageid', '');
	var myId = killpageId.replace(/-/gi, ' ');
	if(i == 0) layout_pages += myId;
	else layout_pages += ', ' + myId;
}

create_hidden_fields(hidden_wrapper, layout_pages);
}


function class_loop(hidden_wrapper, this_element){
	var layout_widths = '';
	i = 0;
	$(this_element + ' li').each(
			function( intIndex ){

			myClass = $(this).attr('class');
			
			if(i == 0) layout_widths += myClass;
			else layout_widths += ', ' + myClass;
			
			i++;
		}
	);
	
	create_hidden_fields(hidden_wrapper, layout_widths);
}

function create_hidden_fields(hidden_wrapper, dudevalue){
$(hidden_wrapper).val(dudevalue);
}


/*=====ADD COLUMN CLASS NAMES==================*/

function name_children(this_element){
	var child_el = $(this_element).children();
	for(var i = 0; i < child_el.length; i++){
		if(currentLayout[1].length <= i){
			lastEl = currentLayout[1].length-1;
			$(this_element + ' li:eq' +'(' + i + ')').removeClass().addClass(currentLayout[1][lastEl]);
		}
		else $(this_element + ' li:eq' +'(' + i + ')').removeClass().addClass(currentLayout[1][i]);
	}
	
}

/*=====ENABLE DISABLE LAYOUT OPTIONS==================*/

function sortable_sort(max, layoutOpts, this_element, page_to_element, widget_to_element){
	
	var child_count = $(this_element + ' li').size();
	var is_widget = $(this_element + ' li:last-child').attr('title');
	
	if (max < child_count){
		if (is_widget == 'widget') $(this_element + ' li:last-child').appendTo($(widget_to_element));
		
		else $(this_element + ' li:last-child').appendTo($(page_to_element));
	}
	
	var child_count = $(this_element + ' li').size();
	
	switch(child_count){
	
	case 0:
		$(layoutOpts + ' li').addClass('disabled');
		break;
	
	case 1:
		showlayoutOpts(layoutOpts, pageLayout[0][0], pageLayout[0][0]);
		currentLayout = pageLayout[0];
		name_children(this_element);
		
		break;
	
	case 2:
		showlayoutOpts(layoutOpts, pageLayout[1][0] + ', ' + pageLayout[0][0], pageLayout[1][0]);
		currentLayout = pageLayout[1];
		name_children(this_element);
		
		break;
		
	case 3:
		showlayoutOpts(layoutOpts, pageLayout[0][0] + ', ' + pageLayout[2][0], pageLayout[2][0]);
		
		currentLayout = pageLayout[2];
		name_children(this_element);
		
		break;
		
	case 4:
		showlayoutOpts(layoutOpts, pageLayout[0][0] + ', ' + pageLayout[1][0] + ', ' + pageLayout[3][0], pageLayout[3][0]);
		
		currentLayout = pageLayout[3];
		name_children(this_element);
		
		
		break;
		
	case 5:
		showlayoutOpts(layoutOpts, pageLayout[0][0], pageLayout[0][0]);
		currentLayout = pageLayout[0];
		name_children(this_element);
		
		break;
		
	case 6:
		showlayoutOpts(layoutOpts, pageLayout[0][0] + ', ' + pageLayout[1][0] + ', ' + pageLayout[2][0], pageLayout[2][0]);
	
		currentLayout = pageLayout[2];
		name_children(this_element);
		
		break;
		
	case 7:
		showlayoutOpts(layoutOpts, pageLayout[0][0], pageLayout[0][0]);
		currentLayout = pageLayout[0];
		name_children(this_element);
		
		break;
		
	case 8:
		showlayoutOpts(layoutOpts, pageLayout[0][0] + ', ' + pageLayout[1][0] + ', ' + pageLayout[3][0], pageLayout[3][0]);
		
		currentLayout = pageLayout[3];
		name_children(this_element);
		
		break;
		
	};
	
}


/*=====ENABLE DISABLE LAYOUT OPTIONS==================*/

function showlayoutOpts(mainUl, showLi, checkRadio){
	$(mainUl + ' li').removeClass('enabled');
	$(mainUl + ' li').addClass('disabled');
	$(showLi).removeClass('disabled');
	$(showLi).addClass('enabled');
	modo_radio(checkRadio); 
}

/*=====ADD A WIDGET ITEM TO THE WIDGET SORTABLE==================*/

function add_widget(to_element, widget_class){
	var widget_name = $('#widget-name').val();
	var widget_id = widget_name.replace(/ /gi, '-');
	var widget_count = 0;
	$('li').each(
			function( intIndex ){
			var widget_att = $(this).attr('rel');
			if (widget_att == widget_name)			
			widget_count++;
		}
	);
	var widget_new = widget_name + widget_count;
	
	if (widget_name == ''){
		widget_count++;
		$('<li title="widget" rel="' + widget_name + '" id="mywidget-Widget-' + widget_count + '" ><span>Widget ' + widget_count + '</span></li>').appendTo($(to_element));

	}
	
	else{

	if (widget_count >= 1){
		$('<li title="widget" rel="' + widget_name + '" id="mywidget-' + widget_id + '" ><span>' + widget_new + '</span></li>').appendTo($(to_element));
	}
	
	else {
	$('<li title="widget" rel="' + widget_name + '" id="mywidget-' + widget_id + '" ><span>' + widget_name + '</span></li>').appendTo($(to_element));
	};
	}
	
	$('#widget-name').val('');
	
}


/*=====REJECT WIDGET FROM PAGE SORTABLE==================*/

function reject_widget(this_element, to_element){
	$(this_element + ' li').each(
			function( intIndex ){
			var widgetCheck = $(this).attr('title');
			if(widgetCheck == 'widget') $(this).appendTo($(to_element));	
		}
	);
}

/*=====REJECT PAGE FROM WIDGET SORTABLE==================*/

function reject_page(this_element, to_element){
	$(this_element + ' li').each(
			function( intIndex ){
			var widgetCheck = $(this).attr('title');
			if(widgetCheck != 'widget') $(this).appendTo($(to_element));	
		}
	);
}

/*=====REMOVE WIDGET==================*/

function trash_widget(this_element){
	var widgetCheck = $(this_element + ' li').attr('title');
	if(widgetCheck == 'widget') $(this_element + ' li').remove();
	else reject_page(this_element, '#sortable');	
}


function layout_click(this_element){
		if($(this_element).hasClass('disabled')){
		}
		else{	
		var myIndex = $('#layout-options li').index(this_element);
		currentLayout = pageLayout[myIndex];
		name_children('#sortable-selected');
		}
}



/* ------------------------------------------------------------------------
	Class: prettyPhoto
	Use: Lightbox clone for jQuery
	Author: Stephane Caron (http://www.no-margin-for-errors.com)
	Version: 3.0
------------------------------------------------------------------------- */

(function($) {
	$.prettyPhoto = {version: '3.0'};
	
	$.fn.prettyPhoto = function(pp_settings) {
		pp_settings = jQuery.extend({
			animation_speed: 'normal', /* fast/slow/normal */
			slideshow: false, /* false OR interval time in ms */
			autoplay_slideshow: false, /* true/false */
			opacity: 0.80, /* Value between 0 and 1 */
			show_title: true, /* true/false */
			allow_resize: true, /* Resize the photos bigger than viewport. true/false */
			default_width: 600,
			default_height: 330,
			counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
			theme: 'light_rounded', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
			hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */
			wmode: 'opaque', /* Set the flash wmode attribute */
			autoplay: true, /* Automatically start videos: True/False */
			modal: false, /* If set to true, only the close button will close the window */
			overlay_gallery: false, /* If set to true, a gallery will overlay the fullscreen image on mouse over */
			keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */
			changepicturecallback: function(){}, /* Called everytime an item is shown/changed */
			callback: function(){}, /* Called when prettyPhoto is closed */
			markup: '<div class="pp_pic_holder"> \
						<div class="ppt">&nbsp;</div> \
						<div class="pp_top"> \
							<div class="pp_left"></div> \
							<div class="pp_middle"></div> \
							<div class="pp_right"></div> \
						</div> \
						<div class="pp_content_container"> \
							<div class="pp_left"> \
							<div class="pp_right"> \
								<div class="pp_content"> \
									<div class="pp_loaderIcon"></div> \
									<div class="pp_fade"> \
										<a href="#" class="pp_expand" title="Expand the image">Expand</a> \
										<div class="pp_hoverContainer"> \
											<div class="pp_nextContainer horizontal-slide"> \
												<a class="pp_next slide-right" href="#">next</a> \
											</div>\
											<div class="pp_prevContainer horizontal-slide"> \
												<a class="pp_previous slide-left" href="#">previous</a> \
											</div>\
										</div> \
										<div id="pp_full_res"></div> \
										<div class="pp_details clearfix"> \
											<p class="pp_description"></p> \
											<a class="pp_close" href="#">Close</a> \
											<div class="pp_nav"> \
												<a href="#" class="pp_arrow_previous">Previous</a> \
												<p class="currentTextHolder">0/0</p> \
												<a href="#" class="pp_arrow_next">Next</a> \
											</div> \
										</div> \
									</div> \
								</div> \
							</div> \
							</div> \
						</div> \
						<div class="pp_bottom"> \
							<div class="pp_left"></div> \
							<div class="pp_middle"></div> \
							<div class="pp_right"></div> \
						</div> \
					</div> \
					<div class="pp_overlay"></div>',
			gallery_markup: '<div class="pp_gallery"> \
								<a href="#" class="pp_arrow_previous">Previous</a> \
								<ul> \
									{gallery} \
								</ul> \
								<a href="#" class="pp_arrow_next">Next</a> \
							</div>',
			image_markup: '<img id="fullResImage" src="" />',
			flash_markup: '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',
			quicktime_markup: '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',
			iframe_markup: '<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',
			inline_markup: '<div class="pp_inline clearfix">{content}</div>',
			custom_markup: ''
		}, pp_settings);
		
		// Global variables accessible only by prettyPhoto
		var matchedObjects = this, percentBased = false, correctSizes, pp_open,
		
		// prettyPhoto container specific
		pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth,
		
		// Window size
		windowHeight = $(window).height(), windowWidth = $(window).width(),

		// Global elements
		pp_slideshow;
		
		doresize = true, scroll_pos = _get_scroll();
	
		// Window/Keyboard events
		$(window).unbind('resize').resize(function(){ _center_overlay(); _resize_overlay(); });
		
		if(pp_settings.keyboard_shortcuts) {
			$(document).unbind('keydown').keydown(function(e){
				if(typeof $pp_pic_holder != 'undefined'){
					if($pp_pic_holder.is(':visible')){
						switch(e.keyCode){
							case 37:
								$.prettyPhoto.changePage('previous');
								break;
							case 39:
								$.prettyPhoto.changePage('next');
								break;
							case 27:
								if(!settings.modal)
								$.prettyPhoto.close();
								break;
						};
						return false;
					};
				};
			});
		}
		
		
		/**
		* Initialize prettyPhoto.
		*/
		$.prettyPhoto.initialize = function() {
			settings = pp_settings;
			
			if($.browser.msie && parseInt($.browser.version) == 6) settings.theme = "light_square"; // Fallback to a supported theme for IE6
			
			_buildOverlay(this); // Build the overlay {this} being the caller
			
			if(settings.allow_resize)
				$(window).scroll(function(){ _center_overlay(); });
				
			_center_overlay();
			
			set_position = jQuery.inArray($(this).attr('href'), pp_images); // Define where in the array the clicked item is positionned
			
			$.prettyPhoto.open();
			
			return false;
		}


		/**
		* Opens the prettyPhoto modal box.
		* @param image {String,Array} Full path to the image to be open, can also be an array containing full images paths.
		* @param title {String,Array} The title to be displayed with the picture, can also be an array containing all the titles.
		* @param description {String,Array} The description to be displayed with the picture, can also be an array containing all the descriptions.
		*/
		$.prettyPhoto.open = function() {
			if(typeof settings == "undefined"){ // Means it's an API call, need to manually get the settings and set the variables
				settings = pp_settings;
				if($.browser.msie && $.browser.version == 6) settings.theme = "light_square"; // Fallback to a supported theme for IE6
				_buildOverlay(this); // Build the overlay {this} being the caller
				pp_images = $.makeArray(arguments[0]);
				pp_titles = (arguments[1]) ? $.makeArray(arguments[1]) : $.makeArray("");
				pp_descriptions = (arguments[2]) ? $.makeArray(arguments[2]) : $.makeArray("");
				isSet = (pp_images.length > 1) ? true : false;
				set_position = 0;
			}

			if($.browser.msie && $.browser.version == 6) $('select').css('visibility','hidden'); // To fix the bug with IE select boxes
			
			if(settings.hideflash) $('object,embed').css('visibility','hidden'); // Hide the flash

			_checkPosition($(pp_images).size()); // Hide the next/previous links if on first or last images.
		
			$('.pp_loaderIcon').show();
		
			// Fade the content in
			if($ppt.is(':hidden')) $ppt.css('opacity',0).show();
			$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);

			// Display the current position
			$pp_pic_holder.find('.currentTextHolder').text((set_position+1) + settings.counter_separator_label + $(pp_images).size());

			// Set the description
			$pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));

			// Set the title
			(settings.show_title && pp_titles[set_position] != "") ? $ppt.html(unescape(pp_titles[set_position])) : $ppt.html('&nbsp;');
			
			// Get the dimensions
			movie_width = ( parseFloat(grab_param('width',pp_images[set_position])) ) ? grab_param('width',pp_images[set_position]) : settings.default_width.toString();
			movie_height = ( parseFloat(grab_param('height',pp_images[set_position])) ) ? grab_param('height',pp_images[set_position]) : settings.default_height.toString();
			
			// If the size is % based, calculate according to window dimensions
			if(movie_width.indexOf('%') != -1 || movie_height.indexOf('%') != -1){
				movie_height = parseFloat(($(window).height() * parseFloat(movie_height) / 100) - 150);
				movie_width = parseFloat(($(window).width() * parseFloat(movie_width) / 100) - 150);
				percentBased = true;
			}else{
				percentBased = false;
			}
			
			// Fade the holder
			$pp_pic_holder.fadeIn(function(){
				imgPreloader = "";
				
				// Inject the proper content
				switch(_getFileType(pp_images[set_position])){
					case 'image':
						imgPreloader = new Image();

						// Preload the neighbour images
						nextImage = new Image();
						if(isSet && set_position > $(pp_images).size()) nextImage.src = pp_images[set_position + 1];
						prevImage = new Image();
						if(isSet && pp_images[set_position - 1]) prevImage.src = pp_images[set_position - 1];

						$pp_pic_holder.find('#pp_full_res')[0].innerHTML = settings.image_markup;
						$pp_pic_holder.find('#fullResImage').attr('src',pp_images[set_position]);

						imgPreloader.onload = function(){
							// Fit item to viewport
							correctSizes = _fitToViewport(imgPreloader.width,imgPreloader.height);

							_showContent();
						};

						imgPreloader.onerror = function(){
							alert('Image cannot be loaded. Make sure the path is correct and image exist.');
							$.prettyPhoto.close();
						};
					
						imgPreloader.src = pp_images[set_position];
					break;
				
					case 'youtube':
						correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport

						movie = 'http://www.youtube.com/v/'+grab_param('v',pp_images[set_position]);
						if(settings.autoplay) movie += "&autoplay=1";
					
						toInject = settings.flash_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);
					break;
				
					case 'vimeo':
						correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport
					
						movie_id = pp_images[set_position];
						var regExp = /http:\/\/(www\.)?vimeo.com\/(\d+)/;
						var match = movie_id.match(regExp);
						
						movie = 'http://player.vimeo.com/video/'+ match[2] +'?title=0&amp;byline=0&amp;portrait=0';
						if(settings.autoplay) movie += "&autoplay=1;";
				
						vimeo_width = correctSizes['width'] + '/embed/?moog_width='+ correctSizes['width'];
				
						toInject = settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,correctSizes['height']).replace(/{path}/g,movie);
					break;
				
					case 'quicktime':
						correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport
						correctSizes['height']+=15; correctSizes['contentHeight']+=15; correctSizes['containerHeight']+=5; // Add space for the control bar
				
						toInject = settings.quicktime_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);
					break;
				
					case 'flash':
						correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport
					
						flash_vars = pp_images[set_position];
						flash_vars = flash_vars.substring(pp_images[set_position].indexOf('flashvars') + 10,pp_images[set_position].length);

						filename = pp_images[set_position];
						filename = filename.substring(0,filename.indexOf('?'));
					
						toInject =  settings.flash_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars);
					break;
				
					case 'iframe':
						correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport
				
						frame_url = pp_images[set_position];
						frame_url = frame_url.substr(0,frame_url.indexOf('iframe')-1);
				
						toInject = settings.iframe_markup.replace(/{width}/g,correctSizes['width']).replace(/{height}/g,correctSizes['height']).replace(/{path}/g,frame_url);
					break;
					
					case 'custom':
						correctSizes = _fitToViewport(movie_width,movie_height); // Fit item to viewport
					
						toInject = settings.custom_markup;
					break;
				
					case 'inline':
						// to get the item height clone it, apply default width, wrap it in the prettyPhoto containers , then delete
						myClone = $(pp_images[set_position]).clone().css({'width':settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline clearfix"></div></div>').appendTo($('body'));
						correctSizes = _fitToViewport($(myClone).width(),$(myClone).height());
						$(myClone).remove();
						toInject = settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html());
					break;
				};

				if(!imgPreloader){
					$pp_pic_holder.find('#pp_full_res')[0].innerHTML = toInject;
				
					// Show content
					_showContent();
				};
			});

			return false;
		};

	
		/**
		* Change page in the prettyPhoto modal box
		* @param direction {String} Direction of the paging, previous or next.
		*/
		$.prettyPhoto.changePage = function(direction){
			currentGalleryPage = 0;
			
			if(direction == 'previous') {
				set_position--;
				if (set_position < 0){
					set_position = 0;
					return;
				};
			}else if(direction == 'next'){
				set_position++;
				if(set_position > $(pp_images).size()-1) {
					set_position = 0;
				}
			}else{
				set_position=direction;
			};

			if(!doresize) doresize = true; // Allow the resizing of the images
			$('.pp_contract').removeClass('pp_contract').addClass('pp_expand');

			_hideContent(function(){ $.prettyPhoto.open(); });
		};


		/**
		* Change gallery page in the prettyPhoto modal box
		* @param direction {String} Direction of the paging, previous or next.
		*/
		$.prettyPhoto.changeGalleryPage = function(direction){
			if(direction=='next'){
				currentGalleryPage ++;

				if(currentGalleryPage > totalPage){
					currentGalleryPage = 0;
				};
			}else if(direction=='previous'){
				currentGalleryPage --;

				if(currentGalleryPage < 0){
					currentGalleryPage = totalPage;
				};
			}else{
				currentGalleryPage = direction;
			};
			
			// Slide the pages, if we're on the last page, find out how many items we need to slide. To make sure we don't have an empty space.
			itemsToSlide = (currentGalleryPage == totalPage) ? pp_images.length - ((totalPage) * itemsPerPage) : itemsPerPage;
			
			$pp_pic_holder.find('.pp_gallery li').each(function(i){
				$(this).animate({
					'left': (i * itemWidth) - ((itemsToSlide * itemWidth) * currentGalleryPage)
				});
			});
		};


		/**
		* Start the slideshow...
		*/
		$.prettyPhoto.startSlideshow = function(){
			if(typeof pp_slideshow == 'undefined'){
				$pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){
					$.prettyPhoto.stopSlideshow();
					return false;
				});
				pp_slideshow = setInterval($.prettyPhoto.startSlideshow,settings.slideshow);
			}else{
				$.prettyPhoto.changePage('next');	
			};
		}


		/**
		* Stop the slideshow...
		*/
		$.prettyPhoto.stopSlideshow = function(){
			$pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){
				$.prettyPhoto.startSlideshow();
				return false;
			});
			clearInterval(pp_slideshow);
			pp_slideshow=undefined;
		}


		/**
		* Closes prettyPhoto.
		*/
		$.prettyPhoto.close = function(){

			clearInterval(pp_slideshow);
			
			$pp_pic_holder.stop().find('object,embed').css('visibility','hidden');
			
			$('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){ $(this).remove(); });
			
			$pp_overlay.fadeOut(settings.animation_speed, function(){
				if($.browser.msie && $.browser.version == 6) $('select').css('visibility','visible'); // To fix the bug with IE select boxes
				
				if(settings.hideflash) $('object,embed').css('visibility','visible'); // Show the flash
				
				$(this).remove(); // No more need for the prettyPhoto markup
				
				$(window).unbind('scroll');
				
				settings.callback();
				
				doresize = true;
				
				pp_open = false;
				
				delete settings;
			});
		};
	
		/**
		* Set the proper sizes on the containers and animate the content in.
		*/
		_showContent = function(){
			$('.pp_loaderIcon').hide();
			
			$ppt.fadeTo(settings.animation_speed,1);

			// Calculate the opened top position of the pic holder
			projectedTop = scroll_pos['scrollTop'] + ((windowHeight/2) - (correctSizes['containerHeight']/2));
			if(projectedTop < 0) projectedTop = 0;

			// Resize the content holder
			$pp_pic_holder.find('.pp_content').animate({'height':correctSizes['contentHeight']},settings.animation_speed);
			
			// Resize picture the holder
			$pp_pic_holder.animate({
				'top': projectedTop,
				'left': (windowWidth/2) - (correctSizes['containerWidth']/2),
				'width': correctSizes['containerWidth']
			},settings.animation_speed,function(){
				$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(correctSizes['height']).width(correctSizes['width']);

				$pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed); // Fade the new content

				// Show the nav
				if(isSet && _getFileType(pp_images[set_position])=="image") { $pp_pic_holder.find('.pp_hoverContainer').show(); }else{ $pp_pic_holder.find('.pp_hoverContainer').hide(); }
			
				if(correctSizes['resized']) $('a.pp_expand,a.pp_contract').fadeIn(settings.animation_speed); // Fade the resizing link if the image is resized
				
				if(settings.autoplay_slideshow && !pp_slideshow && !pp_open) $.prettyPhoto.startSlideshow();
				
				settings.changepicturecallback(); // Callback!
				
				pp_open = true;
			});
			
			_insert_gallery();
		};
		
		/**
		* Hide the content...DUH!
		*/
		function _hideContent(callback){
			// Fade out the current picture
			$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');
			$pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){
				$('.pp_loaderIcon').show();
				
				callback();
			});
		};
	
		/**
		* Check the item position in the gallery array, hide or show the navigation links
		* @param setCount {integer} The total number of items in the set
		*/
		function _checkPosition(setCount){
			// If at the end, hide the next link
			if(set_position == setCount-1) {
				$pp_pic_holder.find('a.pp_next').css('visibility','hidden');
				$pp_pic_holder.find('a.pp_next').addClass('disabled').unbind('click');
			}else{ 
				$pp_pic_holder.find('a.pp_next').css('visibility','visible');
				$pp_pic_holder.find('a.pp_next.disabled').removeClass('disabled').bind('click',function(){
					$.prettyPhoto.changePage('next');
					return false;
				});
			};
		
			// If at the beginning, hide the previous link
			if(set_position == 0) {
				$pp_pic_holder
					.find('a.pp_previous')
					.css('visibility','hidden')
					.addClass('disabled')
					.unbind('click');
			}else{
				$pp_pic_holder.find('a.pp_previous.disabled')
					.css('visibility','visible')
					.removeClass('disabled')
					.bind('click',function(){
						$.prettyPhoto.changePage('previous');
						return false;
					});
			};
			
			(setCount > 1) ? $('.pp_nav').show() : $('.pp_nav').hide(); // Hide the bottom nav if it's not a set.
		};
	
		/**
		* Resize the item dimensions if it's bigger than the viewport
		* @param width {integer} Width of the item to be opened
		* @param height {integer} Height of the item to be opened
		* @return An array containin the "fitted" dimensions
		*/
		function _fitToViewport(width,height){
			resized = false;

			_getDimensions(width,height);
			
			// Define them in case there's no resize needed
			imageWidth = width, imageHeight = height;

			if( ((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)) && doresize && settings.allow_resize && !percentBased) {
				resized = true, fitting = false;
			
				while (!fitting){
					if((pp_containerWidth > windowWidth)){
						imageWidth = (windowWidth - 300);
						imageHeight = (height/width) * imageWidth;
					}else if((pp_containerHeight > windowHeight)){
						imageHeight = (windowHeight - 300);
						imageWidth = (width/height) * imageHeight;
					}else{
						fitting = true;
					};

					pp_containerHeight = imageHeight, pp_containerWidth = imageWidth;
				};
			
				_getDimensions(imageWidth,imageHeight);
			};

			return {
				width:Math.floor(imageWidth),
				height:Math.floor(imageHeight),
				containerHeight:Math.floor(pp_containerHeight),
				containerWidth:Math.floor(pp_containerWidth) + 40, // 40 behind the side padding
				contentHeight:Math.floor(pp_contentHeight),
				contentWidth:Math.floor(pp_contentWidth),
				resized:resized
			};
		};
		
		/**
		* Get the containers dimensions according to the item size
		* @param width {integer} Width of the item to be opened
		* @param height {integer} Height of the item to be opened
		*/
		function _getDimensions(width,height){
			width = parseFloat(width);
			height = parseFloat(height);
			
			// Get the details height, to do so, I need to clone it since it's invisible
			$pp_details = $pp_pic_holder.find('.pp_details');
			$pp_details.width(width);
			detailsHeight = parseFloat($pp_details.css('marginTop')) + parseFloat($pp_details.css('marginBottom'));
			$pp_details = $pp_details.clone().appendTo($('body')).css({
				'position':'absolute',
				'top':-10000
			});
			detailsHeight += $pp_details.height();
			detailsHeight = (detailsHeight <= 34) ? 36 : detailsHeight; // Min-height for the details
			if($.browser.msie && $.browser.version==7) detailsHeight+=8;
			$pp_details.remove();
			
			// Get the container size, to resize the holder to the right dimensions
			pp_contentHeight = height + detailsHeight;
			pp_contentWidth = width;
			pp_containerHeight = pp_contentHeight + $ppt.height() + $pp_pic_holder.find('.pp_top').height() + $pp_pic_holder.find('.pp_bottom').height();
			pp_containerWidth = width;
		}
	
		function _getFileType(itemSrc){
			if (itemSrc.match(/youtube\.com\/watch/i)) {
				return 'youtube';
			}else if (itemSrc.match(/vimeo\.com/i)) {
				return 'vimeo';
			}else if(itemSrc.indexOf('.mov') != -1){ 
				return 'quicktime';
			}else if(itemSrc.indexOf('.swf') != -1){
				return 'flash';
			}else if(itemSrc.indexOf('iframe') != -1){
				return 'iframe';
			}else if(itemSrc.indexOf('custom') != -1){
				return 'custom';
			}else if(itemSrc.substr(0,1) == '#'){
				return 'inline';
			}else{
				return 'image';
			};
		};
	
		function _center_overlay(){
			if(doresize && typeof $pp_pic_holder != 'undefined') {
				scroll_pos = _get_scroll();
				
				titleHeight = $ppt.height(), contentHeight = $pp_pic_holder.height(), contentwidth = $pp_pic_holder.width();
				
				projectedTop = (windowHeight/2) + scroll_pos['scrollTop'] - (contentHeight/2);
				
				$pp_pic_holder.css({
					'top': projectedTop,
					'left': (windowWidth/2) + scroll_pos['scrollLeft'] - (contentwidth/2)
				});
			};
		};
	
		function _get_scroll(){
			if (self.pageYOffset) {
				return {scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};
			} else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
				return {scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};
			} else if (document.body) {// all other Explorers
				return {scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};
			};
		};
	
		function _resize_overlay() {
			windowHeight = $(window).height(), windowWidth = $(window).width();
			
			if(typeof $pp_overlay != "undefined") $pp_overlay.height($(document).height());
		};
	
		function _insert_gallery(){
			if(isSet && settings.overlay_gallery && _getFileType(pp_images[set_position])=="image") {
				itemWidth = 52+5; // 52 beign the thumb width, 5 being the right margin.
				navWidth = (settings.theme == "facebook") ? 58 : 38; // Define the arrow width depending on the theme
				
				itemsPerPage = Math.floor((correctSizes['containerWidth'] - 100 - navWidth) / itemWidth);
				itemsPerPage = (itemsPerPage < pp_images.length) ? itemsPerPage : pp_images.length;
				totalPage = Math.ceil(pp_images.length / itemsPerPage) - 1;

				// Hide the nav in the case there's no need for links
				if(totalPage == 0){
					navWidth = 0; // No nav means no width!
					$pp_pic_holder.find('.pp_gallery .pp_arrow_next,.pp_gallery .pp_arrow_previous').hide();
				}else{
					$pp_pic_holder.find('.pp_gallery .pp_arrow_next,.pp_gallery .pp_arrow_previous').show();
				};

				galleryWidth = itemsPerPage * itemWidth + navWidth;
				
				// Set the proper width to the gallery items
				$pp_pic_holder.find('.pp_gallery')
					.width(galleryWidth)
					.css('margin-left',-(galleryWidth/2));
					
				$pp_pic_holder
					.find('.pp_gallery ul')
					.width(itemsPerPage * itemWidth)
					.find('li.selected')
					.removeClass('selected');
				
				goToPage = (Math.floor(set_position/itemsPerPage) <= totalPage) ? Math.floor(set_position/itemsPerPage) : totalPage;
				
				
				if(itemsPerPage) {
					$pp_pic_holder.find('.pp_gallery').hide().show().removeClass('disabled');
				}else{
					$pp_pic_holder.find('.pp_gallery').hide().addClass('disabled');
				}
				
				$.prettyPhoto.changeGalleryPage(goToPage);
				
				$pp_pic_holder
					.find('.pp_gallery ul li:eq('+set_position+')')
					.addClass('selected');
			}else{
				$pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave');
				$pp_pic_holder.find('.pp_gallery').hide();
			}
		}
	
		function _buildOverlay(caller){
			// Find out if the picture is part of a set
			theRel = $(caller).attr('rel');
			galleryRegExp = /\[(?:.*)\]/;
			isSet = (galleryRegExp.exec(theRel)) ? true : false;
			
			// Put the SRCs, TITLEs, ALTs into an array.
			pp_images = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr('rel').indexOf(theRel) != -1) return $(n).attr('href'); }) : $.makeArray($(caller).attr('href'));
			pp_titles = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr('rel').indexOf(theRel) != -1) return ($(n).find('img').attr('alt')) ? $(n).find('img').attr('alt') : ""; }) : $.makeArray($(caller).find('img').attr('alt'));
			pp_descriptions = (isSet) ? jQuery.map(matchedObjects, function(n, i){ if($(n).attr('rel').indexOf(theRel) != -1) return ($(n).attr('title')) ? $(n).attr('title') : ""; }) : $.makeArray($(caller).attr('title'));
			
			$('body').append(settings.markup); // Inject the markup
			
			$pp_pic_holder = $('.pp_pic_holder') , $ppt = $('.ppt'), $pp_overlay = $('div.pp_overlay'); // Set my global selectors
			
			// Inject the inline gallery!
			if(isSet && settings.overlay_gallery) {
				currentGalleryPage = 0;
				toInject = "";
				for (var i=0; i < pp_images.length; i++) {
					var regex = new RegExp("(.*?)\.(jpg|jpeg|png|gif)$");
					var results = regex.exec( pp_images[i] );
					if(!results){
						classname = 'default';
					}else{
						classname = '';
					}
					toInject += "<li class='"+classname+"'><a href='#'><img src='" + pp_images[i] + "' width='50' alt='' /></a></li>";
				};
				
				toInject = settings.gallery_markup.replace(/{gallery}/g,toInject);
				
				$pp_pic_holder.find('#pp_full_res').after(toInject);
				
				$pp_pic_holder.find('.pp_gallery .pp_arrow_next').click(function(){
					$.prettyPhoto.changeGalleryPage('next');
					$.prettyPhoto.stopSlideshow();
					return false;
				});
				
				$pp_pic_holder.find('.pp_gallery .pp_arrow_previous').click(function(){
					$.prettyPhoto.changeGalleryPage('previous');
					$.prettyPhoto.stopSlideshow();
					return false;
				});
				
				$pp_pic_holder.find('.pp_content').hover(
					function(){
						$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn();
					},
					function(){
						$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut();
					});

				itemWidth = 52+5; // 52 beign the thumb width, 5 being the right margin.
				$pp_pic_holder.find('.pp_gallery ul li').each(function(i){
					$(this).css({
						'position':'absolute',
						'left': i * itemWidth
					});

					$(this).find('a').unbind('click').click(function(){
						$.prettyPhoto.changePage(i);
						$.prettyPhoto.stopSlideshow();
						return false;
					});
				});
			};
			
			
			// Inject the play/pause if it's a slideshow
			if(settings.slideshow){
				$pp_pic_holder.find('.pp_nav').prepend('<a href="#" class="pp_play">Play</a>')
				$pp_pic_holder.find('.pp_nav .pp_play').click(function(){
					$.prettyPhoto.startSlideshow();
					return false;
				});
			}
			
			$pp_pic_holder.attr('class','pp_pic_holder ' + settings.theme); // Set the proper theme
			
			$pp_overlay
				.css({
					'opacity':0,
					'height':$(document).height(),
					'width':$(document).width()
					})
				.bind('click',function(){
					if(!settings.modal) $.prettyPhoto.close();
				});

			$('a.pp_close').bind('click',function(){ $.prettyPhoto.close(); return false; });

			$('a.pp_expand').bind('click',function(e){
				// Expand the image
				if($(this).hasClass('pp_expand')){
					$(this).removeClass('pp_expand').addClass('pp_contract');
					doresize = false;
				}else{
					$(this).removeClass('pp_contract').addClass('pp_expand');
					doresize = true;
				};
			
				_hideContent(function(){ $.prettyPhoto.open(); });
		
				return false;
			});
		
			$pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){
				$.prettyPhoto.changePage('previous');
				$.prettyPhoto.stopSlideshow();
				return false;
			});
		
			$pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){
				$.prettyPhoto.changePage('next');
				$.prettyPhoto.stopSlideshow();
				return false;
			});
			
			_center_overlay(); // Center it
		};
		
		return this.unbind('click').click($.prettyPhoto.initialize); // Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
	};
	
	function grab_param(name,url){
	  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	  var regexS = "[\\?&]"+name+"=([^&#]*)";
	  var regex = new RegExp( regexS );
	  var results = regex.exec( url );
	  return ( results == null ) ? "" : results[1];
	}
	
})(jQuery);






/**
 * jQuery.labelify - Display in-textbox hints
 * Stuart Langridge, http://www.kryogenix.org/
 * Released into the public domain
 * Date: 25th June 2008
 * @author Stuart Langridge
 * @version 1.3
 *
 *
 * Basic calling syntax: $("input").labelify();
 * Defaults to taking the in-field label from the field's title attribute
 *
 * You can also pass an options object with the following keys:
 *   text
 *     "title" to get the in-field label from the field's title attribute 
 *      (this is the default)
 *     "label" to get the in-field label from the inner text of the field's label
 *      (note that the label must be attached to the field with for="fieldid")
 *     a function which takes one parameter, the input field, and returns
 *      whatever text it likes
 *
 *   labelledClass
 *     a class that will be applied to the input field when it contains the
 *      label and removed when it contains user input. Defaults to blank.
 *  
 */
jQuery.fn.labelify = function(settings) {
  settings = jQuery.extend({
    text: "title",
    labelledClass: ""
  }, settings);
  var lookups = {
    title: function(input) {
      return $(input).attr("title");
    },
    label: function(input) {
      return $("label[for=" + input.id +"]").text();
    }
  };
  var lookup;
  var jQuery_labellified_elements = $(this);
  return $(this).each(function() {
    if (typeof settings.text === "string") {
      lookup = lookups[settings.text]; // what if not there?
    } else {
      lookup = settings.text; // what if not a fn?
    };
    // bail if lookup isn't a function or if it returns undefined
    if (typeof lookup !== "function") { return; }
    var lookupval = lookup(this);
    if (!lookupval) { return; }

    // need to strip newlines because the browser strips them
    // if you set textbox.value to a string containing them    
    $(this).data("label",lookup(this).replace(/\n/g,''));
    $(this).focus(function() {
      if (this.value === $(this).data("label")) {
        this.value = this.defaultValue;
        $(this).removeClass(settings.labelledClass);
      }
    }).blur(function(){
      if (this.value === this.defaultValue) {
        this.value = $(this).data("label");
        $(this).addClass(settings.labelledClass);
      }
    });
    
    var removeValuesOnExit = function() {
      jQuery_labellified_elements.each(function(){
        if (this.value === $(this).data("label")) {
          this.value = this.defaultValue;
          $(this).removeClass(settings.labelledClass);
        }
      })
    };
    
    $(this).parents("form").submit(removeValuesOnExit);
    $(window).unload(removeValuesOnExit);
    
    if (this.value !== this.defaultValue) {
      // user already started typing; don't overwrite their work!
      return;
    }
    // actually set the value
    this.value = $(this).data("label");
    $(this).addClass(settings.labelledClass);

  });
};



/**
 * Equal Heights Plugin
 * Equalize the heights of elements. Great for columns or any elements
 * that need to be the same size (floats, etc).
 * 
 * Version 1.0
 * Updated 12/10/2008
 *
 * Copyright (c) 2008 Rob Glazebrook (cssnewbie.com) 
 *
 * Usage: $(object).equalHeights([minHeight], [maxHeight]);
 * 
 * Example 1: $(".cols").equalHeights(); Sets all columns to the same height.
 * Example 2: $(".cols").equalHeights(400); Sets all cols to at least 400px tall.
 * Example 3: $(".cols").equalHeights(100,300); Cols are at least 100 but no more
 * than 300 pixels tall. Elements with too much content will gain a scrollbar.
 * 
 */

(function($) {
	$.fn.equalHeights = function(minHeight, maxHeight) {
		tallest = (minHeight) ? minHeight : 0;
		this.each(function() {
			if($(this).height() > tallest) {
				tallest = $(this).height();
			}
		});
		if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
		return this.each(function() {
			$(this).height(tallest);
		});
	}
})(jQuery);



/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	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;
	}
});



/*
 * jQuery Tools 1.2.5 - The missing UI library for the Web
 * 
 * [tabs, tooltip, tooltip.slide, toolbox.history]
 * 
 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
 * 
 * http://flowplayer.org/tools/
 * 
 * File generated: Tue Nov 16 07:02:16 GMT 2010
 */
(function(c){function p(d,b,a){var e=this,l=d.add(this),h=d.find(a.tabs),i=b.jquery?b:d.children(b),j;h.length||(h=d.children());i.length||(i=d.parent().find(b));i.length||(i=c(b));c.extend(this,{click:function(f,g){var k=h.eq(f);if(typeof f=="string"&&f.replace("#","")){k=h.filter("[href*="+f.replace("#","")+"]");f=Math.max(h.index(k),0)}if(a.rotate){var n=h.length-1;if(f<0)return e.click(n,g);if(f>n)return e.click(0,g)}if(!k.length){if(j>=0)return e;f=a.initialIndex;k=h.eq(f)}if(f===j)return e;
g=g||c.Event();g.type="onBeforeClick";l.trigger(g,[f]);if(!g.isDefaultPrevented()){o[a.effect].call(e,f,function(){g.type="onClick";l.trigger(g,[f])});j=f;h.removeClass(a.current);k.addClass(a.current);return e}},getConf:function(){return a},getTabs:function(){return h},getPanes:function(){return i},getCurrentPane:function(){return i.eq(j)},getCurrentTab:function(){return h.eq(j)},getIndex:function(){return j},next:function(){return e.click(j+1)},prev:function(){return e.click(j-1)},destroy:function(){h.unbind(a.event).removeClass(a.current);
i.find("a[href^=#]").unbind("click.T");return e}});c.each("onBeforeClick,onClick".split(","),function(f,g){c.isFunction(a[g])&&c(e).bind(g,a[g]);e[g]=function(k){k&&c(e).bind(g,k);return e}});if(a.history&&c.fn.history){c.tools.history.init(h);a.event="history"}h.each(function(f){c(this).bind(a.event,function(g){e.click(f,g);return g.preventDefault()})});i.find("a[href^=#]").bind("click.T",function(f){e.click(c(this).attr("href"),f)});if(location.hash&&a.tabs=="a"&&d.find("[href="+location.hash+"]").length)e.click(location.hash);
else if(a.initialIndex===0||a.initialIndex>0)e.click(a.initialIndex)}c.tools=c.tools||{version:"1.2.5"};c.tools.tabs={conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialIndex:0,event:"click",rotate:false,history:false},addEffect:function(d,b){o[d]=b}};var o={"default":function(d,b){this.getPanes().hide().eq(d).show();b.call()},fade:function(d,b){var a=this.getConf(),e=a.fadeOutSpeed,l=this.getPanes();e?l.fadeOut(e):l.hide();l.eq(d).fadeIn(a.fadeInSpeed,b)},slide:function(d,
b){this.getPanes().slideUp(200);this.getPanes().eq(d).slideDown(400,b)},ajax:function(d,b){this.getPanes().eq(0).load(this.getTabs().eq(d).attr("href"),b)}},m;c.tools.tabs.addEffect("horizontal",function(d,b){m||(m=this.getPanes().eq(0).width());this.getCurrentPane().animate({width:0},function(){c(this).hide()});this.getPanes().eq(d).animate({width:m},function(){c(this).show();b.call()})});c.fn.tabs=function(d,b){var a=this.data("tabs");if(a){a.destroy();this.removeData("tabs")}if(c.isFunction(b))b=
{onBeforeClick:b};b=c.extend({},c.tools.tabs.conf,b);this.each(function(){a=new p(c(this),d,b);c(this).data("tabs",a)});return b.api?a:this}})(jQuery);
(function(f){function p(a,b,c){var h=c.relative?a.position().top:a.offset().top,d=c.relative?a.position().left:a.offset().left,i=c.position[0];h-=b.outerHeight()-c.offset[0];d+=a.outerWidth()+c.offset[1];if(/iPad/i.test(navigator.userAgent))h-=f(window).scrollTop();var j=b.outerHeight()+a.outerHeight();if(i=="center")h+=j/2;if(i=="bottom")h+=j;i=c.position[1];a=b.outerWidth()+a.outerWidth();if(i=="center")d-=a/2;if(i=="left")d-=a;return{top:h,left:d}}function u(a,b){var c=this,h=a.add(c),d,i=0,j=
0,m=a.attr("title"),q=a.attr("data-tooltip"),r=o[b.effect],l,s=a.is(":input"),v=s&&a.is(":checkbox, :radio, select, :button, :submit"),t=a.attr("type"),k=b.events[t]||b.events[s?v?"widget":"input":"def"];if(!r)throw'Nonexistent effect "'+b.effect+'"';k=k.split(/,\s*/);if(k.length!=2)throw"Tooltip: bad events configuration for "+t;a.bind(k[0],function(e){clearTimeout(i);if(b.predelay)j=setTimeout(function(){c.show(e)},b.predelay);else c.show(e)}).bind(k[1],function(e){clearTimeout(j);if(b.delay)i=
setTimeout(function(){c.hide(e)},b.delay);else c.hide(e)});if(m&&b.cancelDefault){a.removeAttr("title");a.data("title",m)}f.extend(c,{show:function(e){if(!d){if(q)d=f(q);else if(b.tip)d=f(b.tip).eq(0);else if(m)d=f(b.layout).addClass(b.tipClass).appendTo(document.body).hide().append(m);else{d=a.next();d.length||(d=a.parent().next())}if(!d.length)throw"Cannot find tooltip for "+a;}if(c.isShown())return c;d.stop(true,true);var g=p(a,d,b);b.tip&&d.html(a.data("title"));e=e||f.Event();e.type="onBeforeShow";
h.trigger(e,[g]);if(e.isDefaultPrevented())return c;g=p(a,d,b);d.css({position:"absolute",top:g.top,left:g.left});l=true;r[0].call(c,function(){e.type="onShow";l="full";h.trigger(e)});g=b.events.tooltip.split(/,\s*/);if(!d.data("__set")){d.bind(g[0],function(){clearTimeout(i);clearTimeout(j)});g[1]&&!a.is("input:not(:checkbox, :radio), textarea")&&d.bind(g[1],function(n){n.relatedTarget!=a[0]&&a.trigger(k[1].split(" ")[0])});d.data("__set",true)}return c},hide:function(e){if(!d||!c.isShown())return c;
e=e||f.Event();e.type="onBeforeHide";h.trigger(e);if(!e.isDefaultPrevented()){l=false;o[b.effect][1].call(c,function(){e.type="onHide";h.trigger(e)});return c}},isShown:function(e){return e?l=="full":l},getConf:function(){return b},getTip:function(){return d},getTrigger:function(){return a}});f.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(e,g){f.isFunction(b[g])&&f(c).bind(g,b[g]);c[g]=function(n){n&&f(c).bind(g,n);return c}})}f.tools=f.tools||{version:"1.2.5"};f.tools.tooltip=
{conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,position:["top","center"],offset:[0,0],relative:false,cancelDefault:true,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"<div/>",tipClass:"tooltip"},addEffect:function(a,b,c){o[a]=[b,c]}};var o={toggle:[function(a){var b=this.getConf(),c=this.getTip();b=b.opacity;b<1&&c.css({opacity:b});c.show();a.call()},function(a){this.getTip().hide();
a.call()}],fade:[function(a){var b=this.getConf();this.getTip().fadeTo(b.fadeInSpeed,b.opacity,a)},function(a){this.getTip().fadeOut(this.getConf().fadeOutSpeed,a)}]};f.fn.tooltip=function(a){var b=this.data("tooltip");if(b)return b;a=f.extend(true,{},f.tools.tooltip.conf,a);if(typeof a.position=="string")a.position=a.position.split(/,?\s/);this.each(function(){b=new u(f(this),a);f(this).data("tooltip",b)});return a.api?b:this}})(jQuery);
(function(d){var i=d.tools.tooltip;d.extend(i.conf,{direction:"up",bounce:false,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!d.browser.msie});var e={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};i.addEffect("slide",function(g){var a=this.getConf(),f=this.getTip(),b=a.slideFade?{opacity:a.opacity}:{},c=e[a.direction]||e.up;b[c[1]]=c[0]+"="+a.slideOffset;a.slideFade&&f.css({opacity:0});f.show().animate(b,a.slideInSpeed,g)},function(g){var a=this.getConf(),f=a.slideOffset,
b=a.slideFade?{opacity:0}:{},c=e[a.direction]||e.up,h=""+c[0];if(a.bounce)h=h=="+"?"-":"+";b[c[1]]=h+"="+f;this.getTip().animate(b,a.slideOutSpeed,function(){d(this).hide();g.call()})})})(jQuery);
(function(b){function h(c){if(c){var a=d.contentWindow.document;a.open().close();a.location.hash=c}}var g,d,f,i;b.tools=b.tools||{version:"1.2.5"};b.tools.history={init:function(c){if(!i){if(b.browser.msie&&b.browser.version<"8"){if(!d){d=b("<iframe/>").attr("src","javascript:false;").hide().get(0);b("body").append(d);setInterval(function(){var a=d.contentWindow.document;a=a.location.hash;g!==a&&b.event.trigger("hash",a)},100);h(location.hash||"#")}}else setInterval(function(){var a=location.hash;
a!==g&&b.event.trigger("hash",a)},100);f=!f?c:f.add(c);c.click(function(a){var e=b(this).attr("href");d&&h(e);if(e.slice(0,1)!="#"){location.href="#"+e;return a.preventDefault()}});i=true}}};b(window).bind("hash",function(c,a){a?f.filter(function(){var e=b(this).attr("href");return e==a||e==a.replace("#","")}).trigger("history",[a]):f.eq(0).trigger("history",[a]);g=a});b.fn.history=function(c){b.tools.history.init(this);return this.bind("history",c)}})(jQuery);




/*	
 *	jQuery carouFredSel 4.1.2
 *	Demo's and documentation:
 *	caroufredsel.frebsite.nl
 *	
 *	Copyright (c) 2010 Fred Heusschen
 *	www.frebsite.nl
 *
 *	Dual licensed under the MIT and GPL licenses.
 *	http://en.wikipedia.org/wiki/MIT_License
 *	http://en.wikipedia.org/wiki/GNU_General_Public_License
 */



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}('(z($){$.1m.1n=z(o){q(S.W==0)B 16(\'4d 4e 2Z.\');q(S.W>1){B S.1o(z(){$(S).1n(o)})}A l=S,$19=l[0],$r=$(S);l.30=z(o,b){A c=[\'u\',\'T\',\'E\',\'K\',\'L\',\'U\'];o=2m(o);1M(A a=0;a<c.W;a++){o[c[a]]=2m(o[c[a]])}q(y o.T==\'J\'){q(o.T<=50)o.T={u:o.T};F o.T={13:o.T}}F{q(y o.T==\'1c\')o.T={Y:o.T}}q(y o.u==\'J\')o.u={C:o.u};F q(y o.u==\'1c\')o.u={C:o.u,1N:o.u,25:o.u};q(b){26=$.1O(H,{},$.1m.1n.31,o)}4=$.1O(H,{},$.1m.1n.31,o);4.27=P;1v=(4.1v==\'3m\'||4.1v==\'1w\')?\'L\':\'K\';q(4.1v==\'3n\'||4.1v==\'1w\'){4.w=[\'1N\',\'3o\',\'3p\',\'25\',\'3q\',\'3r\',\'1w\',\'2n\',\'1P\',0,1,2,3]}F{4.w=[\'25\',\'3q\',\'3r\',\'1N\',\'3o\',\'3p\',\'2n\',\'1w\',\'1Q\',3,2,1,0]}A d=M($r);A e=32(d,4,5,P);q(4[4.w[3]]==\'E\'){4[4.w[3]]=e;4.u[4.w[3]]=e}q(!4.u[4.w[3]]){4.u[4.w[3]]=(33(d,4,5))?\'X\':d[4.w[5]](H)}q(!4[4.w[3]]){4[4.w[3]]=4.u[4.w[3]]}q(!4.u[4.w[0]]){4.u[4.w[0]]=(33(d,4,2))?\'X\':d[4.w[2]](H)}q(!4.u.C&&4.u[4.w[0]]==\'X\'){4.u.C=\'X\'}q(!4.u.C&&!4[4.w[0]]){q(4.u[4.w[0]]!=\'X\'){4[4.w[0]]=34(n.1R(),4,1)}}q(!4.u.C){4.u.C=(y 4[4.w[0]]==\'J\'&&4.u[4.w[0]]!=\'X\')?1x.3s(4[4.w[0]]/4.u[4.w[0]]):\'X\'}q(!4[4.w[0]]){4[4.w[0]]=(4.u.C!=\'X\'&&4.u[4.w[0]]!=\'X\')?4.u.C*4.u[4.w[0]]:\'X\'}q(4.u.C==\'X\'){4.27=H;4.35=(4[4.w[0]]==\'X\')?34(n.1R(),4,1):4[4.w[0]];q(4.I===P||4.I===0){4[4.w[0]]=\'X\'}4.u.C=28($r,4,0)}F{q(4.I===P){4.I=0}}q(y 4.I==\'1a\'){4.I=(4[4.w[0]]==\'X\')?0:\'E\'}4.u.1D=4.u.C;4.R=P;q(4.I==\'E\'){4.I=[0,0,0,0];q(4[4.w[0]]!=\'X\'){4.R=\'E\';A p=2o(3t($r,4),4);4.I[4.w[10]]=p[0];4.I[4.w[12]]=p[0]}q(4[4.w[3]]!=\'X\'){A p=(4[4.w[3]]-e)/2;q(p<0)p=0;4.I[4.w[9]]=p;4.I[4.w[11]]=p}}F{4.I=3u(4.I);4.R=(4.I[0]==0&&4.I[1]==0&&4.I[2]==0&&4.I[3]==0)?P:H}q(y 4.u.2p!=\'J\')4.u.2p=(4.27)?1:4.u.C;q(y 4.T.u!=\'J\')4.T.u=(4.27)?\'X\':4.u.C;q(y 4.T.13!=\'J\')4.T.13=4f;4.E=29(4.E,P,H);4.K=29(4.K);4.L=29(4.L);4.U=29(4.U,H);4.E=$.1O(H,{},4.T,4.E);4.K=$.1O(H,{},4.T,4.K);4.L=$.1O(H,{},4.T,4.L);4.U=$.1O(H,{},4.T,4.U);q(y 4.U.2q!=\'14\')4.U.2q=P;q(y 4.U.36!=\'z\')4.U.36=$.1m.1n.3v;q(y 4.E.Z!=\'14\')4.E.Z=H;q(y 4.E.2a!=\'14\')4.E.2a=H;q(y 4.E.3a!=\'J\')4.E.3a=0;q(y 4.E.1E!=\'J\')4.E.1E=(4.E.13<10)?4g:4.E.13*5};l.3w=z(){q($r.N(\'1F\')==\'3x\'||$r.N(\'1F\')==\'4h\'){16(\'4i 4j-4k "1F" 4l 4m "4n" 4o "3y".\')}n.N({1F:\'3y\',4p:\'3z\',2b:$r.N(\'2b\'),1P:$r.N(\'1P\'),1Q:$r.N(\'1Q\'),2c:$r.N(\'2c\')});$r.17(\'3A\',{1N:$r.N(\'1N\'),25:$r.N(\'25\'),2b:$r.N(\'2b\'),1P:$r.N(\'1P\'),1Q:$r.N(\'1Q\'),2c:$r.N(\'2c\'),\'3b\':$r.N(\'3b\'),1F:$r.N(\'1F\'),2n:$r.N(\'2n\'),1w:$r.N(\'1w\')}).N({2b:0,1P:0,1Q:0,2c:0,\'3b\':\'4q\',1F:\'3x\'});q(4.R){M($r).1o(z(){A m=1y($(S).N(4.w[8]));q(1G(m))m=0;$(S).17(\'1g\',m)})}2r(4,G)};l.3B=z(){l.3c();$r.15(\'1p\',z(e,g){q(y g!=\'14\')g=P;q(g)2d=H;q(2s!=1S)4r(2s);q(2t!=1S)3C(2t);q(2u!=1S)3C(2u);A a=4.E.1E-1T,1H=2v-1x.2w(a*2v/4.E.1E);q(1H!=0){q(4.E.3D)4.E.3D.1b($19,1H,a)}});$r.15(\'Z\',z(e,d,f,g){$r.D(\'1p\');q(!4.E.Z)B;q(y g!=\'14\'){q(y f==\'14\')g=f;F q(y d==\'14\')g=d;F g=P}q(y f!=\'J\'){q(y d==\'J\')f=d;F f=0}q(d!=\'K\'&&d!=\'L\')d=1v;q(g)2d=P;q(2d)B;A a=4.E.1E-1T,3E=a+f;1H=2v-1x.2w(a*2v/4.E.1E);2s=3F(z(){q($r.1q(\':3d\')){$r.D(\'Z\',d)}F{1T=0;$r.D(d,4.E)}},3E);q(4.E.1U===\'4s\'){2t=4t(z(){1T+=50},50)}q(1H==0){q(4.E.3G)4.E.3G.1b($19,1H,a)}q(4.E.3H){2u=3F(z(){4.E.3H.1b($19,1H,a)},f)}});$r.15(\'K L\',z(e){q(2d||$r.1q(\':3d\')||$r.1q(\':3z\')){e.3I();B}q(4.u.2p>=G){16(\'1V 3J u: 2x 2y\');e.3I();B}1T=0});q(4.27){$r.15(\'K\',z(e,a,b){q(y a==\'J\')b=a;q(y a!=\'1d\')a=4.K;q(y b!=\'J\')b=(y a.u==\'J\')?a.u:4.u.C;2e=b;4.u.1D=4.u.C;A c=M($r);q(4.R){1e(c,4)}4.u.C=3K($r,4,2e);b=4.u.C-4.u.1D+2e;q(b<=0){4.u.C=28($r,4,G-2e);b=2e}q(4.R){1e(c,4,H)}$r.D(\'2z\',[a,b])});$r.15(\'L\',z(e,a,b){q(y a==\'J\')b=a;q(y a!=\'1d\')a=4.L;q(y b!=\'J\')b=(y a.u==\'J\')?a.u:4.u.C;4.u.1D=4.u.C;A c=M($r);1e(c,4);4.u.C=28($r,4,b);q(4.u.1D-b>=4.u.C){4.u.C=28($r,4,++b)}1e(c,4,H);$r.D(\'2A\',[a,b])})}F{$r.15(\'K\',z(e,a,b){$r.D(\'2z\',[a,b])});$r.15(\'L\',z(e,a,b){$r.D(\'2A\',[a,b])})}$r.15(\'2z\',z(e,b,c){q(y b==\'J\')c=b;q(y b!=\'1d\')b=4.K;q(y c!=\'J\')c=(y b.u==\'J\')?b.u:4.u.C;q(y c!=\'J\')B 16(\'1V a 2B J: 2x 2y\');q(b.2C&&!b.2C.1b($19))B;q(!4.1z){A d=G-O;q(d-c<0){c=d}q(O==0){c=0}}O+=c;q(O>=G)O-=G;q(!4.1z){q(O==0&&c!=0&&b.2D)b.2D.1b($19);q(4.2E){q(c==0){$r.D(\'L\',G-4.u.C);B}}F{q(O==0&&4.K.V)4.K.V.2F(\'2f\');q(4.L.V)4.L.V.3e(\'2f\')}}q(c==0)B;M($r,\':2g(\'+(G-c-1)+\')\').4u($r);q(G<4.u.C+c)M($r,\':1h(\'+((4.u.C+c)-G)+\')\').3L(H).3f($r);A f=3M($r,4,c),1j=3g($r,4),1I=M($r,\':1r(\'+(c-1)+\')\'),1k=f.1i(\':1W\'),1s=1j.1i(\':1W\');q(4.R){1e(1k,4);1e(1s,4)}q(4.R==\'E\'){A p=2o(3g($r,4,c),4)}A g=1X(M($r,\':1h(\'+c+\')\'),4,0),1A=2G(2H(1j,4,H),4,!4.R);q(4.R){1e(1k,4,4.I[4.w[10]]);1e(1I,4,4.I[4.w[12]])}q(4.R==\'E\'){4.I[4.w[9]]=p[1];4.I[4.w[10]]=p[0];4.I[4.w[11]]=p[1];4.I[4.w[12]]=p[0]}A h={},3h={},1Y={},1Z={},Q=b.13;q(Q==\'E\')Q=4.T.13/4.T.u*c;F q(Q<=0)Q=0;F q(Q<10)Q=g/Q;q(b.2I)b.2I.1b($19,f,1j,1A,Q);q(4.R){A i=4.I[4.w[12]];1Y[4.w[8]]=1I.17(\'1g\');3h[4.w[8]]=1s.17(\'1g\')+4.I[4.w[10]];1Z[4.w[8]]=1k.17(\'1g\');1I.1J().1t(1Y,{13:Q,Y:b.Y});1s.1J().1t(3h,{13:Q,Y:b.Y});1k.1J().1t(1Z,{13:Q,Y:b.Y})}F{A i=0}h[4.w[6]]=i;q(4[4.w[0]]==\'X\'||4[4.w[3]]==\'X\'){n.1J().1t(1A,{13:Q,Y:b.Y})}A j=c;$r.N(4.w[6],-g);$r.1t(h,{13:Q,Y:b.Y,3N:z(){q(b.2J)b.2J.1b($19,f,1j,1A);q(G<4.u.C+c){M($r,\':2g(\'+(G-1)+\')\').2h()}A a=M($r,\':1r(\'+(4.u.C+c-1)+\')\');q(4.R)a.N(4.w[8],a.17(\'1g\'))}});$r.D(\'1K\').D(\'Z\',Q)});$r.15(\'2A\',z(e,c,d){q(y c==\'J\')d=c;q(y c!=\'1d\')c=4.L;q(y d!=\'J\')d=(y c.u==\'J\')?c.u:4.u.C;q(y d!=\'J\')B 16(\'1V a 2B J: 2x 2y\');q(c.2C&&!c.2C.1b($19))B;q(!4.1z){q(O==0){q(d>G-4.u.C){d=G-4.u.C}}F{q(O-d<4.u.C){d=O-4.u.C}}}O-=d;q(O<0)O+=G;q(!4.1z){q(O==4.u.C&&d!=0&&c.2D)c.2D.1b($19);q(4.2E){q(d==0){$r.D(\'K\',G-4.u.C);B}}F{q(O==4.u.C&&4.L.V)4.L.V.2F(\'2f\');q(4.K.V)4.K.V.3e(\'2f\')}}q(d==0)B;q(G<4.u.C+d)M($r,\':1h(\'+((4.u.C+d)-G)+\')\').3L(H).3f($r);A f=3O($r,4),1j=3i($r,4,d),1I=f.1i(\':1r(\'+(d-1)+\')\'),1k=f.1i(\':1W\'),1s=1j.1i(\':1W\');q(4.R){1e(1k,4);1e(1s,4)}q(4.R==\'E\'){A p=2o(3i($r,4,d),4)}A g=1X(M($r,\':1h(\'+d+\')\'),4,0),1A=2G(2H(1j,4,H),4,!4.R);q(4.R){1e(1k,4,4.I[4.w[10]]);1e(1s,4,4.I[4.w[10]])}q(4.R==\'E\'){4.I[4.w[9]]=p[1];4.I[4.w[10]]=p[0];4.I[4.w[11]]=p[1];4.I[4.w[12]]=p[0]}A h={},1Z={},1Y={},Q=c.13;q(Q==\'E\')Q=4.T.13/4.T.u*d;F q(Q<=0)Q=0;F q(Q<10)Q=g/Q;q(c.2I)c.2I.1b($19,f,1j,1A,Q);q(4.R){1Z[4.w[8]]=1k.17(\'1g\');1Y[4.w[8]]=1I.17(\'1g\')+4.I[4.w[12]];1s.N(4.w[8],1s.17(\'1g\')+4.I[4.w[10]]);1k.1J().1t(1Z,{13:Q,Y:c.Y});1I.1J().1t(1Y,{13:Q,Y:c.Y})}h[4.w[6]]=-g;q(4[4.w[0]]==\'X\'||4[4.w[3]]==\'X\'){n.1J().1t(1A,{13:Q,Y:c.Y})}A i=d;$r.1t(h,{13:Q,Y:c.Y,3N:z(){q(c.2J)c.2J.1b($19,f,1j,1A);q(G<4.u.C+i){M($r,\':2g(\'+(G-1)+\')\').2h()}A a=(4.R)?4.I[4.w[12]]:0;$r.N(4.w[6],a);A b=M($r,\':1h(\'+i+\')\').3f($r).1i(\':1W\');q(4.R)b.N(4.w[8],b.17(\'1g\'))}});$r.D(\'1K\').D(\'Z\',Q)});$r.15(\'20\',z(e,a,b,c,d){q($r.1q(\':3d\'))B;a=2i(a,b,c,O,G,$r);q(a==0)B;q(y d!=\'1d\')d=P;q(4.1z){q(a<G/2)$r.D(\'L\',[d,a]);F $r.D(\'K\',[d,G-a])}F{q(O==0||O>a)$r.D(\'L\',[d,a]);F $r.D(\'K\',[d,G-a])}});$r.15(\'3P\',z(e,a,b,c,d){q(y a==\'1d\'&&y a.2j==\'1a\')a=$(a);q(y a==\'1c\')a=$(a);q(y a!=\'1d\'||y a.2j==\'1a\'||a.W==0)B 16(\'1V a 2B 1d.\');q(y b==\'1a\'||b==\'2K\'){$r.3j(a)}F{b=2i(b,d,c,O,G,$r);A f=M($r,\':1r(\'+b+\')\');q(4.R){a.1o(z(){A m=1y($(S).N(4.w[8]));q(1G(m))m=0;$(S).17(\'1g\',m)})}q(f.W){q(b<O)O+=a.W;q(O>=G)O-=G;f.4v(a)}F{$r.3j(a)}}G=M($r).W;$r.D(\'21\');2k($r,4);2r(4,G);$r.D(\'1K\',H)});$r.15(\'3Q\',z(e,a,b,c){q(y a==\'1a\'||a==\'2K\'){M($r,\':1W\').2h()}F{a=2i(a,c,b,O,G,$r);A d=M($r,\':1r(\'+a+\')\');q(d.W){q(a<O)O-=d.W;d.2h()}}G=M($r).W;2k($r,4);2r(4,G);$r.D(\'1K\',H)});$r.15(\'21\',z(e,a,b){q(y a==\'1a\'||a.W==0)a=$(\'4w\');F q(y a==\'1c\')a=$(a);q(y a!=\'1d\')B 16(\'1V a 2B 1d.\');q(y b!=\'1c\'||b.W==0)b=\'a.3R\';a.4x(b).1o(z(){A h=S.3S||\'\';q(h.W>0&&M($r).3T($(h))!=-1){$(S).18(\'22\').22(z(e){e.1u();$r.D(\'20\',h)})}})});$r.15(\'2L\',z(e,a){q(O==0)A b=0;F A b=G-O;q(y a==\'z\')a.1b($19,b)});$r.15(\'23\',z(e,a,b){q(y a==\'z\'){a.1b($19,4)}F q(y b==\'z\'){A c=3U(\'4.\'+a);q(y c==\'1a\')c=\'\';b.1b($19,c)}F q(y a!=\'1a\'&&y b!=\'1a\'){3U(\'26.\'+a+\' = b\');l.30(26);2k($r,4)}});$r.15(\'1L\',z(e){$r.D(\'1p\').N($r.17(\'3A\'));l.3c();n.4y($r)});$r.15(\'1K\',z(e,b){q(y 2K!=\'14\')2K=P;q(!4.U.1f)B;q(y b==\'14\'&&b){M(4.U.1f).2h();1M(A a=0;a<1x.2w(G/4.u.C);a++){A i=M($r,\':1r(\'+2i(a*4.u.C,0,H,O,G,$r)+\')\');4.U.1f.3j(4.U.36(a+1,i))}M(4.U.1f).18(\'22\').1o(z(a){$(S).22(z(e){e.1u();$r.D(\'20\',[a*4.u.C,0,H,4.U])})})}A c=1x.2w(G/4.u.C-1);q(O==0)A d=0;F q(O<G%4.u.C)A d=0;F q(O==4.u.C&&!4.1z)A d=c;F A d=1x.4z((G-O)/4.u.C);q(d<0)d=0;q(d>c)d=c;M(4.U.1f).3e(\'2Z\').1i(\':4A-4B(\'+(d+1)+\')\').2F(\'2Z\')})};l.3c=z(){$r.18(\'1p\').18(\'Z\').18(\'K\').18(\'L\').18(\'2z\').18(\'2A\').18(\'20\').18(\'3P\').18(\'3Q\').18(\'21\').18(\'1L\').18(\'1K\').18(\'2L\').18(\'23\')};l.3V=z(){q(4.E.1U&&4.E.Z){n.2M(z(){$r.D(\'1p\')},z(){$r.D(\'Z\')})}q(4.K.V){4.K.V.22(z(e){e.1u();$r.D(\'K\')});q(4.K.1U&&4.E.Z){4.K.V.2M(z(){$r.D(\'1p\')},z(){$r.D(\'Z\')})}q(!4.1z&&!4.2E){4.K.V.2F(\'2f\')}}q($.1m.1l){q(4.K.1l){n.1l(z(e,a){q(a>0){e.1u();2N=(y 4.K.1l==\'J\')?4.K.1l:\'\';$r.D(\'K\',2N)}})}q(4.L.1l){n.1l(z(e,a){q(a<0){e.1u();2N=(y 4.L.1l==\'J\')?4.L.1l:\'\';$r.D(\'L\',2N)}})}}q(4.L.V){4.L.V.22(z(e){e.1u();$r.D(\'L\')});q(4.L.1U&&4.E.Z){4.L.V.2M(z(){$r.D(\'1p\')},z(){$r.D(\'Z\')})}}q(4.U.1f){$r.D(\'1K\',H);q(4.U.1U&&4.E.Z){4.U.1f.2M(z(){$r.D(\'1p\')},z(){$r.D(\'Z\')})}}q(4.L.1B||4.K.1B){$(3W).3X(z(e){A k=e.3Y;q(k==4.L.1B){e.1u();$r.D(\'L\')}q(k==4.K.1B){e.1u();$r.D(\'K\')}})}q(4.U.2q){$(3W).3X(z(e){A k=e.3Y;q(k>=49&&k<4C){k=(k-49)*4.u.C;q(k<=G){e.1u();$r.D(\'20\',[k,0,H,4.U])}}})}q(4.E.Z){$r.D(\'Z\',4.E.3a);q($.1m.2a&&4.E.2a){$r.2a(\'1p\',\'Z\')}}};l.23=z(a,b){16(\'2O "23" 2P 2Q 1q 2R, 2S 2T "23" 2U 2V.\');A c=P;A d=z(a){c=a};q(!a)a=d;q(!b)b=d;$r.D(\'23\',[a,b]);B c};l.3Z=z(){16(\'2O "3Z" 2P 2Q 1q 2R, 2S 2T "2L" 2U 2V.\');A b=P;$r.D(\'2L\',z(a){b=a});B b};l.1L=z(){16(\'2O "1L" 2P 2Q 1q 2R, 2S 2T "1L" 2U 2V.\');$r.D(\'1L\');B l};l.41=z(a,b){16(\'2O "41" 2P 2Q 1q 2R, 2S 2T "21" 2U 2V.\');$r.D(\'21\',[a,b]);B l};q($r.1R().1q(\'.42\')){A n=$r.1R();$r.D(\'1L\')}A n=$r.4D(\'<4E 4F="42" />\').1R(),4={},26=o,G=M($r).W,O=0,2s=1S,2t=1S,2u=1S,1T=0,2d=P,1v=\'L\';l.30(26,H);l.3w();l.3B();l.3V();$r.D(\'21\');2k($r,4,P);q(4.u.1C!==0&&4.u.1C!==P){A s=4.u.1C;q(s===H){s=2W.4G.3S;q(!s.W)s=0}q(s===\'43\'){s=1x.3s(1x.43()*G)}$r.D(\'20\',[s,0,H,{13:0}])}B S};$.1m.1n.31={2E:H,1z:H,1v:\'1w\',u:{1C:0},T:{Y:\'4H\',1U:P,1l:P}};$.1m.1n.3v=z(a,b){B\'<a 4I="#"><44>\'+a+\'</44></a>\'};z 2r(o,t){q(o.u.2p>=t){16(\'1V 3J u: 2x 2y\');A f=\'4J\'}F{A f=\'4K\'}q(o.K.V)o.K.V[f]();q(o.L.V)o.L.V[f]();q(o.U.1f)o.U.1f[f]()}z 3k(k){q(k==\'3n\')B 39;q(k==\'1w\')B 37;q(k==\'3m\')B 38;q(k==\'4L\')B 40;B-1}z 2m(a){q(y a==\'1a\')a={};B a}z 29(a,b,c){q(y b!=\'14\')b=P;q(y c!=\'14\')c=P;a=2m(a);q(y a==\'1c\'){A d=3k(a);q(d==-1)a=$(a);F a=d}q(b){q(y a==\'14\')a={2q:a};q(y a.2j!=\'1a\')a={1f:a};q(y a.1f==\'1c\')a.1f=$(a.1f)}F q(c){q(y a==\'14\')a={Z:a};q(y a==\'J\')a={1E:a};q(y a.45!=\'1d\')a.45={}}F{q(y a.2j!=\'1a\')a={V:a};q(y a==\'J\')a={1B:a};q(y a.V==\'1c\')a.V=$(a.V);q(y a.1B==\'1c\')a.1B=3k(a.1B)}B a}z 2i(a,b,c,d,e,f){q(y a==\'1c\'){q(1G(a))a=$(a);F a=1y(a)}q(y a==\'1d\'){q(y a.2j==\'1a\')a=$(a);a=M(f).3T(a);q(a==-1)a=0;q(y c!=\'14\')c=P}F{q(y c!=\'14\')c=H}q(1G(a))a=0;F a=1y(a);q(1G(b))b=0;F b=1y(b);q(c){a+=d}a+=b;q(e>0){46(a>=e){a-=e}46(a<0){a+=e}}B a}z M(c,f){q(y f!=\'1c\')f=\'\';B $(\'> *\'+f,c)}z 3t(c,o){B M(c,\':1h(\'+o.u.C+\')\')}z 3M(c,o,n){B M(c,\':1h(\'+(o.u.1D+n)+\'):2g(\'+(n-1)+\')\')}z 3g(c,o){B M(c,\':1h(\'+o.u.C+\')\')}z 3O(c,o){B M(c,\':1h(\'+o.u.1D+\')\')}z 3i(c,o,n){B M(c,\':1h(\'+(o.u.C+n)+\'):2g(\'+(n-1)+\')\')}z 1e(i,o,m){A x=(y m==\'14\')?m:P;q(y m!=\'J\')m=0;i.1o(z(){A t=1y($(S).N(o.w[8]));q(1G(t))t=0;$(S).17(\'47\',t);$(S).N(o.w[8],((x)?$(S).17(\'47\'):m+$(S).17(\'1g\')))})}z 2H(i,o,a){48=1X(i,o,0,a);4a=2l(i,o,3,a);B[48,4a]}z 2l(i,o,a,b){q(y b!=\'14\')b=P;q(y o[o.w[a]]==\'J\'&&b)B o[o.w[a]];q(y o.u[o.w[a]]==\'J\')B o.u[o.w[a]];B 32(i,o,a+2)}z 32(i,o,a){A s=0;i.1o(z(){A m=$(S)[o.w[a]](H);q(s<m)s=m});B s}z 34(b,o,c){A d=b[o.w[c]](),3l=(o.w[c].4M().4N(\'1N\')>-1)?[\'4O\',\'4P\']:[\'4Q\',\'4R\'];1M(a=0;a<3l.W;a++){A m=1y(b.N(3l[a]));q(1G(m))m=0;d-=m}B d}z 1X(i,o,a,b){q(y b!=\'14\')b=P;q(y o[o.w[a]]==\'J\'&&b)B o[o.w[a]];q(y o.u[o.w[a]]==\'J\')B o.u[o.w[a]]*i.W;B 4b(i,o,a+2)}z 4b(i,o,a){A s=0;i.1o(z(){s+=$(S)[o.w[a]](H)});B s}z 33(i,o,a){A s=P,v=P;i.1o(z(){c=$(S)[o.w[a]]();q(s===P)s=c;F q(s!=c)v=H});B v}z 2G(a,o,p){q(y p!=\'14\')p=H;A b=(o.R&&p)?o.I:[0,0,0,0];A c={};c[o.w[0]]=a[0]+b[1]+b[3];c[o.w[3]]=a[1]+b[0]+b[2];B c}z 2k(a,o,p){A b=a.1R(),$i=M(a),$l=$i.1i(\':1r(\'+(o.u.C-1)+\')\');b.N(2G(2H($i.1i(\':1h(\'+o.u.C+\')\'),o,H),o,p));q(o.R){$l.N(o.w[8],$l.17(\'1g\')+o.I[o.w[10]]);a.N(o.w[7],o.I[o.w[9]]);a.N(o.w[6],o.I[o.w[12]])}a.N(o.w[0],1X($i,o,0)*2);a.N(o.w[3],2l($i,o,3))}z 3u(p){q(y p==\'1a\')B[0,0,0,0];q(y p==\'J\')B[p,p,p,p];F q(y p==\'1c\')p=p.4c(\'4S\').4T(\'\').4c(\' \');q(y p!=\'1d\'){B[0,0,0,0]}1M(i 4U p){p[i]=1y(p[i])}4V(p.W){2X 0:B[0,0,0,0];2X 1:B[p[0],p[0],p[0],p[0]];2X 2:B[p[0],p[1],p[0],p[1]];2X 3:B[p[0],p[1],p[2],p[1]];4W:B[p[0],p[1],p[2],p[3]]}}z 2o(a,o){A b=(y o[o.w[3]]==\'J\')?o[o.w[3]]:2l(a,o,3);B[(o[o.w[0]]-1X(a,o,0))/2,(b-2l(a,o,3))/2]}z 3K(b,o,c){A d=M(b),24=0,1C=o.u.C-c-1,x=0;q(1C<0)1C=d.W-1;1M(A a=1C;a>=0;a--){24+=d.1i(\':1r(\'+a+\')\')[o.w[2]](H);q(24>o.35)B x;q(a==0)a=d.W;x++}}z 28(b,o,c){A d=M(b),24=0,x=0;1M(A a=c;a<=d.W-1;a++){24+=d.1i(\':1r(\'+a+\')\')[o.w[2]](H);q(24>o.35)B x;q(a==d.W-1)a=-1;x++}}z 16(m){q(y m==\'1c\')m=\'1n: \'+m;q(2W.2Y&&2W.2Y.16)2W.2Y.16(m);F 4X{2Y.16(m)}4Y(4Z){}B P}$.1m.3R=z(o){B S.1n(o)}})(51);',62,312,'||||opts||||||||||||||||||||||if|cfs|||items||dimensions||typeof|function|var|return|visible|trigger|auto|else|totalItems|true|padding|number|prev|next|getItems|css|firstItem|false|a_dur|usePadding|this|scroll|pagination|button|length|variable|easing|play||||duration|boolean|bind|log|data|unbind|tt0|undefined|call|string|object|resetMargin|container|cfs_origCssMargin|lt|filter|c_new|l_old|mousewheel|fn|carouFredSel|each|pause|is|eq|l_new|animate|preventDefault|direction|left|Math|parseInt|circular|w_siz|key|start|oldVisible|pauseDuration|position|isNaN|perc|l_cur|stop|updatePageStatus|destroy|for|width|extend|marginRight|marginBottom|parent|null|pauseTimePassed|pauseOnHover|Not|last|getTotalSize|a_cur|a_old|slideTo|linkAnchors|click|configuration|total|height|opts_orig|variableVisible|getVisibleItemsNext|getNaviObject|nap|marginTop|marginLeft|pausedGlobal|oI|disabled|gt|remove|getItemIndex|jquery|setSizes|getLargestSize|getObject|top|getAutoPadding|minimum|keys|showNavi|autoTimeout|autoInterval|timerInterval|100|ceil|not|scrolling|slidePrev|slideNext|valid|conditions|onEnd|infinite|addClass|mapWrapperSizes|getSizes|onBefore|onAfter|end|currentPosition|hover|num|The|public|method|deprecated|use|the|custom|event|window|case|console|selected|init|defaults|getTrueLargestSize|hasVariableSizes|getTrueInnerSize|maxDimention|anchorBuilder||||delay|float|unbind_events|animated|removeClass|appendTo|getNewItemsPrev|a_new|getNewItemsNext|append|getKeyCode|arr|up|right|innerWidth|outerWidth|innerHeight|outerHeight|floor|getCurrentItems|getPadding|pageAnchorBuilder|build|absolute|relative|hidden|cfs_origCss|bind_events|clearInterval|onPausePause|dur2|setTimeout|onPauseEnd|onPauseStart|stopImmediatePropagation|enough|getVisibleItemsPrev|clone|getOldItemsPrev|complete|getOldItemsNext|insertItem|removeItem|caroufredsel|hash|index|eval|bind_buttons|document|keyup|keyCode|current_position||link_anchors|caroufredsel_wrapper|random|span|timer|while|cfs_tempCssMargin|s1||s2|getTotalSizeVariable|split|No|element|500|2500|fixed|Carousels|CSS|attribute|should|be|static|or|overflow|none|clearTimeout|resume|setInterval|prependTo|before|body|find|replaceWith|round|nth|child|58|wrap|div|class|location|swing|href|hide|show|down|toLowerCase|indexOf|paddingLeft|paddingRight|paddingTop|paddingBottom|px|join|in|switch|default|try|catch|err||jQuery'.split('|'),0,{}))

