/*-----------------------------------------------------------------------------------

 	Custom JS - All front-end jQuery
 
-----------------------------------------------------------------------------------*/
 
jQuery(document).ready(function() {
	
	jQuery('body').addClass('jsenabled');
	
	var slideDuration = 600;
	
	$('a.nospam').each(function(i) { 
			var cadena = $(this).html();
			cadena = cadena.replace(' EN ', '@');
			email = cadena.replace(' PUNTO ', '.');
			$(this).html(email);
			$(this).attr('href', 'mailto:' + email);
		});
	
	$('#header').addClass('bgblue');
	
/*-----------------------------------------------------------------------------------*/
/*	Superfish Settings - http://users.tpg.com.au/j_birch/plugins/superfish/
/*-----------------------------------------------------------------------------------*/
	
	if(false && jQuery().superfish) {
		
		// Main Navigation
		jQuery('#primary-nav ul.sf-menu').superfish({ 
			delay: 200,
			animation: {opacity:'show', height:'show'},
			speed: 'fast',
			dropShadows: false
		});
		
		jQuery('#primary-nav li li a').hover(
			function () {
				jQuery(this).find('span').not('span.sf-sub-indicator').stop().animate({paddingLeft: 20}, 200, 'jswing');
			},
			function () {
				jQuery(this).find('span').not('span.sf-sub-indicator').stop().animate({paddingLeft: 0}, 200, 'jswing');
			}
		);
	
	}
	
/*-----------------------------------------------------------------------------------*/
/*	Toggle Content
/*-----------------------------------------------------------------------------------*/
	
	jQuery('.toggle h4').each( 
		function () {
			
			var iHeight = jQuery(this).closest('.toggle').find('.inner').height();
			var ipaddingTop = jQuery(this).closest('.toggle').find('.inner').css('padding-top');
			var ipaddingBottom = jQuery(this).closest('.toggle').find('.inner').css('padding-bottom');
			
			jQuery(this).toggle( 
				function () {
					
					imageURL = jQuery(this).find('span').attr('class');
					
					jQuery(this)
					.closest('.toggle')
					.find('.inner')
					.animate({height: 0, paddingTop: 0, paddingBottom: 0, opacity: 0 }, 200, 'jswing');
					jQuery(this)
					.find('span')
					.css('background', 'url('+ imageURL +'/images/plus_minus_sprite.gif) 25px 12px');
				},
				function () {
					
					jQuery(this)
					.closest('.toggle')
					.find('.inner')
					.animate({height: iHeight, paddingTop: ipaddingTop, paddingBottom: ipaddingBottom, opacity: 1}, 200, 'jswing');
					
					jQuery(this)
					.find('span')
					.css('background', 'url('+ imageURL +'/images/plus_minus_sprite.gif) 12px 12px');
				}
			);
		}
	);
	
	
/*-----------------------------------------------------------------------------------*/
/* Tabs
/*-----------------------------------------------------------------------------------*/
	
	if(jQuery().tabs) {
		jQuery('.tour .nav a').each( function (i) {
			var href = $(this).attr('href') +  '?ajax=1';
			$(this).attr('href', href);
		});
			
		jQuery(".tabs, .tour").tabs({ 
			cache: true,
			spinner: '<em>...</em>',
			fx: { opacity: 'toggle', duration: 200} 
		});
		
		jQuery('.tour .nav a').click( function (e) {
			e.preventDefault();
		});
		
	}

/*-----------------------------------------------------------------------------------*/
/* Post Thumbnail Hover Effect
/*-----------------------------------------------------------------------------------*/
	
	function tz_overlay() {
		
		jQuery('.post-thumb a img, .tab-thumb img, .tz_flickr_widget img').hover( function() {
			jQuery(this).stop().animate({opacity : 0.8}, 200);
		}, function() {
			jQuery(this).stop().animate({opacity : 1}, 200);
		});
		
		jQuery('.plus').hover( function() {
			jQuery(this).parent('.post-thumb').find('img').stop().animate({opacity : 0.8}, 200);
		}, function() {
			jQuery(this).parent('.post-thumb').find('img').stop().animate({opacity : 1}, 200);
		});
	}
	
	tz_overlay();


/*-----------------------------------------------------------------------------------*/
/*	PrettyPhoto - http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/
/*-----------------------------------------------------------------------------------*/
	
	function tz_lightbox() {
		
		jQuery("a[rel^='prettyPhoto']").prettyPhoto({
			animationSpeed:'fast',
			slideshow:5000,
			theme:'facebook',
			show_title:false,
			overlay_gallery: false
		});
	
	}
	
	if(jQuery().prettyPhoto) {
		tz_lightbox(); 
	}

/*-----------------------------------------------------------------------------------*/
/* Portfolio li Effect
/*-----------------------------------------------------------------------------------*/

	jQuery('#taxs a').each( 
		function () {
			
			// This is for Macs, due to the text being wider than PC.
			var theWidth = jQuery(this).width() + 2;

			jQuery(this).hover(
				function () {
					jQuery(this).not('.active').stop().animate({width: '91%'}, 200, 'jswing');
				},
				function () {
					jQuery(this).not('.active').stop().animate({width: theWidth}, 200, 'jswing');
				}
			);

			jQuery(this).click(
				function(e) {
					jQuery('#taxs a').removeClass('active').width("");
					jQuery(this).addClass('active').width('91%');
					e.preventDefault();
				}
			);

		}
	);
	
	// This is rather important for the active states, do not touch this unless you know what you're doing.
	jQuery('#taxs a.active').css({width: '91%'});

/*-----------------------------------------------------------------------------------*/
/*	Portfolio Sorting
/*-----------------------------------------------------------------------------------*/
	
	if (jQuery().quicksand) {
	
		(function($) {
			
			$.fn.sorted = function(customOptions) {
				var options = {
					reversed: false,
					by: function(a) {
						return a.text();
					}
				};
		
				$.extend(options, customOptions);
		
				$data = jQuery(this);
				arr = $data.get();
				arr.sort(function(a, b) {
		
					var valA = options.by($(a));
					var valB = options.by($(b));
			
					if (options.reversed) {
						return (valA < valB) ? 1 : (valA > valB) ? -1 : 0;				
					} else {		
						return (valA < valB) ? -1 : (valA > valB) ? 1 : 0;	
					}
			
				});
		
				return $(arr);
		
			};
		
		})(jQuery);
		
		jQuery(function() {
		
			var read_button = function(class_names) {
				
				var r = {
					selected: false,
					type: 0
				};
				
				for (var i=0; i < class_names.length; i++) {
					
					if (class_names[i].indexOf('selected-') == 0) {
						r.selected = true;
					}
				
					if (class_names[i].indexOf('segment-') == 0) {
						r.segment = class_names[i].split('-')[1];
					}
				};
				
				return r;
				
			};
		
			var determine_sort = function($buttons) {
				var $selected = $buttons.parent().filter('[class*="selected-"]');
				return $selected.find('a').attr('data-value');
			};
		
			var determine_kind = function($buttons) {
				var $selected = $buttons.parent().filter('[class*="selected-"]');
				return $selected.find('a').attr('data-value');
			};
		
			var $preferences = {
				duration: slideDuration,
				easing: 'easeInOutQuad',
				adjustHeight: 'dynamic'
			};
		
			var $list = jQuery('#columns-wrap');
			var $data = $list.clone();
		
			var $controls = jQuery('#portfolio-filter');
		
			$controls.each(function(i) {
		
				var $control = jQuery(this);
				var $buttons = $control.find('a');
		
				$buttons.bind('click', function(e) {
		
					var $button = jQuery(this);
					var $button_container = $button.parent();
					var button_properties = read_button($button_container.attr('class').split(' '));      
					var selected = button_properties.selected;
					var button_segment = button_properties.segment;
		
					if (!selected) {
		
						$buttons.parent().removeClass();
						$button_container.addClass('selected-' + button_segment);
		
						var sorting_type = determine_sort($controls.eq(1).find('a'));
						var sorting_kind = determine_kind($controls.eq(0).find('a'));
		
						if (sorting_kind == 'all') {
							var $filtered_data = $data.find('li');
						} else {
							var $filtered_data = $data.find('li.' + sorting_kind);
						}

						var $sorted_data = $filtered_data.sorted({
							by: function(v) {
								return $(v).find('strong').text().toLowerCase();
							}
						});
			
						$list.quicksand($sorted_data, $preferences, function () {
								tz_overlay();
								tz_lightbox();
						});
			
					}
			
					e.preventDefault();
				});
			
			}); 
		
		});
	
	}

}); // end document ready



/*
js/jquery.easing.1.3.js
js/jquery-ui-1.8.10.custom.min.js
js/jquery.tabbed-widget.js
js/slides.min.jquery.js
js/jquery.prettyPhoto.js
js/jquery.quicksand.js
*/

jQuery.easing.jswing=jQuery.easing.swing;
jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(a,c,j,f,b){return jQuery.easing[jQuery.easing.def](a,c,j,f,b)},easeInQuad:function(a,c,j,f,b){return f*(c/=b)*c+j},easeOutQuad:function(a,c,j,f,b){return-f*(c/=b)*(c-2)+j},easeInOutQuad:function(a,c,j,f,b){if((c/=b/2)<1)return f/2*c*c+j;return-f/2*(--c*(c-2)-1)+j},easeInCubic:function(a,c,j,f,b){return f*(c/=b)*c*c+j},easeOutCubic:function(a,c,j,f,b){return f*((c=c/b-1)*c*c+1)+j},easeInOutCubic:function(a,c,j,f,b){if((c/=b/2)<1)return f/
2*c*c*c+j;return f/2*((c-=2)*c*c+2)+j},easeInQuart:function(a,c,j,f,b){return f*(c/=b)*c*c*c+j},easeOutQuart:function(a,c,j,f,b){return-f*((c=c/b-1)*c*c*c-1)+j},easeInOutQuart:function(a,c,j,f,b){if((c/=b/2)<1)return f/2*c*c*c*c+j;return-f/2*((c-=2)*c*c*c-2)+j},easeInQuint:function(a,c,j,f,b){return f*(c/=b)*c*c*c*c+j},easeOutQuint:function(a,c,j,f,b){return f*((c=c/b-1)*c*c*c*c+1)+j},easeInOutQuint:function(a,c,j,f,b){if((c/=b/2)<1)return f/2*c*c*c*c*c+j;return f/2*((c-=2)*c*c*c*c+2)+j},easeInSine:function(a,
c,j,f,b){return-f*Math.cos(c/b*(Math.PI/2))+f+j},easeOutSine:function(a,c,j,f,b){return f*Math.sin(c/b*(Math.PI/2))+j},easeInOutSine:function(a,c,j,f,b){return-f/2*(Math.cos(Math.PI*c/b)-1)+j},easeInExpo:function(a,c,j,f,b){return c==0?j:f*Math.pow(2,10*(c/b-1))+j},easeOutExpo:function(a,c,j,f,b){return c==b?j+f:f*(-Math.pow(2,-10*c/b)+1)+j},easeInOutExpo:function(a,c,j,f,b){if(c==0)return j;if(c==b)return j+f;if((c/=b/2)<1)return f/2*Math.pow(2,10*(c-1))+j;return f/2*(-Math.pow(2,-10*--c)+2)+j},
easeInCirc:function(a,c,j,f,b){return-f*(Math.sqrt(1-(c/=b)*c)-1)+j},easeOutCirc:function(a,c,j,f,b){return f*Math.sqrt(1-(c=c/b-1)*c)+j},easeInOutCirc:function(a,c,j,f,b){if((c/=b/2)<1)return-f/2*(Math.sqrt(1-c*c)-1)+j;return f/2*(Math.sqrt(1-(c-=2)*c)+1)+j},easeInElastic:function(a,c,j,f,b){a=1.70158;var e=0,g=f;if(c==0)return j;if((c/=b)==1)return j+f;e||(e=b*0.3);if(g<Math.abs(f)){g=f;a=e/4}else a=e/(2*Math.PI)*Math.asin(f/g);return-(g*Math.pow(2,10*(c-=1))*Math.sin((c*b-a)*2*Math.PI/e))+j},easeOutElastic:function(a,
c,j,f,b){a=1.70158;var e=0,g=f;if(c==0)return j;if((c/=b)==1)return j+f;e||(e=b*0.3);if(g<Math.abs(f)){g=f;a=e/4}else a=e/(2*Math.PI)*Math.asin(f/g);return g*Math.pow(2,-10*c)*Math.sin((c*b-a)*2*Math.PI/e)+f+j},easeInOutElastic:function(a,c,j,f,b){a=1.70158;var e=0,g=f;if(c==0)return j;if((c/=b/2)==2)return j+f;e||(e=b*0.3*1.5);if(g<Math.abs(f)){g=f;a=e/4}else a=e/(2*Math.PI)*Math.asin(f/g);if(c<1)return-0.5*g*Math.pow(2,10*(c-=1))*Math.sin((c*b-a)*2*Math.PI/e)+j;return g*Math.pow(2,-10*(c-=1))*Math.sin((c*
b-a)*2*Math.PI/e)*0.5+f+j},easeInBack:function(a,c,j,f,b,e){if(e==undefined)e=1.70158;return f*(c/=b)*c*((e+1)*c-e)+j},easeOutBack:function(a,c,j,f,b,e){if(e==undefined)e=1.70158;return f*((c=c/b-1)*c*((e+1)*c+e)+1)+j},easeInOutBack:function(a,c,j,f,b,e){if(e==undefined)e=1.70158;if((c/=b/2)<1)return f/2*c*c*(((e*=1.525)+1)*c-e)+j;return f/2*((c-=2)*c*(((e*=1.525)+1)*c+e)+2)+j},easeInBounce:function(a,c,j,f,b){return f-jQuery.easing.easeOutBounce(a,b-c,0,f,b)+j},easeOutBounce:function(a,c,j,f,b){return(c/=
b)<1/2.75?f*7.5625*c*c+j:c<2/2.75?f*(7.5625*(c-=1.5/2.75)*c+0.75)+j:c<2.5/2.75?f*(7.5625*(c-=2.25/2.75)*c+0.9375)+j:f*(7.5625*(c-=2.625/2.75)*c+0.984375)+j},easeInOutBounce:function(a,c,j,f,b){if(c<b/2)return jQuery.easing.easeInBounce(a,c*2,0,f,b)*0.5+j;return jQuery.easing.easeOutBounce(a,c*2-b,0,f,b)*0.5+f*0.5+j}});(function(a,c){function j(f){return!a(f).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(!a.ui.version){a.extend(a.ui,{version:"1.8.10",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,
PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({_focus:a.fn.focus,focus:function(f,b){return typeof f==="number"?this.each(function(){var e=this;setTimeout(function(){a(e).focus();b&&b.call(e)},f)}):this._focus.apply(this,arguments)},scrollParent:function(){var f;f=a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,
"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!f.length?a(document):f},zIndex:function(f){if(f!==c)return this.css("zIndex",f);if(this.length){f=a(this[0]);for(var b;f.length&&f[0]!==document;){b=f.css("position");
if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(f.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(f){f.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(f,b){function e(k,l,x,o){a.each(g,function(){l-=parseFloat(a.curCSS(k,"padding"+this,true))||0;if(x)l-=parseFloat(a.curCSS(k,
"border"+this+"Width",true))||0;if(o)l-=parseFloat(a.curCSS(k,"margin"+this,true))||0});return l}var g=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),m={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+b]=function(k){if(k===c)return m["inner"+b].call(this);return this.each(function(){a(this).css(h,e(this,k)+"px")})};a.fn["outer"+b]=function(k,l){if(typeof k!=="number")return m["outer"+b].call(this,k);return this.each(function(){a(this).css(h,
e(this,k,true,l)+"px")})}});a.extend(a.expr[":"],{data:function(f,b,e){return!!a.data(f,e[3])},focusable:function(f){var b=f.nodeName.toLowerCase(),e=a.attr(f,"tabindex");if("area"===b){b=f.parentNode;e=b.name;if(!f.href||!e||b.nodeName.toLowerCase()!=="map")return false;f=a("img[usemap=#"+e+"]")[0];return!!f&&j(f)}return(/input|select|textarea|button|object/.test(b)?!f.disabled:"a"==b?f.href||!isNaN(e):!isNaN(e))&&j(f)},tabbable:function(f){var b=a.attr(f,"tabindex");return(isNaN(b)||b>=0)&&a(f).is(":focusable")}});
a(function(){var f=document.body,b=f.appendChild(b=document.createElement("div"));a.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=b.offsetHeight===100;a.support.selectstart="onselectstart"in b;f.removeChild(b).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,b,e){f=a.ui[f].prototype;for(var g in e){f.plugins[g]=f.plugins[g]||[];f.plugins[g].push([b,e[g]])}},call:function(f,b,e){if((b=f.plugins[b])&&f.element[0].parentNode)for(var g=0;g<b.length;g++)f.options[b[g][0]]&&
b[g][1].apply(f.element,e)}},contains:function(f,b){return document.compareDocumentPosition?f.compareDocumentPosition(b)&16:f!==b&&f.contains(b)},hasScroll:function(f,b){if(a(f).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var e=false;if(f[b]>0)return true;f[b]=1;e=f[b]>0;f[b]=0;return e},isOverAxis:function(f,b,e){return f>b&&f<b+e},isOver:function(f,b,e,g,h,m){return a.ui.isOverAxis(f,e,h)&&a.ui.isOverAxis(b,g,m)}})}})(jQuery);
(function(a,c){if(a.cleanData){var j=a.cleanData;a.cleanData=function(b){for(var e=0,g;(g=b[e])!=null;e++)a(g).triggerHandler("remove");j(b)}}else{var f=a.fn.remove;a.fn.remove=function(b,e){return this.each(function(){if(!e)if(!b||a.filter(b,[this]).length)a("*",this).add([this]).each(function(){a(this).triggerHandler("remove")});return f.call(a(this),b,e)})}}a.widget=function(b,e,g){var h=b.split(".")[0],m;b=b.split(".")[1];m=h+"-"+b;if(!g){g=e;e=a.Widget}a.expr[":"][m]=function(k){return!!a.data(k,
b)};a[h]=a[h]||{};a[h][b]=function(k,l){arguments.length&&this._createWidget(k,l)};e=new e;e.options=a.extend(true,{},e.options);a[h][b].prototype=a.extend(true,e,{namespace:h,widgetName:b,widgetEventPrefix:a[h][b].prototype.widgetEventPrefix||b,widgetBaseClass:m},g);a.widget.bridge(b,a[h][b])};a.widget.bridge=function(b,e){a.fn[b]=function(g){var h=typeof g==="string",m=Array.prototype.slice.call(arguments,1),k=this;g=!h&&m.length?a.extend.apply(null,[true,g].concat(m)):g;if(h&&g.charAt(0)==="_")return k;
h?this.each(function(){var l=a.data(this,b),x=l&&a.isFunction(l[g])?l[g].apply(l,m):l;if(x!==l&&x!==c){k=x;return false}}):this.each(function(){var l=a.data(this,b);l?l.option(g||{})._init():a.data(this,b,new e(g,this))});return k}};a.Widget=function(b,e){arguments.length&&this._createWidget(b,e)};a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(b,e){a.data(e,this.widgetName,this);this.element=a(e);this.options=a.extend(true,{},this.options,
this._getCreateOptions(),b);var g=this;this.element.bind("remove."+this.widgetName,function(){g.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
widget:function(){return this.element},option:function(b,e){var g=b;if(arguments.length===0)return a.extend({},this.options);if(typeof b==="string"){if(e===c)return this.options[b];g={};g[b]=e}this._setOptions(g);return this},_setOptions:function(b){var e=this;a.each(b,function(g,h){e._setOption(g,h)});return this},_setOption:function(b,e){this.options[b]=e;if(b==="disabled")this.widget()[e?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",e);return this},
enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(b,e,g){var h=this.options[b];e=a.Event(e);e.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();g=g||{};if(e.originalEvent){b=a.event.props.length;for(var m;b;){m=a.event.props[--b];e[m]=e.originalEvent[m]}}this.element.trigger(e,g);return!(a.isFunction(h)&&h.call(this.element[0],e,g)===false||e.isDefaultPrevented())}}})(jQuery);
(function(a,c){var j=0,f=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&&e==this.options.selected||
this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+ ++j},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++f);return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=
a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(p,q){p.css("display","");!a.support.opacity&&q.opacity&&p[0].style.removeAttribute("filter")}var g=this,h=this.options,m=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=a(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);this.anchors.each(function(p,q){var w=a(q).attr("href"),u=w.split("#")[0],v;if(u&&(u===location.toString().split("#")[0]||
(v=a("base")[0])&&u===v.href)){w=q.hash;q.href=w}if(m.test(w))g.panels=g.panels.add(g.element.find(g._sanitizeSelector(w)));else if(w&&w!=="#"){a.data(q,"href.tabs",w);a.data(q,"load.tabs",w.replace(/#.*$/,""));w=g._tabId(q);q.href="#"+w;q=g.element.find("#"+w);if(!q.length){q=a(h.panelTemplate).attr("id",w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(g.panels[p-1]||g.list);q.data("destroy.tabs",true)}g.panels=g.panels.add(q)}else h.disabled.push(p)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");
this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(h.selected===c){location.hash&&this.anchors.each(function(p,q){if(q.hash==location.hash){h.selected=p;return false}});if(typeof h.selected!=="number"&&h.cookie)h.selected=parseInt(g._cookie(),10);if(typeof h.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)h.selected=
this.lis.index(this.lis.filter(".ui-tabs-selected"));h.selected=h.selected||(this.lis.length?0:-1)}else if(h.selected===null)h.selected=-1;h.selected=h.selected>=0&&this.anchors[h.selected]||h.selected<0?h.selected:0;h.disabled=a.unique(h.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(p){return g.lis.index(p)}))).sort();a.inArray(h.selected,h.disabled)!=-1&&h.disabled.splice(a.inArray(h.selected,h.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");
if(h.selected>=0&&this.anchors.length){g.element.find(g._sanitizeSelector(g.anchors[h.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(h.selected).addClass("ui-tabs-selected ui-state-active");g.element.queue("tabs",function(){g._trigger("show",null,g._ui(g.anchors[h.selected],g.element.find(g._sanitizeSelector(g.anchors[h.selected].hash))[0]))});this.load(h.selected)}a(window).bind("unload",function(){g.lis.add(g.anchors).unbind(".tabs");g.lis=g.anchors=g.panels=null})}else h.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));
this.element[h.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");h.cookie&&this._cookie(h.selected,h.cookie);b=0;for(var k;k=this.lis[b];b++)a(k)[a.inArray(b,h.disabled)!=-1&&!a(k).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");h.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(h.event!=="mouseover"){var l=function(p,q){q.is(":not(.ui-state-disabled)")&&q.addClass("ui-state-"+p)};this.lis.bind("mouseover.tabs",
function(){l("hover",a(this))});this.lis.bind("mouseout.tabs",function(){a(this).removeClass("ui-state-hover")});this.anchors.bind("focus.tabs",function(){l("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){a(this).closest("li").removeClass("ui-state-focus")})}var x,o;if(h.fx)if(a.isArray(h.fx)){x=h.fx[0];o=h.fx[1]}else x=o=h.fx;var r=o?function(p,q){a(p).closest("li").addClass("ui-tabs-selected ui-state-active");q.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal",
function(){e(q,o);g._trigger("show",null,g._ui(p,q[0]))})}:function(p,q){a(p).closest("li").addClass("ui-tabs-selected ui-state-active");q.removeClass("ui-tabs-hide");g._trigger("show",null,g._ui(p,q[0]))},z=x?function(p,q){q.animate(x,x.duration||"normal",function(){g.lis.removeClass("ui-tabs-selected ui-state-active");q.addClass("ui-tabs-hide");e(q,x);g.element.dequeue("tabs")})}:function(p,q){g.lis.removeClass("ui-tabs-selected ui-state-active");q.addClass("ui-tabs-hide");g.element.dequeue("tabs")};
this.anchors.bind(h.event+".tabs",function(){var p=this,q=a(p).closest("li"),w=g.panels.filter(":not(.ui-tabs-hide)"),u=g.element.find(g._sanitizeSelector(p.hash));if(q.hasClass("ui-tabs-selected")&&!h.collapsible||q.hasClass("ui-state-disabled")||q.hasClass("ui-state-processing")||g.panels.filter(":animated").length||g._trigger("select",null,g._ui(this,u[0]))===false){this.blur();return false}h.selected=g.anchors.index(this);g.abort();if(h.collapsible)if(q.hasClass("ui-tabs-selected")){h.selected=
-1;h.cookie&&g._cookie(h.selected,h.cookie);g.element.queue("tabs",function(){z(p,w)}).dequeue("tabs");this.blur();return false}else if(!w.length){h.cookie&&g._cookie(h.selected,h.cookie);g.element.queue("tabs",function(){r(p,u)});g.load(g.anchors.index(this));this.blur();return false}h.cookie&&g._cookie(h.selected,h.cookie);if(u.length){w.length&&g.element.queue("tabs",function(){z(p,w)});g.element.queue("tabs",function(){r(p,u)});g.load(g.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";
a.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e=
a.data(this,"href.tabs");if(e)this.href=e;var g=a(this).unbind(".tabs");a.each(["href","load","cache"],function(h,m){g.removeData(m+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b,
e,g){if(g===c)g=this.anchors.length;var h=this,m=this.options;e=a(m.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(a("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var k=h.element.find("#"+b);k.length||(k=a(m.panelTemplate).attr("id",b).data("destroy.tabs",true));k.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(g>=this.lis.length){e.appendTo(this.list);k.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[g]);
k.insertBefore(this.panels[g])}m.disabled=a.map(m.disabled,function(l){return l>=g?++l:l});this._tabify();if(this.anchors.length==1){m.selected=0;e.addClass("ui-tabs-selected ui-state-active");k.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){h._trigger("show",null,h._ui(h.anchors[0],h.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[g],this.panels[g]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,g=this.lis.eq(b).remove(),h=this.panels.eq(b).remove();
if(g.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1<this.anchors.length?1:-1));e.disabled=a.map(a.grep(e.disabled,function(m){return m!=b}),function(m){return m>=b?--m:m});this._tabify();this._trigger("remove",null,this._ui(g.find("a")[0],h[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(a.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=a.grep(e.disabled,function(g){return g!=b});this._trigger("enable",null,
this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this},
load:function(b){b=this._getIndex(b);var e=this,g=this.options,h=this.anchors.eq(b)[0],m=a.data(h,"load.tabs");this.abort();if(!m||this.element.queue("tabs").length!==0&&a.data(h,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(g.spinner){var k=a("span",h);k.data("label.tabs",k.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:m,success:function(l,x){e.element.find(e._sanitizeSelector(h.hash)).html(l);e._cleanup();g.cache&&a.data(h,
"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{g.ajaxOptions.success(l,x)}catch(o){}},error:function(l,x){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{g.ajaxOptions.error(l,x,b,h)}catch(o){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},
url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.8.10"});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var g=this,h=this.options,m=g._rotate||(g._rotate=function(k){clearTimeout(g.rotation);g.rotation=setTimeout(function(){var l=h.selected;g.select(++l<g.anchors.length?l:0)},b);k&&k.stopPropagation()});e=g._unrotate||(g._unrotate=!e?function(k){k.clientX&&
g.rotate(null)}:function(){t=h.selected;m()});if(b){this.element.bind("tabsshow",m);this.anchors.bind(h.event+".tabs",e);m()}else{clearTimeout(g.rotation);this.element.unbind("tabsshow",m);this.anchors.unbind(h.event+".tabs",e);delete this._rotate;delete this._unrotate}return this}})})(jQuery);jQuery(document).ready(function(){jQuery("#tabs").tabs({fx:{opacity:"show"}})});(function(a){a.fn.slides=function(c){c=a.extend({},a.fn.slides.option,c);return this.each(function(){function j(){if(c.pause){clearTimeout(b.data("pause"));clearInterval(b.data("interval"));pauseTimeout=setTimeout(function(){clearTimeout(b.data("pause"));playInterval=setInterval(function(){f("next",l)},c.play);b.data("interval",playInterval)},c.pause);b.data("pause",pauseTimeout)}else clearInterval(b.data("interval"))}function f(y,n,s){if(!w&&q){w=true;switch(y){case "next":r=p;o=p+1;o=g===o?0:o;
v=h*2;y=-h*2;p=o;break;case "prev":r=p;o=p-1;o=o===-1?g-1:o;y=v=0;p=o;break;case "pagination":o=parseInt(s,10);r=a("."+c.paginationClass+" li.current a",b).attr("href").match("[^#/]+$");if(o>r){v=h*2;y=-h*2}else y=v=0;p=o}if(n==="fade"){c.animationStart();if(c.crossfade)e.children(":eq("+o+")",b).css({zIndex:10}).fadeIn(c.fadeSpeed,function(){if(c.autoHeight)e.animate({height:e.children(":eq("+o+")",b).outerHeight()},c.autoHeightSpeed,function(){e.children(":eq("+r+")",b).css({display:"none",zIndex:0});
e.children(":eq("+o+")",b).css({zIndex:0});c.animationComplete(o+1);w=false});else{e.children(":eq("+r+")",b).css({display:"none",zIndex:0});e.children(":eq("+o+")",b).css({zIndex:0});c.animationComplete(o+1);w=false}});else{c.animationStart();e.children(":eq("+r+")",b).fadeOut(c.fadeSpeed,function(){c.autoHeight?e.animate({height:e.children(":eq("+o+")",b).outerHeight()},c.autoHeightSpeed,function(){e.children(":eq("+o+")",b).fadeIn(c.fadeSpeed)}):e.children(":eq("+o+")",b).fadeIn(c.fadeSpeed,function(){a.browser.msie&&
a(this).get(0).style.removeAttribute("filter")});c.animationComplete(o+1);w=false})}}else{e.children(":eq("+o+")").css({left:v,display:"block"});if(c.autoHeight){c.animationStart();e.animate({left:y,height:e.children(":eq("+o+")").outerHeight()},c.slideSpeed,function(){e.css({left:-h});e.children(":eq("+o+")").css({left:h,zIndex:5});e.children(":eq("+r+")").css({left:h,display:"none",zIndex:0});c.animationComplete(o+1);w=false})}else{c.animationStart();e.animate({left:y},c.slideSpeed,function(){e.css({left:-h});
e.children(":eq("+o+")").css({left:h,zIndex:5});e.children(":eq("+r+")").css({left:h,display:"none",zIndex:0});c.animationComplete(o+1);w=false})}}if(c.pagination){a("."+c.paginationClass+" li.current",b).removeClass("current");a("."+c.paginationClass+" li:eq("+o+")",b).addClass("current")}}}a("."+c.container,a(this)).children().wrapAll('<div class="slides_control"/>');var b=a(this),e=a(".slides_control",b),g=e.children().size(),h=c.width,m=c.height,k=c.start-1,l=c.effect.indexOf(",")<0?c.effect:
c.effect.replace(" ","").split(",")[0],x=c.effect.indexOf(",")<0?l:c.effect.replace(" ","").split(",")[1],o=0,r=0,z=0,p=0,q,w,u,v,B;if(!(g<2)){if(k<0)k=0;if(k>g)k=g-1;if(c.start)p=k;c.randomize&&e.randomize();a("."+c.container,b).css({overflow:"hidden",width:h,position:"relative"});e.css({position:"relative",width:h*3,height:m,left:-h});e.children().css({width:h,position:"absolute",top:0,left:h,zIndex:0,display:"none"});c.autoHeight&&e.animate({height:e.children(":eq("+k+")").outerHeight()},c.autoHeightSpeed);
if(c.preload&&e.find("img").length){a("."+c.container,b).css({background:"url("+c.preloadImage+") no-repeat 50% 50%"});m=e.find("img:eq("+k+")").attr("src")+"?"+(new Date).getTime();B=a("img",b).parent().attr("class")!="slides_control"?e.children(":eq(0)")[0].tagName.toLowerCase():e.find("img:eq("+k+")");e.find("img:eq("+k+")").attr("src",m).load(function(){e.find(B+":eq("+k+")").fadeIn(c.fadeSpeed,function(){a(this).css({zIndex:5});b.css({background:""});q=true})})}else e.children(":eq("+k+")").fadeIn(c.fadeSpeed,
function(){q=true});if(c.bigTarget){e.children().css({cursor:"pointer"});e.children().click(function(){f("next",l);return false})}if(c.hoverPause&&c.play){e.children().bind("mouseover",function(){clearInterval(b.data("interval"))});e.children().bind("mouseleave",function(){j()})}if(c.generateNextPrev){a("."+c.container,b).after('<a href="#" class="'+c.prev+'">Prev</a>');a("."+c.prev,b).after('<a href="#" class="'+c.next+'">Next</a>')}a("."+c.next,b).click(function(y){y.preventDefault();c.play&&j();
f("next",l)});a("."+c.prev,b).click(function(y){y.preventDefault();c.play&&j();f("prev",l)});if(c.generatePagination){b.append("<ul class="+c.paginationClass+"></ul>");e.children().each(function(){a("."+c.paginationClass,b).append('<li><a href="#'+z+'">'+(z+1)+"</a></li>");z++})}else a("."+c.paginationClass+" li a",b).each(function(){a(this).attr("href","#"+z);z++});a("."+c.paginationClass+" li:eq("+k+")",b).addClass("current");a("."+c.paginationClass+" li a",b).click(function(){c.play&&j();u=a(this).attr("href").match("[^#/]+$");
p!=u&&f("pagination",x,u);return false});a("a.link",b).click(function(){c.play&&j();u=a(this).attr("href").match("[^#/]+$")-1;p!=u&&f("pagination",x,u);return false});if(c.play){playInterval=setInterval(function(){f("next",l)},c.play);b.data("interval",playInterval)}}})};a.fn.slides.option={width:570,height:270,preload:false,preloadImage:"/img/loading.gif",container:"slides_container",generateNextPrev:false,next:"next",prev:"prev",pagination:true,generatePagination:true,paginationClass:"pagination",
fadeSpeed:350,slideSpeed:350,start:1,effect:"slide",crossfade:false,randomize:false,play:0,pause:0,hoverPause:false,autoHeight:false,autoHeightSpeed:350,bigTarget:false,animationStart:function(){},animationComplete:function(){}};a.fn.randomize=function(c){function j(){return Math.round(Math.random())-0.5}return a(this).each(function(){var f=a(this),b=f.children(),e=b.length;if(e>1){b.hide();var g=[];for(i=0;i<e;i++)g[g.length]=i;g=g.sort(j);a.each(g,function(h,m){var k=b.eq(m),l=k.clone(true);l.show().appendTo(f);
c!==undefined&&c(k,l);k.remove()})}})}})(jQuery);(function(a){function c(j,f){j=j.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var b=RegExp("[\\?&]"+j+"=([^&#]*)").exec(f);return b==null?"":b[1]}a.prettyPhoto={version:"3.0"};a.fn.prettyPhoto=function(j){function f(n){$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(){a(".pp_loaderIcon").show();n()})}function b(n){if(set_position==n-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(){a.prettyPhoto.changePage("next");return false})}set_position==0?$pp_pic_holder.find("a.pp_previous").css("visibility","hidden").addClass("disabled").unbind("click"):$pp_pic_holder.find("a.pp_previous.disabled").css("visibility","visible").removeClass("disabled").bind("click",
function(){a.prettyPhoto.changePage("previous");return false});n>1?a(".pp_nav").show():a(".pp_nav").hide()}function e(n,s){resized=false;g(n,s);imageWidth=n;imageHeight=s;if((u>B||w>v)&&doresize&&settings.allow_resize&&!o){resized=true;for(fitting=false;!fitting;){if(u>B){imageWidth=B-200;imageHeight=s/n*imageWidth}else if(w>v){imageHeight=v-200;imageWidth=n/s*imageHeight}else fitting=true;w=imageHeight;u=imageWidth}g(imageWidth,imageHeight)}return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),
containerHeight:Math.floor(w),containerWidth:Math.floor(u)+40,contentHeight:Math.floor(p),contentWidth:Math.floor(q),resized:resized}}function g(n,s){n=parseFloat(n);s=parseFloat(s);$pp_details=$pp_pic_holder.find(".pp_details");$pp_details.width(n);detailsHeight=parseFloat($pp_details.css("marginTop"))+parseFloat($pp_details.css("marginBottom"));$pp_details=$pp_details.clone().appendTo(a("body")).css({position:"absolute",top:-1E4});detailsHeight+=$pp_details.height();detailsHeight=detailsHeight<=
34?36:detailsHeight;if(a.browser.msie&&a.browser.version==7)detailsHeight+=8;$pp_details.remove();p=s+40;q=n;w=p+$ppt.height()+$pp_pic_holder.find(".pp_top").height()+$pp_pic_holder.find(".pp_bottom").height();u=n}function h(n){return n.match(/youtube\.com\/watch/i)?"youtube":n.match(/vimeo\.com/i)?"vimeo":n.indexOf(".mov")!=-1?"quicktime":n.indexOf(".swf")!=-1?"flash":n.indexOf("iframe")!=-1?"iframe":n.indexOf("custom")!=-1?"custom":n.substr(0,1)=="#"?"inline":"image"}function m(){if(doresize&&typeof $pp_pic_holder!=
"undefined"){scroll_pos=k();titleHeight=$ppt.height();contentHeight=$pp_pic_holder.height();contentwidth=$pp_pic_holder.width();projectedTop=v/2+scroll_pos.scrollTop-contentHeight/2;$pp_pic_holder.css({top:projectedTop,left:B/2+scroll_pos.scrollLeft-contentwidth/2})}}function k(){if(self.pageYOffset)return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};else if(document.documentElement&&document.documentElement.scrollTop)return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};
else if(document.body)return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft}}function l(n){theRel=a(n).attr("rel");galleryRegExp=/\[(?:.*)\]/;pp_images=(isSet=galleryRegExp.exec(theRel)?true:false)?jQuery.map(x,function(s){if(a(s).attr("rel").indexOf(theRel)!=-1)return a(s).attr("href")}):a.makeArray(a(n).attr("href"));pp_titles=isSet?jQuery.map(x,function(s){if(a(s).attr("rel").indexOf(theRel)!=-1)return a(s).find("img").attr("alt")?a(s).find("img").attr("alt"):""}):a.makeArray(a(n).find("img").attr("alt"));
pp_descriptions=isSet?jQuery.map(x,function(s){if(a(s).attr("rel").indexOf(theRel)!=-1)return a(s).attr("title")?a(s).attr("title"):""}):a.makeArray(a(n).attr("title"));a("body").append(settings.markup);$pp_pic_holder=a(".pp_pic_holder");$ppt=a(".ppt");$pp_overlay=a("div.pp_overlay");if(isSet&&settings.overlay_gallery){currentGalleryPage=0;toInject="";for(n=0;n<pp_images.length;n++){classname=/(.*?).(jpg|jpeg|png|gif)$/.exec(pp_images[n])?"":"default";toInject+="<li class='"+classname+"'><a href='#'><img src='"+
pp_images[n]+"' 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(){a.prettyPhoto.changeGalleryPage("next");a.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_gallery .pp_arrow_previous").click(function(){a.prettyPhoto.changeGalleryPage("previous");a.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=57;$pp_pic_holder.find(".pp_gallery ul li").each(function(s){a(this).css({position:"absolute",left:s*itemWidth});a(this).find("a").unbind("click").click(function(){a.prettyPhoto.changePage(s);a.prettyPhoto.stopSlideshow();return false})})}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(){a.prettyPhoto.startSlideshow();
return false})}$pp_pic_holder.attr("class","pp_pic_holder "+settings.theme);$pp_overlay.css({opacity:0,height:a(document).height(),width:a(document).width()}).bind("click",function(){settings.modal||a.prettyPhoto.close()});a("a.pp_close").bind("click",function(){a.prettyPhoto.close();return false});a("a.pp_expand").bind("click",function(){if(a(this).hasClass("pp_expand")){a(this).removeClass("pp_expand").addClass("pp_contract");doresize=false}else{a(this).removeClass("pp_contract").addClass("pp_expand");
doresize=true}f(function(){a.prettyPhoto.open()});return false});$pp_pic_holder.find(".pp_previous, .pp_nav .pp_arrow_previous").bind("click",function(){a.prettyPhoto.changePage("previous");a.prettyPhoto.stopSlideshow();return false});$pp_pic_holder.find(".pp_next, .pp_nav .pp_arrow_next").bind("click",function(){a.prettyPhoto.changePage("next");a.prettyPhoto.stopSlideshow();return false});m()}j=jQuery.extend({animation_speed:"fast",slideshow:false,autoplay_slideshow:false,opacity:0.8,show_title:true,
allow_resize:true,default_width:500,default_height:344,counter_separator_label:"/",theme:"facebook",hideflash:false,wmode:"opaque",autoplay:true,modal:false,overlay_gallery:true,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},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">            <a class="pp_next" href="#">next</a>            <a class="pp_previous" href="#">previous</a>           </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:""},j);var x=this,o=false,r,z,p,q,w,u,v=a(window).height(),B=a(window).width(),y;doresize=true;scroll_pos=k();a(window).unbind("resize").resize(function(){m();v=a(window).height();B=a(window).width();typeof $pp_overlay!="undefined"&&$pp_overlay.height(a(document).height())});j.keyboard_shortcuts&&a(document).unbind("keydown").keydown(function(n){if(typeof $pp_pic_holder!="undefined")if($pp_pic_holder.is(":visible")){switch(n.keyCode){case 37:a.prettyPhoto.changePage("previous");
break;case 39:a.prettyPhoto.changePage("next");break;case 27:settings.modal||a.prettyPhoto.close()}return false}});a.prettyPhoto.initialize=function(){settings=j;if(a.browser.msie&&parseInt(a.browser.version)==6)settings.theme="light_square";l(this);settings.allow_resize&&a(window).scroll(function(){m()});m();set_position=jQuery.inArray(a(this).attr("href"),pp_images);a.prettyPhoto.open();return false};a.prettyPhoto.open=function(n,s,A){if(typeof settings=="undefined"){settings=j;if(a.browser.msie&&
a.browser.version==6)settings.theme="light_square";l(n.target);pp_images=a.makeArray(n);pp_titles=s?a.makeArray(s):a.makeArray("");pp_descriptions=A?a.makeArray(A):a.makeArray("");isSet=pp_images.length>1?true:false;set_position=0}a.browser.msie&&a.browser.version==6&&a("select").css("visibility","hidden");settings.hideflash&&a("object,embed").css("visibility","hidden");b(a(pp_images).size());a(".pp_loaderIcon").show();$ppt.is(":hidden")&&$ppt.css("opacity",0).show();$pp_overlay.show().fadeTo(settings.animation_speed,
settings.opacity);$pp_pic_holder.find(".currentTextHolder").text(set_position+1+settings.counter_separator_label+a(pp_images).size());$pp_pic_holder.find(".pp_description").show().html(unescape(pp_descriptions[set_position]));settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined"?$ppt.html(unescape(pp_titles[set_position])):$ppt.html("&nbsp;");movie_width=parseFloat(c("width",pp_images[set_position]))?c("width",pp_images[set_position]):settings.default_width.toString();
movie_height=parseFloat(c("height",pp_images[set_position]))?c("height",pp_images[set_position]):settings.default_height.toString();if(movie_width.indexOf("%")!=-1||movie_height.indexOf("%")!=-1){movie_height=parseFloat(a(window).height()*parseFloat(movie_height)/100-150);movie_width=parseFloat(a(window).width()*parseFloat(movie_width)/100-150);o=true}else o=false;$pp_pic_holder.fadeIn(function(){imgPreloader="";switch(h(pp_images[set_position])){case "image":imgPreloader=new Image;nextImage=new Image;
if(isSet&&set_position>a(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(){r=e(imgPreloader.width,imgPreloader.height);_showContent()};imgPreloader.onerror=function(){alert("Image cannot be loaded. Make sure the path is correct and image exist.");
a.prettyPhoto.close()};imgPreloader.src=pp_images[set_position];break;case "youtube":r=e(movie_width,movie_height);movie="http://www.youtube.com/v/"+c("v",pp_images[set_position]);if(settings.autoplay)movie+="&autoplay=1";toInject=settings.flash_markup.replace(/{width}/g,r.width).replace(/{height}/g,r.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case "vimeo":r=e(movie_width,movie_height);movie_id=pp_images[set_position];movie="http://player.vimeo.com/video/"+movie_id.match(/http:\/\/(www\.)?vimeo.com\/(\d+)/)[2]+
"?title=0&amp;byline=0&amp;portrait=0";if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=r.width+"/embed/?moog_width="+r.width;toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,r.height).replace(/{path}/g,movie);break;case "quicktime":r=e(movie_width,movie_height);r.height+=15;r.contentHeight+=15;r.containerHeight+=15;toInject=settings.quicktime_markup.replace(/{width}/g,r.width).replace(/{height}/g,r.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,
pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case "flash":r=e(movie_width,movie_height);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,r.width).replace(/{height}/g,r.height).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+"?"+
flash_vars);break;case "iframe":r=e(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf("iframe")-1);toInject=settings.iframe_markup.replace(/{width}/g,r.width).replace(/{height}/g,r.height).replace(/{path}/g,frame_url);break;case "custom":r=e(movie_width,movie_height);toInject=settings.custom_markup;break;case "inline":myClone=a(pp_images[set_position]).clone().css({width:settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline clearfix"></div></div>').appendTo(a("body"));
r=e(a(myClone).width(),a(myClone).height());a(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,a(pp_images[set_position]).html())}if(!imgPreloader){$pp_pic_holder.find("#pp_full_res")[0].innerHTML=toInject;_showContent()}});return false};a.prettyPhoto.changePage=function(n){currentGalleryPage=0;if(n=="previous"){set_position--;if(set_position<0){set_position=0;return}}else if(n=="next"){set_position++;if(set_position>a(pp_images).size()-1)set_position=0}else set_position=n;doresize||
(doresize=true);a(".pp_contract").removeClass("pp_contract").addClass("pp_expand");f(function(){a.prettyPhoto.open()})};a.prettyPhoto.changeGalleryPage=function(n){if(n=="next"){currentGalleryPage++;if(currentGalleryPage>totalPage)currentGalleryPage=0}else if(n=="previous"){currentGalleryPage--;if(currentGalleryPage<0)currentGalleryPage=totalPage}else currentGalleryPage=n;itemsToSlide=currentGalleryPage==totalPage?pp_images.length-totalPage*itemsPerPage:itemsPerPage;$pp_pic_holder.find(".pp_gallery li").each(function(s){a(this).animate({left:s*
itemWidth-itemsToSlide*itemWidth*currentGalleryPage})})};a.prettyPhoto.startSlideshow=function(){if(typeof y=="undefined"){$pp_pic_holder.find(".pp_play").unbind("click").removeClass("pp_play").addClass("pp_pause").click(function(){a.prettyPhoto.stopSlideshow();return false});y=setInterval(a.prettyPhoto.startSlideshow,settings.slideshow)}else a.prettyPhoto.changePage("next")};a.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find(".pp_pause").unbind("click").removeClass("pp_pause").addClass("pp_play").click(function(){a.prettyPhoto.startSlideshow();
return false});clearInterval(y);y=undefined};a.prettyPhoto.close=function(){clearInterval(y);$pp_pic_holder.stop().find("object,embed").css("visibility","hidden");a("div.pp_pic_holder,div.ppt,.pp_fade").fadeOut(settings.animation_speed,function(){a(this).remove()});$pp_overlay.fadeOut(settings.animation_speed,function(){a.browser.msie&&a.browser.version==6&&a("select").css("visibility","visible");settings.hideflash&&a("object,embed").css("visibility","visible");a(this).remove();a(window).unbind("scroll");
settings.callback();doresize=true;z=false;delete settings})};_showContent=function(){a(".pp_loaderIcon").hide();$ppt.fadeTo(settings.animation_speed,1);projectedTop=scroll_pos.scrollTop+(v/2-r.containerHeight/2);if(projectedTop<0)projectedTop=0;$pp_pic_holder.find(".pp_content").animate({height:r.contentHeight},settings.animation_speed);$pp_pic_holder.animate({top:projectedTop,left:B/2-r.containerWidth/2,width:r.containerWidth},settings.animation_speed,function(){$pp_pic_holder.find(".pp_hoverContainer,#fullResImage").height(r.height).width(r.width);
$pp_pic_holder.find(".pp_fade").fadeIn(settings.animation_speed);isSet&&h(pp_images[set_position])=="image"?$pp_pic_holder.find(".pp_hoverContainer").show():$pp_pic_holder.find(".pp_hoverContainer").hide();r.resized&&a("a.pp_expand,a.pp_contract").fadeIn(settings.animation_speed);settings.autoplay_slideshow&&!y&&!z&&a.prettyPhoto.startSlideshow();settings.changepicturecallback();z=true});if(isSet&&settings.overlay_gallery&&h(pp_images[set_position])=="image"){itemWidth=57;navWidth=settings.theme==
"facebook"?58:38;itemsPerPage=Math.floor((r.containerWidth-100-navWidth)/itemWidth);itemsPerPage=itemsPerPage<pp_images.length?itemsPerPage:pp_images.length;totalPage=Math.ceil(pp_images.length/itemsPerPage)-1;if(totalPage==0){navWidth=0;$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;$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;itemsPerPage?$pp_pic_holder.find(".pp_gallery").hide().show().removeClass("disabled"):$pp_pic_holder.find(".pp_gallery").hide().addClass("disabled");a.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()}};return this.unbind("click").click(a.prettyPhoto.initialize)}})(jQuery);(function(a){a.fn.quicksand=function(c,j,f){var b={duration:750,easing:"swing",attribute:"data-id",adjustHeight:"auto",useScaling:true,enhancement:function(){},selector:"> *",dx:0,dy:0};a.extend(b,j);if(a.browser.msie||typeof a.fn.scale=="undefined")b.useScaling=false;var e;if(typeof j=="function")e=j;else if(typeof(f=="function"))e=f;return this.each(function(g){var h,m=[],k=a(c).clone(),l=a(this);g=a(this).css("height");var x,o=false,r=a(l).offset(),z=[],p=a(this).find(b.selector);if(a.browser.msie&&
a.browser.version.substr(0,1)<7)l.html("").append(k);else{var q=0,w=function(){if(!q){q=1;$toDelete=l.find("> *");l.prepend(n.find("> *"));$toDelete.remove();o&&l.css("height",x);b.enhancement(l);typeof e=="function"&&e.call(this)}},u=l.offsetParent(),v=u.offset();if(u.css("position")=="relative"){if(u.get(0).nodeName.toLowerCase()!="body"){v.top+=parseFloat(u.css("border-top-width"))||0;v.left+=parseFloat(u.css("border-left-width"))||0}}else{v.top-=parseFloat(u.css("border-top-width"))||0;v.left-=
parseFloat(u.css("border-left-width"))||0;v.top-=parseFloat(u.css("margin-top"))||0;v.left-=parseFloat(u.css("margin-left"))||0}if(isNaN(v.left))v.left=0;if(isNaN(v.top))v.top=0;v.left-=b.dx;v.top-=b.dy;l.css("height",a(this).height());p.each(function(s){z[s]=a(this).offset()});a(this).stop();var B=0,y=0;p.each(function(s){a(this).stop();var A=a(this).get(0);if(A.style.position=="absolute"){B=-b.dx;y=-b.dy}else{B=b.dx;y=b.dy}A.style.position="absolute";A.style.margin="0";A.style.top=z[s].top-parseFloat(A.style.marginTop)-
v.top+y+"px";A.style.left=z[s].left-parseFloat(A.style.marginLeft)-v.left+B+"px"});var n=a(l).clone();u=n.get(0);u.innerHTML="";u.setAttribute("id","");u.style.height="auto";u.style.width=l.width()+"px";n.append(k);n.insertBefore(l);n.css("opacity",0);u.style.zIndex=-1;u.style.margin="0";u.style.position="absolute";u.style.top=r.top-v.top+"px";u.style.left=r.left-v.left+"px";if(b.adjustHeight==="dynamic")l.animate({height:n.height()},b.duration,b.easing);else if(b.adjustHeight==="auto"){x=n.height();
if(parseFloat(g)<parseFloat(x))l.css("height",x);else o=true}p.each(function(){var s=[];if(typeof b.attribute=="function"){h=b.attribute(a(this));k.each(function(){if(b.attribute(this)==h){s=a(this);return false}})}else s=k.filter("["+b.attribute+"="+a(this).attr(b.attribute)+"]");if(s.length)b.useScaling?m.push({element:a(this),animation:{top:s.offset().top-v.top,left:s.offset().left-v.left,opacity:1,scale:"1.0"}}):m.push({element:a(this),animation:{top:s.offset().top-v.top,left:s.offset().left-
v.left,opacity:1}});else b.useScaling?m.push({element:a(this),animation:{opacity:"0.0",scale:"0.0"}}):m.push({element:a(this),animation:{opacity:"0.0"}})});k.each(function(){var s=[],A=[];if(typeof b.attribute=="function"){h=b.attribute(a(this));p.each(function(){if(b.attribute(this)==h){s=a(this);return false}});k.each(function(){if(b.attribute(this)==h){A=a(this);return false}})}else{s=p.filter("["+b.attribute+"="+a(this).attr(b.attribute)+"]");A=k.filter("["+b.attribute+"="+a(this).attr(b.attribute)+
"]")}var D;if(s.length===0){D=b.useScaling?{opacity:"1.0",scale:"1.0"}:{opacity:"1.0"};d=A.clone();var C=d.get(0);C.style.position="absolute";C.style.margin="0";C.style.top=A.offset().top-v.top+"px";C.style.left=A.offset().left-v.left+"px";d.css("opacity",0);b.useScaling&&d.css("transform","scale(0.0)");d.appendTo(l);m.push({element:a(d),animation:D})}});n.remove();b.enhancement(l);for(g=0;g<m.length;g++)m[g].element.animate(m[g].animation,b.duration,b.easing,w)}})}})(jQuery);
