function log(msg) {
	window.console && window.console.log(msg);
}




/* SWF Element needs the following Markup Structure:
<a href="http://your.link/here" data-swf="http://path.to/swf" class="swf">
  <!-- div will be replaced by flash --> 
  (<div>)
    flash fallback content (i.e. image)
  (</div>)
</a>
also possible to use <div> instead of <a> 
*/
(function( $ ){
	var methods = {
	    init : function( o ) {
			return this.each(function(){
				var $this = $(this);
				var unique_id = getUniqueId();
				
				var flashvars = $.unserialize($this.attr('data-flashvars'));
				var params = $.unserialize($this.attr('data-params'));
				var attributes = $.unserialize($this.attr('data-attributes'));
				
				var default_flashvars = {
					clicktag: $this.attr('href')
				};
				var default_params = {
					allowFullscreen: true,
					allowScriptAccess: 'always',
					wmode: 'transparent'
				};
				var default_attributes = {
					id: unique_id,
					name: unique_id
				};
				
				flashvars = $.extend(false, default_flashvars, flashvars);
				params = $.extend(false, default_params, params);
				attributes = $.extend(false, default_attributes, attributes);
				
				var defaults = {
					swfUrl: $this.attr('data-swf'),
					width: "100%",
					height: "100%",
					flashvars: flashvars,
					params: params,
					attributes: attributes,
					callback: null
				}
				
				var options = $.extend(true, defaults, o);		
				$this.width($this.width());
				$this.height($this.height());
				var fallbackMarkup = $this.html();
				$this.html('');
				var $container = $('<div id="'+options.attributes.id+'"></div>').appendTo($this);
				var width = "100%";
				var height = "100%";
				swfobject.embedSWF(options.swfUrl, options.attributes.id, options.width, options.height, "9.0.0",false, options.flashvars, options.params, options.attributes, swfEmbedCallback);
				function swfEmbedCallback(e){
					if (e.success) {
						//$this.children().not(e.ref).remove();
						$this.removeAttr('href');
					} else {
						//$container.remove();
						$this.html(fallbackMarkup);
					}
					if (options.callback) 
						options.callback.call($this, e);
				}
			});
		}
	};
	function getUniqueId() {
		var jetzt = new Date();
		return "id_"+jetzt.getTime();
	}
	$.fn.swfElement = function( method ) {
	    // Method calling logic
	    if ( methods[method] ) {
	      return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
	    } else if ( typeof method === 'object' || ! method ) {
	      return methods.init.apply( this, arguments );
	    } else {
	      $.error( 'Method ' +  method + ' does not exist on jQuery.swfElement' );
	    }  
	};
})( jQuery );


/* unserialize decodes strings of kind a=1&b=2&c=3... to an object */
(function($) {
		$.unserialize = function(str) {
			if (str) {
				var item_pairs = str.split('&');
				var obj = new Object();
				$.each(item_pairs, function(index, val){
					var item_splitted = val.split('=');
					obj[item_splitted[0]] = item_splitted[1];
				});
				return obj;
			} else {
				return false;
			}
		};
})(jQuery);



/* jQuery Sitemap need standard csc-sitemap from typo3 */

/*(function($) {
	$.fn.jQuerySitemap = function(presentation, type) {
	
		var rootElement = this;
	
		if(rootElement.length > 0){
			
					
			// assign the layout depending on the given parameter 'type'
			// by default 'vertical' is assigned
			var type = (type == null) ? "vertical" : type;
				$(rootElement).addClass(type);
			
			
			// hide/show sublevels depending on the parameter 'presentation'			
		var presentation = (presentation == null) ? "open" : presentation;
			
		if (presentation == 'closed') {
					$(rootElement + ' ul').hide();
					spanClass = 'collapsed';
				}
				else {
					spanClass = 'expanded';
				}

			
			// append the navigation for toggling
			$('li', rootElement).find('ul').each(function(){
					$(this).after('<span class="'+ spanClass +'" />');
				})				
	
			// Toggle the Icons onclick
		$('.expanded').live('click', function(){
					$(this).prevAll('ul').slideToggle();
					$(this).attr('class', 'collapsed');
				})
				$('.collapsed').live('click', function(){
					$(this).prevAll('ul').slideToggle();
					$(this).attr('class', 'expanded');
				})	
				
				$('.expanded, .collapsed').hover(function(){
					$(this).css('cursor', 'pointer');
				})			
		};
		
	
	};
})(jQuery);

*/


function jquerySitemap(rootElement, presentation, type ) {

    if(rootElement){
                
        // assign the layout depending on the given parameter 'type'
        // by default 'vertical' is assigned
            var type = (type == null) ? "vertical" : type;
            $(rootElement).addClass(type);
        
        
        // hide/show sublevels depending on the parameter 'presentation'            
            var presentation = (presentation == null) ? "open" : presentation;
        
            if (presentation == 'closed') {
                $(rootElement + ' ul').hide();
                spanClass = 'collapsed';
            }
            else {
                spanClass = 'expanded';
            }
        
        
        // append the navigation for toggling
            $(rootElement + ' li').find('ul').each(function(){
                $(this).after('<span class="'+ spanClass +'" />');
            })
        
            
        
        // Toggle the Icons onclick
            $('.expanded').live('click', function(){
                $(this).prevAll('ul').slideToggle();
                $(this).attr('class', 'collapsed');
            })
            $('.collapsed').live('click', function(){
                $(this).prevAll('ul').slideToggle();
                $(this).attr('class', 'expanded');
            })  
            
            $('.expanded, .collapsed').hover(function(){
                $(this).css('cursor', 'pointer');
            })          
    };
    

};



/* mmcFormDefaults is a HTML5 Fallback for old Browsers and IE 
   fills text-inputs with their placeholder text and toggles on focus */
(function($) {
		$.fn.mmcFormDefaults = function() {
			function supports_input_placeholder() {
			  var i = document.createElement('input');
			  return 'placeholder' in i;
			}
			if (!supports_input_placeholder()) {
				this.each(function(){
					if ($(this).val() == '') {
						$(this).val($(this).attr('placeholder')).addClass('empty');
					}
					$(this).bind('focus', function(){
						if ($(this).val() == $(this).attr('placeholder')) {
							$(this).val('').removeClass('empty');
						}
					});
					$(this).bind('blur', function(){
						if ($(this).val() == '') {
							$(this).val($(this).attr('placeholder')).addClass('empty');
						}
					});
				});
			}
			return this;
		};
})(jQuery);








/**********************************************************************************************************/
/* MMC Carousel (c) 2010-2011 David Rerych mmc:agentur */


(function( $ ){

  var methods = {
	init : function( options ) {
		return $(this).each(function(){
		
		if (typeof this.o == 'undefined') {
				
				log('initializing ' + $(this).attr('id'));
				
				var $this = $(this);
				var This = this;

				//this.originalMarkup = $($('<div></div>').html($this.clone())).html();
				
				$this.addClass('mmc-carousel');

				var o = $.extend({
					btnPrev: null,
					btnNext: null,
					btnGo: null,
					btnPage: null,
					buildPager: null,
					mouseWheel: false,
					auto: null,
					jumpToOtherEnd: false,
					
					speed: 200,
					easing: null,
					
					vertical: false,
					circular: true,
					visible: 3,
					start: 0,
					scroll: 1,
					
					beforeStart: null,
					afterEnd: null,
					onReInit: null
				}, options);
				
				this.o = o;
				
				if (o.scroll > o.visible) {
					log('scroll more elements than visible is not allowed! terminating ...');
					return $this;
				}
				
				this.running = false;
				
				this.curr = 0;
				
				this.animCss = this.o.vertical ? "top" : "left";
				this.sizeCss = this.o.vertical ? "height" : "width";
				this.div = $this;
				this.ul = this.div.children('ul');
				this.v = this.o.visible;
			
				this.circ_offset = 0;

				this.intervalID = null;
				
				this.curr = this.o.start;
				this.currpage = null;
				
				methods.reInit.call($this);

				
				this.li.css({
					'overflow': 'hidden',
					'float': this.o.vertical ? "none" : "left"
				});
				this.ul.css({
					margin: "0",
					padding: "0",
					position: "relative",
					"list-style-type": "none"
				});
				this.div.css({
					overflow: "hidden",
					position: "relative",
					left: "0px"
				});

				
				if (this.o.btnGo) {
					$.each(this.o.btnGo, function(i, val){
						$(val).click(function(){
							if (!$(this).hasClass('active')) {
								methods.go.call($this, i);
							}
							return false;
						});
					});
				}				


				if (this.o.btnPrev) {
					$(this.o.btnPrev).click(function(){
						if (!$(this).hasClass('disabled')) {
							methods.advance.call($this, -This.o.scroll);
							return false;
						}
						else {
							return false;
						}
					});
				}
				
				if (this.o.btnNext) {
					$(this.o.btnNext).click(function(){
						if (!$(this).hasClass('disabled')) {
							methods.advance.call($this, This.o.scroll);
							return false;
						} else {
							return false;
						}
					});
				}
				

					
				if (this.o.mouseWheel && this.div.mousewheel) 
					this.div.mousewheel(function(e, d){
						d > 0 ? methods.advance.call($this,  -This.o.scroll) : methods.advance.call($this, This.o.scroll);
						return false;
					});

				if (this.o.auto) {
					methods.startAuto.call($this);
					$(this.o.btnPrev).add(this.o.btnNext)
						.mouseenter(function(){
							methods.stopAuto.call($this);
						})
						.mouseleave(function(){
							if (this.o.auto) {
								methods.startAuto.call($this);
							}
						});	
				}
				
				disEnAbleButtons(this);
				
                if(this.o.afterInit)
                    this.o.afterInit.call(this, this.o);
				
		   }
		});
		
		
	},
	reInit : function () {
		return this.each(function(){
			log('reinitializing');
			
			var $this = $(this);
			
			this.ul.find('.mmcCarouselClone').remove();
			
			this.tLi = this.ul.children('li');
			this.tl = this.tLi.size();
			
			this.tLi.each(function(){
				$(this).attr('data-index',$(this).index());
			});
			this.pagelength = Math.ceil((this.tl - this.o.visible)/this.o.scroll)+1;
			this.liSize = this.o.vertical ? this.tLi.outerHeight(true) : this.tLi.outerWidth(true); // Full li size(incl margin)-Used for animation
			if (this.o.circular && (this.tl > this.o.visible)) {
				this.ul.prepend(this.tLi.slice(this.tl - this.o.visible, this.tl).clone(true).addClass('mmcCarouselClone'));
				this.ul.append(this.tLi.slice(0, this.o.visible).clone(true).addClass('mmcCarouselClone'));
				this.circ_offset = this.v * this.liSize;
			} else {
				this.circ_offset = 0;
			}
			this.li = this.ul.children('li');
			this.totalLiLength = this.li.size();
			this.ulSize = this.liSize * this.totalLiLength; // size of full ul(total length, not just for the visible items)
	
	
			this.ul.css(this.sizeCss, this.ulSize + "px");

		
			//.css(this.animCss, -(this.curr*this.liSize + this.circ_offset));
			
			
			
			if (this.o.buildPager) {
				var pagerLinks = '';
				for (var i=0; i<this.pagelength; i++) {
					pagerLinks += '<a href="#" >'+(i+1)+'</a>';
				};
				$(this.o.buildPager).html(pagerLinks);
				this.o.btnPage = $('a', this.o.buildPager);
			}
			
			if (this.o.btnPage) {
				if (this.o.btnPage.length < this.pagelength) {
					log('Not enough btnPage Objects, please update or use $("#yourCarouselID").mmcCarousel("goPage", n).');
					this.o.btnPage = null;
				}
				else {
					$.each(this.o.btnPage, function(i, val){
						$(val).click(function(){
							if (!$(this).hasClass('active')) {
								methods.goPage.call($this, i);
							}
							return false;
						});
					});
				}
			}
			
			if ((!this.o.circular)) {
				methods.jump.call($this, this.curr);
			} else {
				methods.jump.call($this, this.curr);
				if (this.tl <= this.o.visible) {
					this.o.circular = false;
					methods.go.call($this, 0);
				}
			}			
			
			if (this.o.onReInit) {
				this.o.onReInit.call($this, methods.vis.call($this), this.currpage);
			}

		});
	},
	removeItem : function (item, speed) {
		var This = this[0];
		var $this = $(This);
		if (typeof This.o == 'undefined') {
			log($this.context+' '+$this.context.className+' '+$this.context.id+' is no mmcCarousel');
			return false;
		}
		if (This.running) {
			return $(This);
		}
		speed = speed || 200;
		log('removeItem Called');
		if (typeof item == 'number') {
			var $this_li = This.li.filter('[data-index='+item+']');
			if ($this_li.length <= 0) {
				return false;
			}
		} else {
			var $this_li = $(item);
		}
		
		var index = $this_li.attr('data-index');
		//log(this.li.filter('[data-index='+index+']'));
		
		if (index < This.curr) {
			This.curr--;
		}
		
		if ((index > This.tl - This.o.visible - 1) && (!This.o.circular)) {
			log('remove index = ' + index);
			log('remove curr = ' + This.curr);
			methods.go.call($this, This.curr - 1, speed);
		}
		
		
		
		if (methods.vis.call($this, $this_li)) {
		
			This.running = true;
			
			$this_li.animate(This.animCss == "left" ? {
				'width': '0px',
				'margin-left': '0px',
				'margin-right': '0px',
				'padding-left': '0px',
				'padding-right': '0px'
			} : {
				'height': '0px',
				'margin-top': '0px',
				'margin-bottom': '0px',
				'padding-top': '0px',
				'padding-bottom': '0px'
			}, speed, function(){
				This.running = false;
				finallyRemoveItem();
			});
		
		} else {
			finallyRemoveItem();
		}
		

		function finallyRemoveItem() {
			This.li.filter('[data-index=' + index + ']').remove();
			methods.reInit.call($this);
		}
	},
	go : function( to, speed ) {
		return this.each(function(){
			if (typeof this.o != 'undefined') {

				speed = typeof speed != 'undefined' ? speed : this.o.speed;		
			
				log('go to='+to + ' ');
				
				var $this = $(this);
				var This = this;
				var v = this.o.visible;
				
		        if(!this.running) {
					
		            if(this.o.circular) {            // If circular we are in first or last, then goto the other end
		                if(to<-this.o.visible) {           // If first, then goto last
		                    // If "scroll" > 1, then the "to" might not be equal to the condition; it can be lesser depending on the number of elements.
		                    this.curr = to+this.tl;
							methods.jump.call($this, this.curr+this.tl);
		                } else if(to > this.tl) { // If last, then goto first
		                    methods.jump.call($this, this.curr-this.tl);
							this.curr = to - this.tl;
		                } else this.curr = to;
		            } else {                    // If non-circular and to points to first or last, we just return.
		                if (this.o.auto || this.o.jumpToOtherEnd) {
							if (to < 0)
								this.curr = this.tl - v;
							else
								if (to > this.tl - v) {				// true if "to" is greater than the last valid element (all elements minus visible elements).
									if (this.curr == (this.tl - v))	// if we have been here before,
										this.curr = 0;				// ... go to first element
									else
										this.curr = this.tl - v;	// set "curr" to the last valid element 
								}
								else 
									this.curr = to;
						}
						else {
							if (to < 0) 
								this.curr = 0;
							else 
								if (to > this.tl - v) 
									this.curr = this.tl - v;
								else
									this.curr = to;
							if (this.curr < 0) 
								this.curr = 0;
						}
		            }                           // If neither overrides it, the curr will still be "to" and we can proceed.
	
					this.currpage = Math.ceil(this.curr/this.o.scroll) % this.pagelength;
					
					
	
					if(this.o.beforeStart)
		                this.o.beforeStart.call(This, methods.vis.call($this), This.curr, This.currpage);
		
					//log('curr='+this.curr+'  currpage='+this.currpage);
		
		            this.running = true;
		
					//log(this.curr*this.liSize+this.circ_offset);
	
		            this.ul.animate(
	
		                this.animCss == "left" ? { left: -(this.curr*this.liSize+this.circ_offset) } : { top: -(this.curr*this.liSize+this.circ_offset) }, speed, this.o.easing,
						
						function() {
							if(This.o.circular) {
								if(This.curr < 0) {
									This.curr += This.tl;
								} else if(This.curr >= This.tl) {
									This.curr -= This.tl;
								}
								This.currpage = Math.ceil(This.curr/This.o.scroll) % This.pagelength;
								methods.jump.call($this, This.curr);
							}
		                    if(This.o.afterEnd)
		                        This.o.afterEnd.call(This, methods.vis.call($this), This.curr, This.currpage);
							
		                    //log('curr = '+This.curr);
							This.running = false;
		                }
		            );
					
					
					disEnAbleButtons(this);
		        }
			} else {
				log($(this).attr('id')+' is no mmcCarousel');
			}			
		});

	 },
	 advance : function (howmuch) {
	 	return this.each(function(){
			var $this = $(this);
			var This = this;
			var curr = This.curr;
			if (This.o.btnPage) 
				return methods.goPage.call($this, This.currpage + sgn(howmuch));
			else			
				return methods.go.call($this, (curr+howmuch));
		});
	 },
	 getRunning : function() {
	 	return this.running;
	 },
	 jump: function( to, callCallbackFns ) {
	 	callCallbackFns = callCallbackFns || false;
	 	return this.each(function(){
			//log('jump called');
			var $this = $(this);
			var This = this;
			This.ul.css(This.animCss, -(This.liSize * to + This.circ_offset));
			This.curr = to;
			disEnAbleButtons(this);
			if(this.o.beforeStart && callCallbackFns)
		      this.o.beforeStart.call(this, methods.vis.call($this), this.currpage);
			if(This.o.afterEnd && callCallbackFns)
		      This.o.afterEnd.call(this, methods.vis.call($this), This.curr, This.currpage);

		});
	 },
	 goPage : function( toPg ) {
	 	return this.each(function() {
			if (typeof this.o != 'undefined') {
				var $this = $(this);
				var This = this;
				var to = toPg * This.o.scroll;
				if (to > This.tl) {
					to = This.tl;
				} else if (to < 0) {
					to = -(This.tl % This.o.scroll);
					log (to);
				}
				return methods.go.call($this, to);
			} else {
				log($(this).attr('id')+' is no mmcCarousel');
			}
		});
	 },
	 stopAuto : function() {
	 	return this.each(function(){
			if (typeof this.o != 'undefined') {
				var $this = $(this);
				clearInterval(This.intervalID);
			} else {
				log($(this).attr('id')+' is no mmcCarousel');
			}
		});
	 },
	 startAuto : function() {
	 	return this.each(function(){
			if (typeof this.o != 'undefined') {
				var $this = $(this);
				var This = this;
				if (!This.o.auto) 
					This.o.auto = true;
				if (This.o.auto === true) 
					This.o.auto = This.o.speed;
				This.intervalID = setInterval(function(){
					methods.advance.call($this, This.o.scroll);
				}, parseInt(This.o.auto + This.o.speed));
			} else {
				log($(this).attr('id')+' is no mmcCarousel');
			}
		});
	 },
	 destroy : function() {
	 	this.each(function(){
			if (typeof this.o != 'undefined') {
				var $this = $(this);
				This = this;
				this.ul.find('.mmcCarouselClone').remove();
				this.ul.removeAttr('style');
				this.circ_offset = 0;
				This.ul.css(This.animCss, 0);
				this.o.circular = false;
				this.li.removeAttr('data-index');
				$(this.o.btnPrev).unbind('click');
				$(this.o.btnNext).unbind('click');
				$(this.o.buildPager).html('');
				
				methods.stopAuto.call($this);
				this.o.auto = false;
				
				delete this.o;
			} else {
				log($(this).attr('id')+' is no mmcCarousel');
			}
			
		});
		
	 },
	 
	 vis : function( argument ) {
		var $this = $(this)[0];
		var This = this[0];
		if (typeof argument == 'number') {
			if ((argument >= This.curr) && (argument < This.curr + This.o.visible)) {
				return true;
			} else {
				return false;
			}
		} else if( argument instanceof jQuery) {
			if(This.li.slice(This.curr).slice(0, This.o.visible).filter(argument).length > 0) {
				return true;
			} else {
				return false;
			}
		} else {
			return This.li.slice(This.curr).slice(0, This.o.visible);
		}
	 }

  };

	
	function disEnAbleButtons(instance){
		// Disable buttons when the carousel reaches the last/first, and enable when not
		var This = instance;
		if (!This.o.circular && !This.o.jumpToOtherEnd) {
			$(This.o.btnPrev).add(This.o.btnNext).removeClass("disabled");
			
			$((This.curr == 0 && This.o.btnPrev) ||
			(This.curr == (This.tl - This.o.visible) && This.o.btnNext) ||
			[]).addClass("disabled");
			
			if (This.tl <= This.o.visible) $(This.o.btnNext).addClass("disabled");
			
		}
		
		if (This.tl <= This.o.visible) {
			$(This.o.btnPrev).addClass('disabled');
			$(This.o.btnNext).addClass('disabled');
		}

		if(This.o.btnGo) {
			$(This.o.btnGo).removeClass('active');
			$(This.o.btnGo).eq(This.curr).addClass('active');
		}
		if(This.o.btnPage) {
			$(This.o.btnPage).removeClass('active');
			$(This.o.btnPage).eq(This.currpage).addClass('active');
		}		
		
	}
	
	function log(msg) {
		if (window.console && window.console.log)
			window.console.log(msg);
	};	
	
	function sgn(num) {
		if (num < 0) {
			return -1;
		}
		else if (num > 0) {
			return 1;
		}
		else {
			return 0;
		}
	}



  $.fn.mmcCarousel = function( method ) {
    
    // Method calling logic
    if ( methods[method] ) {
      return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
    } else if ( typeof method === 'object' || ! method ) {
      return methods.init.apply( this, arguments );
    } else {
      $.error( 'Method ' +  method + ' does not exist on jQuery.mmcCarousel' );
    }    
  
  };

})( jQuery );



/*
 * jQuery Cycle Plugin (with Transition Definitions)
 * Examples and documentation at: http://jquery.malsup.com/cycle/
 * Copyright (c) 2007-2010 M. Alsup
 * Version: 2.99 (12-MAR-2011)
 * Dual licensed under the MIT and GPL licenses.
 * http://jquery.malsup.com/license.html
 * Requires: jQuery v1.3.2 or later
 */
(function($){var ver="2.99";if($.support==undefined){$.support={opacity:!($.browser.msie)};}function debug(s){$.fn.cycle.debug&&log(s);}function log(){window.console&&console.log&&console.log("[cycle] "+Array.prototype.join.call(arguments," "));}$.expr[":"].paused=function(el){return el.cyclePause;};$.fn.cycle=function(options,arg2){var o={s:this.selector,c:this.context};if(this.length===0&&options!="stop"){if(!$.isReady&&o.s){log("DOM not ready, queuing slideshow");$(function(){$(o.s,o.c).cycle(options,arg2);});return this;}log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)"));return this;}return this.each(function(){var opts=handleArguments(this,options,arg2);if(opts===false){return;}opts.updateActivePagerLink=opts.updateActivePagerLink||$.fn.cycle.updateActivePagerLink;if(this.cycleTimeout){clearTimeout(this.cycleTimeout);}this.cycleTimeout=this.cyclePause=0;var $cont=$(this);var $slides=opts.slideExpr?$(opts.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<2){log("terminating; too few slides: "+els.length);return;}var opts2=buildOptions($cont,$slides,els,opts,o);if(opts2===false){return;}var startTime=opts2.continuous?10:getTimeout(els[opts2.currSlide],els[opts2.nextSlide],opts2,!opts2.backwards);if(startTime){startTime+=(opts2.delay||0);if(startTime<10){startTime=10;}debug("first timeout: "+startTime);this.cycleTimeout=setTimeout(function(){go(els,opts2,0,!opts.backwards);},startTime);}});};function handleArguments(cont,options,arg2){if(cont.cycleStop==undefined){cont.cycleStop=0;}if(options===undefined||options===null){options={};}if(options.constructor==String){switch(options){case"destroy":case"stop":var opts=$(cont).data("cycle.opts");if(!opts){return false;}cont.cycleStop++;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);}cont.cycleTimeout=0;$(cont).removeData("cycle.opts");if(options=="destroy"){destroy(opts);}return false;case"toggle":cont.cyclePause=(cont.cyclePause===1)?0:1;checkInstantResume(cont.cyclePause,arg2,cont);return false;case"pause":cont.cyclePause=1;return false;case"resume":cont.cyclePause=0;checkInstantResume(false,arg2,cont);return false;case"prev":case"next":var opts=$(cont).data("cycle.opts");if(!opts){log('options not found, "prev/next" ignored');return false;}$.fn.cycle[options](opts);return false;default:options={fx:options};}return options;}else{if(options.constructor==Number){var num=options;options=$(cont).data("cycle.opts");if(!options){log("options not found, can not advance slide");return false;}if(num<0||num>=options.elements.length){log("invalid slide index: "+num);return false;}options.nextSlide=num;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}if(typeof arg2=="string"){options.oneTimeFx=arg2;}go(options.elements,options,1,num>=options.currSlide);return false;}}return options;function checkInstantResume(isPaused,arg2,cont){if(!isPaused&&arg2===true){var options=$(cont).data("cycle.opts");if(!options){log("options not found, can not resume");return false;}if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}go(options.elements,options,1,!options.backwards);}}}function removeFilter(el,opts){if(!$.support.opacity&&opts.cleartype&&el.style.filter){try{el.style.removeAttribute("filter");}catch(smother){}}}function destroy(opts){if(opts.next){$(opts.next).unbind(opts.prevNextEvent);}if(opts.prev){$(opts.prev).unbind(opts.prevNextEvent);}if(opts.pager||opts.pagerAnchorBuilder){$.each(opts.pagerAnchors||[],function(){this.unbind().remove();});}opts.pagerAnchors=null;if(opts.destroy){opts.destroy(opts);}}function buildOptions($cont,$slides,els,options,o){var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});if(opts.autostop){opts.countdown=opts.autostopCount||els.length;}var cont=$cont[0];$cont.data("cycle.opts",opts);opts.$cont=$cont;opts.stopCount=cont.cycleStop;opts.elements=els;opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];if(!$.support.opacity&&opts.cleartype){opts.after.push(function(){removeFilter(this,opts);});}if(opts.continuous){opts.after.push(function(){go(els,opts,0,!opts.backwards);});}saveOriginalOpts(opts);if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($slides);}if($cont.css("position")=="static"){$cont.css("position","relative");}if(opts.width){$cont.width(opts.width);}if(opts.height&&opts.height!="auto"){$cont.height(opts.height);}if(opts.startingSlide){opts.startingSlide=parseInt(opts.startingSlide);}else{if(opts.backwards){opts.startingSlide=els.length-1;}}if(opts.random){opts.randomMap=[];for(var i=0;i<els.length;i++){opts.randomMap.push(i);}opts.randomMap.sort(function(a,b){return Math.random()-0.5;});opts.randomIndex=1;opts.startingSlide=opts.randomMap[1];}else{if(opts.startingSlide>=els.length){opts.startingSlide=0;}}opts.currSlide=opts.startingSlide||0;var first=opts.startingSlide;$slides.css({position:"absolute",top:0,left:0}).hide().each(function(i){var z;if(opts.backwards){z=first?i<=first?els.length+(i-first):first-i:els.length-i;}else{z=first?i>=first?els.length-(i-first):first-i:els.length-i;}$(this).css("z-index",z);});$(els[first]).css("opacity",1).show();removeFilter(els[first],opts);if(opts.fit&&opts.width){$slides.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}var reshape=opts.containerResize&&!$cont.innerHeight();if(reshape){var maxw=0,maxh=0;for(var j=0;j<els.length;j++){var $e=$(els[j]),e=$e[0],w=$e.outerWidth(),h=$e.outerHeight();if(!w){w=e.offsetWidth||e.width||$e.attr("width");}if(!h){h=e.offsetHeight||e.height||$e.attr("height");}maxw=w>maxw?w:maxw;maxh=h>maxh?h:maxh;}if(maxw>0&&maxh>0){$cont.css({width:maxw+"px",height:maxh+"px"});}}if(opts.pause){$cont.hover(function(){this.cyclePause++;},function(){this.cyclePause--;});}if(supportMultiTransitions(opts)===false){return false;}var requeue=false;options.requeueAttempts=options.requeueAttempts||0;$slides.each(function(){var $el=$(this);this.cycleH=(opts.fit&&opts.height)?opts.height:($el.height()||this.offsetHeight||this.height||$el.attr("height")||0);this.cycleW=(opts.fit&&opts.width)?opts.width:($el.width()||this.offsetWidth||this.width||$el.attr("width")||0);if($el.is("img")){var loadingIE=($.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);var loadingFF=($.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete);var loadingOp=($.browser.opera&&((this.cycleW==42&&this.cycleH==19)||(this.cycleW==37&&this.cycleH==17))&&!this.complete);var loadingOther=(this.cycleH==0&&this.cycleW==0&&!this.complete);if(loadingIE||loadingFF||loadingOp||loadingOther){if(o.s&&opts.requeueOnImageNotLoaded&&++options.requeueAttempts<100){log(options.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){$(o.s,o.c).cycle(options);},opts.requeueTimeout);requeue=true;return false;}else{log("could not determine size of image: "+this.src,this.cycleW,this.cycleH);}}}return true;});if(requeue){return false;}opts.cssBefore=opts.cssBefore||{};opts.cssAfter=opts.cssAfter||{};opts.cssFirst=opts.cssFirst||{};opts.animIn=opts.animIn||{};opts.animOut=opts.animOut||{};$slides.not(":eq("+first+")").css(opts.cssBefore);$($slides[first]).css(opts.cssFirst);if(opts.timeout){opts.timeout=parseInt(opts.timeout);if(opts.speed.constructor==String){opts.speed=$.fx.speeds[opts.speed]||parseInt(opts.speed);}if(!opts.sync){opts.speed=opts.speed/2;}var buffer=opts.fx=="none"?0:opts.fx=="shuffle"?500:250;while((opts.timeout-opts.speed)<buffer){opts.timeout+=opts.speed;}}if(opts.easing){opts.easeIn=opts.easeOut=opts.easing;}if(!opts.speedIn){opts.speedIn=opts.speed;}if(!opts.speedOut){opts.speedOut=opts.speed;}opts.slideCount=els.length;opts.currSlide=opts.lastSlide=first;if(opts.random){if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{if(opts.backwards){opts.nextSlide=opts.startingSlide==0?(els.length-1):opts.startingSlide-1;}else{opts.nextSlide=opts.startingSlide>=(els.length-1)?0:opts.startingSlide+1;}}if(!opts.multiFx){var init=$.fn.cycle.transitions[opts.fx];if($.isFunction(init)){init($cont,$slides,opts);}else{if(opts.fx!="custom"&&!opts.multiFx){log("unknown transition: "+opts.fx,"; slideshow terminating");return false;}}}var e0=$slides[first];if(opts.before.length){opts.before[0].apply(e0,[e0,e0,opts,true]);}if(opts.after.length){opts.after[0].apply(e0,[e0,e0,opts,true]);}if(opts.next){$(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,1);});}if(opts.prev){$(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,0);});}if(opts.pager||opts.pagerAnchorBuilder){buildPager(els,opts);}exposeAddSlide(opts,els);return opts;}function saveOriginalOpts(opts){opts.original={before:[],after:[]};opts.original.cssBefore=$.extend({},opts.cssBefore);opts.original.cssAfter=$.extend({},opts.cssAfter);opts.original.animIn=$.extend({},opts.animIn);opts.original.animOut=$.extend({},opts.animOut);$.each(opts.before,function(){opts.original.before.push(this);});$.each(opts.after,function(){opts.original.after.push(this);});}function supportMultiTransitions(opts){var i,tx,txs=$.fn.cycle.transitions;if(opts.fx.indexOf(",")>0){opts.multiFx=true;opts.fxs=opts.fx.replace(/\s*/g,"").split(",");for(i=0;i<opts.fxs.length;i++){var fx=opts.fxs[i];tx=txs[fx];if(!tx||!txs.hasOwnProperty(fx)||!$.isFunction(tx)){log("discarding unknown transition: ",fx);opts.fxs.splice(i,1);i--;}}if(!opts.fxs.length){log("No valid transitions named; slideshow terminating.");return false;}}else{if(opts.fx=="all"){opts.multiFx=true;opts.fxs=[];for(p in txs){tx=txs[p];if(txs.hasOwnProperty(p)&&$.isFunction(tx)){opts.fxs.push(p);}}}}if(opts.multiFx&&opts.randomizeEffects){var r1=Math.floor(Math.random()*20)+30;for(i=0;i<r1;i++){var r2=Math.floor(Math.random()*opts.fxs.length);opts.fxs.push(opts.fxs.splice(r2,1)[0]);}debug("randomized fx sequence: ",opts.fxs);}return true;}function exposeAddSlide(opts,els){opts.addSlide=function(newSlide,prepend){var $s=$(newSlide),s=$s[0];if(!opts.autostopCount){opts.countdown++;}els[prepend?"unshift":"push"](s);if(opts.els){opts.els[prepend?"unshift":"push"](s);}opts.slideCount=els.length;$s.css("position","absolute");$s[prepend?"prependTo":"appendTo"](opts.$cont);if(prepend){opts.currSlide++;opts.nextSlide++;}if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($s);}if(opts.fit&&opts.width){$s.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$s.height(opts.height);}s.cycleH=(opts.fit&&opts.height)?opts.height:$s.height();s.cycleW=(opts.fit&&opts.width)?opts.width:$s.width();$s.css(opts.cssBefore);if(opts.pager||opts.pagerAnchorBuilder){$.fn.cycle.createPagerAnchor(els.length-1,s,$(opts.pager),els,opts);}if($.isFunction(opts.onAddSlide)){opts.onAddSlide($s);}else{$s.hide();}};}$.fn.cycle.resetState=function(opts,fx){fx=fx||opts.fx;opts.before=[];opts.after=[];opts.cssBefore=$.extend({},opts.original.cssBefore);opts.cssAfter=$.extend({},opts.original.cssAfter);opts.animIn=$.extend({},opts.original.animIn);opts.animOut=$.extend({},opts.original.animOut);opts.fxFn=null;$.each(opts.original.before,function(){opts.before.push(this);});$.each(opts.original.after,function(){opts.after.push(this);});var init=$.fn.cycle.transitions[fx];if($.isFunction(init)){init(opts.$cont,$(opts.elements),opts);}};function go(els,opts,manual,fwd){if(manual&&opts.busy&&opts.manualTrump){debug("manualTrump in go(), stopping active transition");$(els).stop(true,true);opts.busy=0;}if(opts.busy){debug("transition active, ignoring new tx request");return;}var p=opts.$cont[0],curr=els[opts.currSlide],next=els[opts.nextSlide];if(p.cycleStop!=opts.stopCount||p.cycleTimeout===0&&!manual){return;}if(!manual&&!p.cyclePause&&!opts.bounce&&((opts.autostop&&(--opts.countdown<=0))||(opts.nowrap&&!opts.random&&opts.nextSlide<opts.currSlide))){if(opts.end){opts.end(opts);}return;}var changed=false;if((manual||!p.cyclePause)&&(opts.nextSlide!=opts.currSlide)){changed=true;var fx=opts.fx;curr.cycleH=curr.cycleH||$(curr).height();curr.cycleW=curr.cycleW||$(curr).width();next.cycleH=next.cycleH||$(next).height();next.cycleW=next.cycleW||$(next).width();if(opts.multiFx){if(opts.lastFx==undefined||++opts.lastFx>=opts.fxs.length){opts.lastFx=0;}fx=opts.fxs[opts.lastFx];opts.currFx=fx;}if(opts.oneTimeFx){fx=opts.oneTimeFx;opts.oneTimeFx=null;}$.fn.cycle.resetState(opts,fx);if(opts.before.length){$.each(opts.before,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});}var after=function(){opts.busy=0;$.each(opts.after,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});};debug("tx firing("+fx+"); currSlide: "+opts.currSlide+"; nextSlide: "+opts.nextSlide);opts.busy=1;if(opts.fxFn){opts.fxFn(curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}else{if($.isFunction($.fn.cycle[opts.fx])){$.fn.cycle[opts.fx](curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}else{$.fn.cycle.custom(curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}}}if(changed||opts.nextSlide==opts.currSlide){opts.lastSlide=opts.currSlide;if(opts.random){opts.currSlide=opts.nextSlide;if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];if(opts.nextSlide==opts.currSlide){opts.nextSlide=(opts.currSlide==opts.slideCount-1)?0:opts.currSlide+1;}}else{if(opts.backwards){var roll=(opts.nextSlide-1)<0;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextSlide=1;opts.currSlide=0;}else{opts.nextSlide=roll?(els.length-1):opts.nextSlide-1;opts.currSlide=roll?0:opts.nextSlide+1;}}else{var roll=(opts.nextSlide+1)==els.length;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextSlide=els.length-2;opts.currSlide=els.length-1;}else{opts.nextSlide=roll?0:opts.nextSlide+1;opts.currSlide=roll?els.length-1:opts.nextSlide-1;}}}}if(changed&&opts.pager){opts.updateActivePagerLink(opts.pager,opts.currSlide,opts.activePagerClass);}var ms=0;if(opts.timeout&&!opts.continuous){ms=getTimeout(els[opts.currSlide],els[opts.nextSlide],opts,fwd);}else{if(opts.continuous&&p.cyclePause){ms=10;}}if(ms>0){p.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.backwards);},ms);}}$.fn.cycle.updateActivePagerLink=function(pager,currSlide,clsName){$(pager).each(function(){$(this).children().removeClass(clsName).eq(currSlide).addClass(clsName);});};function getTimeout(curr,next,opts,fwd){if(opts.timeoutFn){var t=opts.timeoutFn.call(curr,curr,next,opts,fwd);while(opts.fx!="none"&&(t-opts.speed)<250){t+=opts.speed;}debug("calculated timeout: "+t+"; speed: "+opts.speed);if(t!==false){return t;}}return opts.timeout;}$.fn.cycle.next=function(opts){advance(opts,1);};$.fn.cycle.prev=function(opts){advance(opts,0);};function advance(opts,moveForward){var val=moveForward?1:-1;var els=opts.elements;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}if(opts.random&&val<0){opts.randomIndex--;if(--opts.randomIndex==-2){opts.randomIndex=els.length-2;}else{if(opts.randomIndex==-1){opts.randomIndex=els.length-1;}}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{if(opts.random){opts.nextSlide=opts.randomMap[opts.randomIndex];}else{opts.nextSlide=opts.currSlide+val;if(opts.nextSlide<0){if(opts.nowrap){return false;}opts.nextSlide=els.length-1;}else{if(opts.nextSlide>=els.length){if(opts.nowrap){return false;}opts.nextSlide=0;}}}}var cb=opts.onPrevNextEvent||opts.prevNextClick;if($.isFunction(cb)){cb(val>0,opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,moveForward);return false;}function buildPager(els,opts){var $p=$(opts.pager);$.each(els,function(i,o){$.fn.cycle.createPagerAnchor(i,o,$p,els,opts);});opts.updateActivePagerLink(opts.pager,opts.startingSlide,opts.activePagerClass);}$.fn.cycle.createPagerAnchor=function(i,el,$p,els,opts){var a;if($.isFunction(opts.pagerAnchorBuilder)){a=opts.pagerAnchorBuilder(i,el);debug("pagerAnchorBuilder("+i+", el) returned: "+a);}else{a='<a href="#">'+(i+1)+"</a>";}if(!a){return;}var $a=$(a);if($a.parents("body").length===0){var arr=[];if($p.length>1){$p.each(function(){var $clone=$a.clone(true);$(this).append($clone);arr.push($clone[0]);});$a=$(arr);}else{$a.appendTo($p);}}opts.pagerAnchors=opts.pagerAnchors||[];opts.pagerAnchors.push($a);$a.bind(opts.pagerEvent,function(e){e.preventDefault();opts.nextSlide=i;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}var cb=opts.onPagerEvent||opts.pagerClick;if($.isFunction(cb)){cb(opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,opts.currSlide<i);});if(!/^click/.test(opts.pagerEvent)&&!opts.allowPagerClickBubble){$a.bind("click.cycle",function(){return false;});}if(opts.pauseOnPagerHover){$a.hover(function(){opts.$cont[0].cyclePause++;},function(){opts.$cont[0].cyclePause--;});}};$.fn.cycle.hopsFromLast=function(opts,fwd){var hops,l=opts.lastSlide,c=opts.currSlide;if(fwd){hops=c>l?c-l:opts.slideCount-l;}else{hops=c<l?l-c:l+opts.slideCount-c;}return hops;};function clearTypeFix($slides){debug("applying clearType background-color hack");function hex(s){s=parseInt(s).toString(16);return s.length<2?"0"+s:s;}function getBg(e){for(;e&&e.nodeName.toLowerCase()!="html";e=e.parentNode){var v=$.css(e,"background-color");if(v&&v.indexOf("rgb")>=0){var rgb=v.match(/\d+/g);return"#"+hex(rgb[0])+hex(rgb[1])+hex(rgb[2]);}if(v&&v!="transparent"){return v;}}return"#ffffff";}$slides.each(function(){$(this).css("background-color",getBg(this));});}$.fn.cycle.commonReset=function(curr,next,opts,w,h,rev){$(opts.elements).not(curr).hide();if(typeof opts.cssBefore.opacity=="undefined"){opts.cssBefore.opacity=1;}opts.cssBefore.display="block";if(opts.slideResize&&w!==false&&next.cycleW>0){opts.cssBefore.width=next.cycleW;}if(opts.slideResize&&h!==false&&next.cycleH>0){opts.cssBefore.height=next.cycleH;}opts.cssAfter=opts.cssAfter||{};opts.cssAfter.display="none";$(curr).css("zIndex",opts.slideCount+(rev===true?1:0));$(next).css("zIndex",opts.slideCount+(rev===true?0:1));};$.fn.cycle.custom=function(curr,next,opts,cb,fwd,speedOverride){var $l=$(curr),$n=$(next);var speedIn=opts.speedIn,speedOut=opts.speedOut,easeIn=opts.easeIn,easeOut=opts.easeOut;$n.css(opts.cssBefore);if(speedOverride){if(typeof speedOverride=="number"){speedIn=speedOut=speedOverride;}else{speedIn=speedOut=1;}easeIn=easeOut=null;}var fn=function(){$n.animate(opts.animIn,speedIn,easeIn,function(){cb();});};$l.animate(opts.animOut,speedOut,easeOut,function(){$l.css(opts.cssAfter);if(!opts.sync){fn();}});if(opts.sync){fn();}};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(":eq("+opts.currSlide+")").css("opacity",0);opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.opacity=0;});opts.animIn={opacity:1};opts.animOut={opacity:0};opts.cssBefore={top:0,left:0};}};$.fn.cycle.ver=function(){return ver;};$.fn.cycle.defaults={activePagerClass:"activeSlide",after:null,allowPagerClickBubble:false,animIn:null,animOut:null,autostop:0,autostopCount:0,backwards:false,before:null,cleartype:!$.support.opacity,cleartypeNoBg:false,containerResize:1,continuous:0,cssAfter:null,cssBefore:null,delay:0,easeIn:null,easeOut:null,easing:null,end:null,fastOnEvent:0,fit:0,fx:"fade",fxFn:null,height:"auto",manualTrump:true,next:null,nowrap:0,onPagerEvent:null,onPrevNextEvent:null,pager:null,pagerAnchorBuilder:null,pagerEvent:"click.cycle",pause:0,pauseOnPagerHover:0,prev:null,prevNextEvent:"click.cycle",random:0,randomizeEffects:1,requeueOnImageNotLoaded:true,requeueTimeout:250,rev:0,shuffle:null,slideExpr:null,slideResize:1,speed:1000,speedIn:null,speedOut:null,startingSlide:0,sync:1,timeout:4000,timeoutFn:null,updateActivePagerLink:null};})(jQuery);
/*
 * jQuery Cycle Plugin Transition Definitions
 * This script is a plugin for the jQuery Cycle Plugin
 * Examples and documentation at: http://malsup.com/jquery/cycle/
 * Copyright (c) 2007-2010 M. Alsup
 * Version:	 2.73
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
(function($){$.fn.cycle.transitions.none=function($cont,$slides,opts){opts.fxFn=function(curr,next,opts,after){$(next).show();$(curr).hide();after();};};$.fn.cycle.transitions.fadeout=function($cont,$slides,opts){$slides.not(":eq("+opts.currSlide+")").css({display:"block",opacity:1});opts.before.push(function(curr,next,opts,w,h,rev){$(curr).css("zIndex",opts.slideCount+(!rev===true?1:0));$(next).css("zIndex",opts.slideCount+(!rev===true?0:1));});opts.animIn.opacity=1;opts.animOut.opacity=0;opts.cssBefore.opacity=1;opts.cssBefore.display="block";opts.cssAfter.zIndex=0;};$.fn.cycle.transitions.scrollUp=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssBefore.top=h;opts.cssBefore.left=0;opts.cssFirst.top=0;opts.animIn.top=0;opts.animOut.top=-h;};$.fn.cycle.transitions.scrollDown=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssFirst.top=0;opts.cssBefore.top=-h;opts.cssBefore.left=0;opts.animIn.top=0;opts.animOut.top=h;};$.fn.cycle.transitions.scrollLeft=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst.left=0;opts.cssBefore.left=w;opts.cssBefore.top=0;opts.animIn.left=0;opts.animOut.left=0-w;};$.fn.cycle.transitions.scrollRight=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst.left=0;opts.cssBefore.left=-w;opts.cssBefore.top=0;opts.animIn.left=0;opts.animOut.left=w;};$.fn.cycle.transitions.scrollHorz=function($cont,$slides,opts){$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts,fwd){if(opts.rev){fwd=!fwd;}$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.left=fwd?(next.cycleW-1):(1-next.cycleW);opts.animOut.left=fwd?-curr.cycleW:curr.cycleW;});opts.cssFirst.left=0;opts.cssBefore.top=0;opts.animIn.left=0;opts.animOut.top=0;};$.fn.cycle.transitions.scrollVert=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push(function(curr,next,opts,fwd){if(opts.rev){fwd=!fwd;}$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.top=fwd?(1-next.cycleH):(next.cycleH-1);opts.animOut.top=fwd?curr.cycleH:-curr.cycleH;});opts.cssFirst.top=0;opts.cssBefore.left=0;opts.animIn.top=0;opts.animOut.left=0;};$.fn.cycle.transitions.slideX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;});opts.cssBefore.left=0;opts.cssBefore.top=0;opts.cssBefore.width=0;opts.animIn.width="show";opts.animOut.width=0;};$.fn.cycle.transitions.slideY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;});opts.cssBefore.left=0;opts.cssBefore.top=0;opts.cssBefore.height=0;opts.animIn.height="show";opts.animOut.height=0;};$.fn.cycle.transitions.shuffle=function($cont,$slides,opts){var i,w=$cont.css("overflow","visible").width();$slides.css({left:0,top:0});opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);});if(!opts.speedAdjusted){opts.speed=opts.speed/2;opts.speedAdjusted=true;}opts.random=0;opts.shuffle=opts.shuffle||{left:-w,top:15};opts.els=[];for(i=0;i<$slides.length;i++){opts.els.push($slides[i]);}for(i=0;i<opts.currSlide;i++){opts.els.push(opts.els.shift());}opts.fxFn=function(curr,next,opts,cb,fwd){if(opts.rev){fwd=!fwd;}var $el=fwd?$(curr):$(next);$(next).css(opts.cssBefore);var count=opts.slideCount;$el.animate(opts.shuffle,opts.speedIn,opts.easeIn,function(){var hops=$.fn.cycle.hopsFromLast(opts,fwd);for(var k=0;k<hops;k++){fwd?opts.els.push(opts.els.shift()):opts.els.unshift(opts.els.pop());}if(fwd){for(var i=0,len=opts.els.length;i<len;i++){$(opts.els[i]).css("z-index",len-i+count);}}else{var z=$(curr).css("z-index");$el.css("z-index",parseInt(z)+1+count);}$el.animate({left:0,top:0},opts.speedOut,opts.easeOut,function(){$(fwd?this:curr).hide();if(cb){cb();}});});};$.extend(opts.cssBefore,{display:"block",opacity:1,top:0,left:0});};$.fn.cycle.transitions.turnUp=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=next.cycleH;opts.animIn.height=next.cycleH;opts.animOut.width=next.cycleW;});opts.cssFirst.top=0;opts.cssBefore.left=0;opts.cssBefore.height=0;opts.animIn.top=0;opts.animOut.height=0;};$.fn.cycle.transitions.turnDown=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssFirst.top=0;opts.cssBefore.left=0;opts.cssBefore.top=0;opts.cssBefore.height=0;opts.animOut.height=0;};$.fn.cycle.transitions.turnLeft=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=next.cycleW;opts.animIn.width=next.cycleW;});opts.cssBefore.top=0;opts.cssBefore.width=0;opts.animIn.left=0;opts.animOut.width=0;};$.fn.cycle.transitions.turnRight=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});$.extend(opts.cssBefore,{top:0,left:0,width:0});opts.animIn.left=0;opts.animOut.width=0;};$.fn.cycle.transitions.zoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false,true);opts.cssBefore.top=next.cycleH/2;opts.cssBefore.left=next.cycleW/2;$.extend(opts.animIn,{top:0,left:0,width:next.cycleW,height:next.cycleH});$.extend(opts.animOut,{width:0,height:0,top:curr.cycleH/2,left:curr.cycleW/2});});opts.cssFirst.top=0;opts.cssFirst.left=0;opts.cssBefore.width=0;opts.cssBefore.height=0;};$.fn.cycle.transitions.fadeZoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false);opts.cssBefore.left=next.cycleW/2;opts.cssBefore.top=next.cycleH/2;$.extend(opts.animIn,{top:0,left:0,width:next.cycleW,height:next.cycleH});});opts.cssBefore.width=0;opts.cssBefore.height=0;opts.animOut.opacity=0;};$.fn.cycle.transitions.blindX=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore.left=w;opts.cssBefore.top=0;opts.animIn.left=0;opts.animOut.left=w;};$.fn.cycle.transitions.blindY=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore.top=h;opts.cssBefore.left=0;opts.animIn.top=0;opts.animOut.top=h;};$.fn.cycle.transitions.blindZ=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();var w=$cont.width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore.top=h;opts.cssBefore.left=w;opts.animIn.top=0;opts.animIn.left=0;opts.animOut.top=h;opts.animOut.left=w;};$.fn.cycle.transitions.growX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=this.cycleW/2;opts.animIn.left=0;opts.animIn.width=this.cycleW;opts.animOut.left=0;});opts.cssBefore.top=0;opts.cssBefore.width=0;};$.fn.cycle.transitions.growY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=this.cycleH/2;opts.animIn.top=0;opts.animIn.height=this.cycleH;opts.animOut.top=0;});opts.cssBefore.height=0;opts.cssBefore.left=0;};$.fn.cycle.transitions.curtainX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true,true);opts.cssBefore.left=next.cycleW/2;opts.animIn.left=0;opts.animIn.width=this.cycleW;opts.animOut.left=curr.cycleW/2;opts.animOut.width=0;});opts.cssBefore.top=0;opts.cssBefore.width=0;};$.fn.cycle.transitions.curtainY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false,true);opts.cssBefore.top=next.cycleH/2;opts.animIn.top=0;opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH/2;opts.animOut.height=0;});opts.cssBefore.height=0;opts.cssBefore.left=0;};$.fn.cycle.transitions.cover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);if(d=="right"){opts.cssBefore.left=-w;}else{if(d=="up"){opts.cssBefore.top=h;}else{if(d=="down"){opts.cssBefore.top=-h;}else{opts.cssBefore.left=w;}}}});opts.animIn.left=0;opts.animIn.top=0;opts.cssBefore.top=0;opts.cssBefore.left=0;};$.fn.cycle.transitions.uncover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(d=="right"){opts.animOut.left=w;}else{if(d=="up"){opts.animOut.top=-h;}else{if(d=="down"){opts.animOut.top=h;}else{opts.animOut.left=-w;}}}});opts.animIn.left=0;opts.animIn.top=0;opts.cssBefore.top=0;opts.cssBefore.left=0;};$.fn.cycle.transitions.toss=function($cont,$slides,opts){var w=$cont.css("overflow","visible").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(!opts.animOut.left&&!opts.animOut.top){$.extend(opts.animOut,{left:w*2,top:-h/2,opacity:0});}else{opts.animOut.opacity=0;}});opts.cssBefore.left=0;opts.cssBefore.top=0;opts.animIn.left=0;};$.fn.cycle.transitions.wipe=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.cssBefore=opts.cssBefore||{};var clip;if(opts.clip){if(/l2r/.test(opts.clip)){clip="rect(0px 0px "+h+"px 0px)";}else{if(/r2l/.test(opts.clip)){clip="rect(0px "+w+"px "+h+"px "+w+"px)";}else{if(/t2b/.test(opts.clip)){clip="rect(0px "+w+"px 0px 0px)";}else{if(/b2t/.test(opts.clip)){clip="rect("+h+"px "+w+"px "+h+"px 0px)";}else{if(/zoom/.test(opts.clip)){var top=parseInt(h/2);var left=parseInt(w/2);clip="rect("+top+"px "+left+"px "+top+"px "+left+"px)";}}}}}}opts.cssBefore.clip=opts.cssBefore.clip||clip||"rect(0px 0px 0px 0px)";var d=opts.cssBefore.clip.match(/(\d+)/g);var t=parseInt(d[0]),r=parseInt(d[1]),b=parseInt(d[2]),l=parseInt(d[3]);opts.before.push(function(curr,next,opts){if(curr==next){return;}var $curr=$(curr),$next=$(next);$.fn.cycle.commonReset(curr,next,opts,true,true,false);opts.cssAfter.display="block";var step=1,count=parseInt((opts.speedIn/13))-1;(function f(){var tt=t?t-parseInt(step*(t/count)):0;var ll=l?l-parseInt(step*(l/count)):0;var bb=b<h?b+parseInt(step*((h-b)/count||1)):h;var rr=r<w?r+parseInt(step*((w-r)/count||1)):w;$next.css({clip:"rect("+tt+"px "+rr+"px "+bb+"px "+ll+"px)"});(step++<=count)?setTimeout(f,13):$curr.css("display","none");})();});$.extend(opts.cssBefore,{display:"block",opacity:1,top:0,left:0});opts.animIn={left:0};opts.animOut={left:0};};})(jQuery);




/*!
 * jQuery mmcMediabox: lightbox for all purposes v1.1.3 - 2011-08-25
 * http://www.mmc-agentur.at
 *
 * Copyright (c) 2011 DaR David Rerych - mmc:agentur
 */
(function($){var instanceId=0;function log(msg){if(window.console&&window.console.log){window.console.log(msg)}}function getUniqueId(){var jetzt=new Date();return"id_"+jetzt.getTime()}String.prototype.betterMatch=function(pattern){var matcharray=[];var match=pattern.exec(this);while(match){matcharray.push(match);match=pattern.exec(this)}return matcharray};RegExp.escape=function(str){var specials=new RegExp("[.*+?|()\\[\\]{}\\\\]","g");return str.replace(specials,"\\$&")};var parseMarkup=function(markup){var $el=this;var markers=markup.betterMatch(/\{(.+?)\}/g);for(var i=0;i<markers.length;i++){var marker=markers[i][0];var marker_inner=markers[i][1];var marker_fragments=marker_inner.split("|");var newcontent="";for(var j=0;j<marker_fragments.length;j++){var marker_fragment_fragments=marker_fragments[j].split(".");var marker_fragment_type=marker_fragment_fragments.shift();var marker_fragment_marker=marker_fragment_fragments.join(".");if(marker_fragment_type=="attr"){newcontent=$el.attr(marker_fragment_marker)}else{if(marker_fragment_type=="data"){newcontent=eval("$el.o."+marker_fragment_marker)}}if(newcontent){break}}var regexp=new RegExp(RegExp.escape(marker));markup=markup.replace(regexp,newcontent)}return markup};var assignItems=function(){var This=this;this.allItems=[];this.allImagesets=[];this.each(function(){var $el=$(this);$el.o=$.metadata?$.extend({},This.mainOpts,$el.metadata()):This.mainOpts;var imagesetString=(typeof $el.attr("data-mediaset")!=="undefined")&&($el.attr("data-mediaset")!=="")?$el.attr("data-mediaset"):$el.attr("rel");var imagesetId=$.inArray(imagesetString,This.allImagesets);if(imagesetId<0){imagesetId=This.allImagesets.length;This.allImagesets.push(imagesetString);This.allItems[imagesetId]=[]}$el.imagesetId=imagesetId;$el.idx=This.allItems[imagesetId].length;$el.click(function(e){e.preventDefault();e.stopPropagation();methods.open.call(This,$el);return false});This.allItems[imagesetId].push($el)})};var methods={init:function(options){var This=this;this.instanceId=instanceId++;var defaults={appendToDomElement:"body",labels:{close:"schlie&szlig;en",next:"weiter",prev:"zur&uuml;ck",item:"",of:"von",download:"Download"},classes:{overlay:"mediabox-overlay",container:"mediabox-container",innerWrapper:"mediabox-innerwrapper",content:"mediabox-content",infoArea:"mediabox-infoarea",closeBtn:"mediabox-closebtn",hoverNav:"mediabox-hovernav",downloadLink:"mediabox-download",infoAreaNavigation:"mediabox-navigation"},containerFadeDuration:100,contentFadeDuration:400,resizeDuration:400,fitToScreen:true,viewportPadding:10,initialWidth:200,initialHeight:200,width:null,height:null,modal:true,onAction:function(evt,$el){},onResizeReady:function(width,height){},onOpen:function(){},onInitReady:function(){},classPrefix:null,downloadURL:null,overrideHref:null,params:{wmode:"transparent",allowscriptaccess:"always"},flashvars:null,attributes:null,projekktorOptions:{playerFlashMP4:"fileadmin/system/assets/js/projekktor/jarisplayer.swf"},infoArea:{counter:function($el){var hidden_class=this.currentImageset.length==1?"hidden":"";var infoAreaCounter='<span class="numberDisplay '+hidden_class+'"><span class="item">'+$el.o.labels.item+'</span> <span class="current">'+parseInt($el.idx+1,10)+"</span>&nbsp;"+$el.o.labels.of+'&nbsp;<span class="total">'+this.currentImageset.length+"</span></span>";return infoAreaCounter},title:function($el){var title=$el.attr("title");var titleHtml="";if(typeof title!=="undefined"){titleHtml=' <span class="title">'+title+"</span>"}return titleHtml},navigation:function($el){var hidden_class=this.currentImageset.length==1?"hidden":"";var infoAreaNavigation='<span class="'+$el.o.classes.infoAreaNavigation+'"><span class="prev '+hidden_class+'">'+$el.o.labels.prev+'</span> <span class="next '+hidden_class+'">'+$el.o.labels.next+'</span> <span class="close">'+$el.o.labels.close+"</span></span>";return infoAreaNavigation},downloadLink:function($el){var downloadLink="";if($el.o.downloadURL){downloadLink='<a href="'+$el.o.downloadURL+'" class="'+$el.o.classes.downloadLink+'">'+$el.o.labels.download+"</a>"}return downloadLink}},onInfoAreaReady:function($infoArea){},type:null,types:{image:{markup:'<img src="{data.overrideHref|attr.href}" alt="{attr.title}" /><div class="{data.classes.hoverNav}"><div class="next">{data.labels.next}</div><div class="prev">{data.labels.prev}</div></div>',fileExtensions:["jpg","jpeg","png","gif"],loadContentFn:function($el,type){var This=this;var href=$el.o.href;var typeOpts=$el.o.types[type];var imageLoader=new Image();var $image=This.$content.find("img").hide();var $loading=This.$content.find(".loading").show();var $infoAreaTitle=this.$infoArea.find(".title").hide();imageLoader.onload=function(){var imgWidth=$el.o.width?$el.o.width:imageLoader.width;var imgHeight=$el.o.height?$el.o.height:imageLoader.height;methods.resize.call(This,imgWidth,imgHeight,null,$el.o,function(){$loading.hide();$infoAreaTitle.fadeIn($el.o.contentFadeDuration);$image.attr("src",href).hide().fadeIn($el.o.contentFadeDuration).css({width:"100%",height:"100%"})})};imageLoader.src=href}},video:{markup:'<video width="{data.width}" height="{data.height}" controls="controls" preload="none"><source src="{data.overrideHref|attr.href}" type="{data.videoType}" /></video>',fileExtensions:["mp4","m4v","ogv","webm","flv"],width:600,height:338,loadContentFn:function($el,type){var This=this;var href=$el.o.href;var itemOpts=$el.o;var typeOpts=itemOpts.types[type];var $video=This.$content.find("video").addClass("projekktor").hide();var $loading=This.$content.find(".loading").show();var $infoAreaTitle=this.$infoArea.find(".title").hide();if($el.o.additionalVideoTypes){$.each($el.o.additionalVideoTypes,function(idx,val){$video.append('<source src="'+val+'" type="'+idx+'" />')})}var width=$el.o.width?$el.o.width:$el.o.types[type].width;var height=$el.o.height?$el.o.height:$el.o.types[type].height;methods.resize.call(This,width,height,null,$el.o,function(w,h){$video.attr("width",w);$video.attr("height",h);$loading.hide();if(typeof projekktor!=="undefined"){var videoProjekktor=projekktor($video,$el.o.projekktorOptions,function(player){});videoProjekktor.each(function(){$("#"+this._id).fadeIn($el.o.contentFadeDuration)})}$infoAreaTitle.hide().fadeIn($el.o.contentFadeDuration);$video.fadeIn($el.o.contentFadeDuration)})}},swf:{markup:'<div class="mediabox-swfcontainer"></div>',fileExtensions:["swf"],width:800,height:600,loadContentFn:function($el,type){var This=this;var href=$el.o.href;var itemOpts=$el.o;var typeOpts=itemOpts.types[type];var width=$el.o.width?$el.o.width:$el.o.types[type].width;var height=$el.o.height?$el.o.height:$el.o.types[type].height;var $loading=this.$content.find(".loading").show();var unique_id=getUniqueId();var $infoAreaTitle=this.$infoArea.find(".title").hide();var flashvars=$el.o.flashvars;var params=$el.o.params;var attributes=$el.o.attributes;var default_attributes={id:unique_id,name:unique_id};attributes=$.extend(false,{},default_attributes,attributes);var $container=this.$content.find(".mediabox-swfcontainer").attr("id",attributes.id);methods.resize.call(This,width,height,null,$el.o,function(){$container.show();$infoAreaTitle.fadeIn($el.o.contentFadeDuration);if(typeof swfobject!=="undefined"){swfobject.embedSWF(href,attributes.id,"100%","100%","9.0.0",false,flashvars,params,attributes,swfEmbedCallback)}else{$container.html("swfobject is missing")}});function swfEmbedCallback(e){$loading.hide();if(e.success){}else{$container.html('<a href="http://get.adobe.com/de/flashplayer/">Download Adobe Flash Player</a>')}}}},iframe:{markup:'<iframe src="{data.overrideHref|attr.href}" scrolling="{data.scrolling}" frameborder="0" allowtransparency="true"></iframe>',fileExtensions:["html","htm"],width:800,height:600,loadContentFn:function($el,type){var This=this;var width=$el.o.width?$el.o.width:$el.o.types[type].width;var height=$el.o.height?$el.o.height:$el.o.types[type].height;var $loading=this.$content.find(".loading").show();var $iframe=this.$content.find("iframe");var $infoAreaTitle=this.$infoArea.find(".title").hide();$iframe.hide();$iframe.load(function(){methods.resize.call(This,width,height,null,$el.o,function(width,height){$iframe.width(width).height(height).attr("width",width).attr("height",height);$loading.hide();$iframe.add($infoAreaTitle).fadeIn($el.o.contentFadeDuration)})})}},ajax:{markup:'<div class="ajax-container"></div>',fileExtensions:[],width:800,height:600,loadContentFn:function($el,type){var This=this;var href=$el.o.href;var ajaxURL=$el.o.fragment?href+" "+$el.o.fragment:href;var width=$el.o.width?$el.o.width:$el.o.types[type].width;var height=$el.o.height?$el.o.height:$el.o.types[type].height;var $loading=this.$content.find(".loading").show();var $ajaxContainer=this.$content.find(".ajax-container");var $infoAreaTitle=this.$infoArea.find(".title").hide();$ajaxContainer.hide();$ajaxContainer.load(ajaxURL,function(){methods.resize.call(This,width,height,null,$el.o,function(w,h){$ajaxContainer.fadeIn($el.o.contentFadeDuration).width(w).height(h);$infoAreaTitle.fadeIn($el.o.contentFadeDuration);$loading.hide()})})}}}};this.mainOpts=$.extend(true,{},defaults,options);$.each(this.mainOpts.classes,function(idx,val){if(This.mainOpts.classPrefix!==null){This.mainOpts.classes[idx]+=" "+This.mainOpts.classPrefix+val}});methods.buildMarkup.apply(this);This.isOpen=false;this.$overlay.click(function(e){e.preventDefault();methods.close.call(This);return false});$(window).bind("resize",function(){methods.reposition.call(This)});assignItems.call(this);log(this.allItems);function checkHash(){var mmcMediaboxHash=$.bbq.getState("mmcMediabox");if(typeof mmcMediaboxHash!=="undefined"&&mmcMediaboxHash!==""){var fragments=decodeURIComponent(mmcMediaboxHash).split(";");var instanceId=parseInt(fragments[0],10);var imagesetId=parseInt(fragments[1],10);var itemId=parseInt(fragments[2],10);if(This.instanceId==instanceId){if(This.allItems[imagesetId]){if(!This.isOpen){methods.open.call(This,This.allItems[imagesetId][itemId])}else{if(This.current!=itemId){methods.loadContent.call(This,This.allItems[imagesetId][itemId])}}}else{log("no Imageset with this id")}}}}if(typeof $.bbq!=="undefined"){checkHash();$(window).bind("hashchange",checkHash)}This.mainOpts.onInitReady.call(This);return this},buildMarkup:function(){var This=this;var classes=this.mainOpts.classes;this.$overlay=$('<div class="'+classes.overlay+'"></div>').appendTo(this.mainOpts.appendToDomElement);this.$container=$('<div class="'+classes.container+'"></div>').insertAfter(this.$overlay);this.$innerWrapper=$('<div class="'+classes.innerWrapper+'"></div>').appendTo(this.$container);this.$content=$('<div class="'+classes.content+'"></div>').appendTo(this.$innerWrapper);this.$infoArea=$('<div class="'+classes.infoArea+'"></div>').appendTo(this.$innerWrapper);this.$closeBtn=$('<div class="close">'+this.mainOpts.labels.close+"</div>").appendTo(this.$container);this.emptyOuterWidth=this.$container.outerWidth();this.emptyOuterHeight=this.$container.outerHeight();this.$overlay.add(this.$container).hide()},reposition:function($el){$el=$el?$el:false;var This=this;this.viewport={};this.viewport.width=$(window).width();this.viewport.height=$(window).height();this.body={};this.body.width=$("body").width();this.body.height=$("body").height();this.document={};this.document.width=$(document).width();this.document.height=$(document).height();this.$overlay.width(this.body.width).height(this.document.height)},removeMarkup:function(){this.$overlay.add(this.$container).remove()},destroy:function(){methods.removeMarkup.call(this);$(this).unbind("click")},open:function($el){var This=this;$el=$el?$el:this.allItems[0][0];$($el.o.appendToDomElement).find("object, embed").hide();this.current=$el.idx;This.currentImageset=This.allItems[$el.imagesetId];methods.reposition.call(This,$el);if(This.mainOpts.modal){This.$overlay.show()}var currentWidth=parseInt(This.$content.css("width"),10);var currentHeight=parseInt(This.$content.css("height"),10);var newWidth=currentWidth>0?currentWidth:This.mainOpts.initialWidth;var newHeight=currentHeight>0?currentHeight:This.mainOpts.initialHeight;newWidth=$el&&$el.o.width?$el.o.width:newWidth;newHeight=$el&&$el.o.height?$el.o.height:newHeight;methods.resize.call(This,newWidth,newHeight,0,null);This.$container.fadeIn(This.mainOpts.containerFadeDuration,function(){methods.loadContent.call(This,$el)});document.onkeydown=function(evt){methods.keyboardAction.call(This,evt)};this.isOpen=true;this.mainOpts.onAction.call(this,"open",$el)},close:function(){var $el=this.currentImageset[this.current];this.$overlay.hide();this.$container.fadeOut(this.mainOpts.containerFadeDuration);this.$content.html("");$($el.o.appendToDomElement).find("object, embed").show();var url_states={mmcMediabox:""};if(typeof $.bbq!=="undefined"){$.bbq.pushState(url_states)}this.mainOpts.onAction.call(this,"close",$el);document.onkeydown="";this.isOpen=false},next:function(){if(this.current+1<this.currentImageset.length){var $el=this.currentImageset[this.current+1];methods.loadContent.call(this,$el);this.mainOpts.onAction.call(this,"next",$el)}},prev:function(){if(this.current>0){var $el=this.currentImageset[this.current-1];methods.loadContent.call(this,$el);this.mainOpts.onAction.call(this,"prev",$el)}},keyboardAction:function(e){var This=this;var keycode,escapeKey;if(e===null){keycode=event.keyCode;escapeKey=27}else{keycode=e.keyCode;escapeKey=e.DOM_VK_ESCAPE}var key=String.fromCharCode(keycode).toLowerCase();if((key=="x")||(key=="o")||(key=="c")||(keycode==escapeKey)){methods.close.call(This)}else{if((key=="p")||(keycode==37)){methods.prev.call(This)}else{if((key=="n")||(keycode==39)){methods.next.call(This)}}}},loadContent:function($el,event){this.current=$el.idx;var This=this;event=event?event:null;var href=$el.o.overrideHref?$el.o.overrideHref:$el.attr("href");$el.o.href=href;var type="";if($el.o.type===null){type="iframe";var fileExtension=(/[.]/.exec(href))?/[^.]+$/.exec(href)+"":undefined;if(typeof fileExtension!=="undefined"){fileExtension=fileExtension.toLowerCase();$.each($el.o.types,function(idx,val){if($.inArray(fileExtension,val.fileExtensions)>-1){type=idx;return}})}}else{type=$el.o.type}$el.type=type;var availableTypes=[];$.each($el.o.types,function(idx,val){availableTypes.push(idx)});if($.bbq){var url_states={mmcMediabox:This.instanceId+";"+$el.imagesetId+";"+$el.idx};$.bbq.pushState(url_states)}var infoAreaContent="";$.each(this.mainOpts.infoArea,function(idx,val){infoAreaContent+=val.call(This,$el)});this.$infoArea.html(infoAreaContent);this.mainOpts.onInfoAreaReady.call(this,this.$infoArea);This.$content.removeClass(availableTypes.join(" "));var parsedMarkup=parseMarkup.call($el,$el.o.types[type].markup);This.$content.addClass(type).html(parsedMarkup+'<div class="loading" style="display:none;"></div>');this.$next=this.$container.find(".next").unbind("click").bind("click",function(e){e.preventDefault();methods.next.call(This);return false});this.$prev=this.$container.find(".prev").unbind("click").bind("click",function(e){e.preventDefault();methods.prev.call(This);return false});this.$closeBtn=this.$container.find(".close").unbind("click").bind("click",function(e){e.preventDefault();methods.close.call(This);return false});if(this.current+1<this.currentImageset.length){this.$next.removeClass("disabled")}else{this.$next.addClass("disabled")}if(this.current>0){this.$prev.removeClass("disabled")}else{this.$prev.addClass("disabled")}$el.o.types[type].loadContentFn.call(This,$el,type)},resize:function(newWidth,newHeight,duration,opts,callbackFn){var This=this;opts=opts?opts:This.mainOpts;duration=duration?duration:opts.resizeDuration;callbackFn=callbackFn?callbackFn:function(){};newWidth=parseInt(newWidth,10);newHeight=parseInt(newHeight,10);var horizontalPadding=this.emptyOuterWidth;var verticalPadding=this.emptyOuterHeight;if(opts.fitToScreen){var maxWidth=This.viewport.width-opts.viewportPadding*2-horizontalPadding;var maxHeight=This.viewport.height-opts.viewportPadding*2-verticalPadding;if((newWidth/newHeight)>(maxWidth/maxHeight)){if(newWidth>maxWidth){newHeight=newHeight*(maxWidth/newWidth);newWidth=maxWidth}}else{if(newHeight>maxHeight){newWidth=newWidth*(maxHeight/newHeight);newHeight=maxHeight}}}var currentWidth=parseInt(This.$content.css("width"),10);var currentHeight=parseInt(This.$content.css("height"),10);if(currentWidth==newWidth&&currentHeight==newHeight){duration=0}This.$content.animate({width:newWidth+"px",height:newHeight+"px"},duration,function(){callbackFn.call(This,newWidth,newHeight);This.mainOpts.onResizeReady.call(This,newWidth,newHeight)}).css("overflow","visible");var newLeft=(This.viewport.width-newWidth-horizontalPadding)/2+$(window).scrollLeft();var newTop=(This.viewport.height-newHeight-verticalPadding)/2+$(window).scrollTop();newLeft=newLeft<0?opts.viewportPadding:newLeft;newTop=newTop<0?opts.viewportPadding:newTop;This.$container.animate({top:newTop+"px",left:newLeft+"px"},duration).css("overflow","visible")}};$.fn.mmcMediabox=function(method){if(methods[method]){return methods[method].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof method==="object"||!method){return methods.init.apply(this,arguments)}else{$.error("Method "+method+" does not exist on mmc-mediabox")}}}})(jQuery);







  
(function(F){var B,C,I,L,K,H,E,G,A,J;B=document.namespaces;has_canvas=!!document.createElement("canvas").getContext;if(!(has_canvas||B)){F.fn.maphilight=function(){return this};return }if(has_canvas){E=function(M){return Math.max(0,Math.min(parseInt(M,16),255))};G=function(M,N){return"rgba("+E(M.substr(0,2))+","+E(M.substr(2,2))+","+E(M.substr(4,2))+","+N+")"};C=function(M){var N=F('<canvas style="width:'+M.width+"px;height:"+M.height+'px;"></canvas>').get(0);N.getContext("2d").clearRect(0,0,N.width,N.height);return N};I=function(P,M,S,O,N){var R,Q=P.getContext("2d");Q.beginPath();if(M=="rect"){Q.rect(S[0],S[1],S[2]-S[0],S[3]-S[1])}else{if(M=="poly"){Q.moveTo(S[0],S[1]);for(R=2;R<S.length;R+=2){Q.lineTo(S[R],S[R+1])}}else{if(M=="circ"){Q.arc(S[0],S[1],S[2],0,Math.PI*2,false)}}}Q.closePath();if(O.fill){Q.fillStyle=G(O.fillColor,O.fillOpacity);Q.fill()}if(O.stroke){Q.strokeStyle=G(O.strokeColor,O.strokeOpacity);Q.lineWidth=O.strokeWidth;Q.stroke()}if(O.fade){F(P).css("opacity",0).animate({opacity:1},100)}};L=function(M){M.getContext("2d").clearRect(0,0,M.width,M.height)}}else{C=function(M){return F('<var style="zoom:1;overflow:hidden;display:block;width:'+M.width+"px;height:"+M.height+'px;"></var>').get(0)};I=function(N,Q,R,U,M){var S,T,O,P;S='<v:fill color="#'+U.fillColor+'" opacity="'+(U.fill?U.fillOpacity:0)+'" />';T=(U.stroke?'strokeweight="'+U.strokeWidth+'" stroked="t" strokecolor="#'+U.strokeColor+'"':'stroked="f"');O='<v:stroke opacity="'+U.strokeOpacity+'"/>';if(Q=="rect"){P=F('<v:rect name="'+M+'" filled="t" '+T+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+R[0]+"px;top:"+R[1]+"px;width:"+(R[2]-R[0])+"px;height:"+(R[3]-R[1])+'px;"></v:rect>')}else{if(Q=="poly"){P=F('<v:shape name="'+M+'" filled="t" '+T+' coordorigin="0,0" coordsize="'+N.width+","+N.height+'" path="m '+R[0]+","+R[1]+" l "+R.join(",")+' x e" style="zoom:1;margin:0;padding:0;display:block;position:absolute;top:0px;left:0px;width:'+N.width+"px;height:"+N.height+'px;"></v:shape>')}else{if(Q=="circ"){P=F('<v:oval name="'+M+'" filled="t" '+T+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+(R[0]-R[2])+"px;top:"+(R[1]-R[2])+"px;width:"+(R[2]*2)+"px;height:"+(R[2]*2)+'px;"></v:oval>')}}}P.get(0).innerHTML=S+O;F(N).append(P)};L=function(M){F(M).find("[name=highlighted]").remove()}}K=function(N){var M,O=N.getAttribute("coords").split(",");for(M=0;M<O.length;M++){O[M]=parseFloat(O[M])}return[N.getAttribute("shape").toLowerCase().substr(0,4),O]};J=function(O,N){var M=F(O);return F.extend({},N,F.metadata?M.metadata():false,M.data("maphilight"))};A=function(M){if(!M.complete){return false}if(typeof M.naturalWidth!="undefined"&&M.naturalWidth==0){return false}return true};H={position:"absolute",left:0,top:0,padding:0,border:0};var D=false;F.fn.maphilight=function(O){O=F.extend({},F.fn.maphilight.defaults,O);if(!has_canvas&&F.browser.msie&&!D){document.namespaces.add("v","urn:schemas-microsoft-com:vml");var N=document.createStyleSheet();var M=["shape","rect","oval","circ","fill","stroke","imagedata","group","textbox"];F.each(M,function(){N.addRule("v\\:"+this,"behavior: url(#default#VML); antialias:true")});D=true}return this.each(function(){var U,R,Y,Q,T,V,X,S,W;U=F(this);if(!A(this)){return window.setTimeout(function(){U.maphilight(O)},200)}Y=F.extend({},O,F.metadata?U.metadata():false,U.data("maphilight"));W=U.get(0).getAttribute("usemap");Q=F('map[name="'+W.substr(1)+'"]');if(!(U.is("img")&&W&&Q.size()>0)){return }if(U.hasClass("maphilighted")){var P=U.parent();U.insertBefore(P);P.remove();F(Q).unbind(".maphilight").find("area[coords]").unbind(".maphilight")}R=F("<div></div>").css({display:"block",background:'url("'+this.src+'")',position:"relative",padding:0,width:this.width,height:this.height});if(Y.wrapClass){if(Y.wrapClass===true){R.addClass(F(this).attr("class"))}else{R.addClass(Y.wrapClass)}}U.before(R).css("opacity",0).css(H).remove();if(F.browser.msie){U.css("filter","Alpha(opacity=0)")}R.append(U);T=C(this);F(T).css(H);T.height=this.height;T.width=this.width;X=function(c){var a,b;b=J(this,Y);if(!b.neverOn&&!b.alwaysOn){a=K(this);I(T,a[0],a[1],b,"highlighted");if(b.groupBy){var Z;if(/^[a-zA-Z][-a-zA-Z]+$/.test(b.groupBy)){Z=Q.find("area["+b.groupBy+'="'+F(this).attr(b.groupBy)+'"]')}else{Z=Q.find(b.groupBy)}var d=this;Z.each(function(){if(this!=d){var f=J(this,Y);if(!f.neverOn&&!f.alwaysOn){var e=K(this);I(T,e[0],e[1],f,"highlighted")}}})}if(!has_canvas){F(T).append("<v:rect></v:rect>")}}};F(Q).bind("alwaysOn.maphilight",function(){if(V){L(V)}if(!has_canvas){F(T).empty()}F(Q).find("area[coords]").each(function(){var Z,a;a=J(this,Y);if(a.alwaysOn){if(!V&&has_canvas){V=C(U.get());F(V).css(H);V.width=U.width();V.height=U.height();U.before(V)}a.fade=a.alwaysOnFade;Z=K(this);if(has_canvas){I(V,Z[0],Z[1],a,"")}else{I(T,Z[0],Z[1],a,"")}}})});F(Q).trigger("alwaysOn.maphilight").find("area[coords]").bind("mouseover.maphilight",X).bind("mouseout.maphilight",function(Z){L(T)});U.before(T);U.addClass("maphilighted")})};F.fn.maphilight.defaults={fill:true,fillColor:"000000",fillOpacity:0.2,stroke:true,strokeColor:"ff0000",strokeOpacity:1,strokeWidth:1,fade:true,alwaysOn:false,neverOn:false,groupBy:false,wrapClass:true}})(jQuery);




/*
 * Metadata - jQuery plugin for parsing metadata from elements
 *
 * Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.metadata.js 3640 2007-10-11 18:34:38Z pmclanahan $
 *
 */

/**
 * Sets the type of metadata to use. Metadata is encoded in JSON, and each property
 * in the JSON will become a property of the element itself.
 *
 * There are four supported types of metadata storage:
 *
 *   attr:  Inside an attribute. The name parameter indicates *which* attribute.
 *          
 *   class: Inside the class attribute, wrapped in curly braces: { }
 *   
 *   elem:  Inside a child element (e.g. a script tag). The
 *          name parameter indicates *which* element.
 *   html5: Values are stored in data-* attributes.
 *          
 * The metadata for an element is loaded the first time the element is accessed via jQuery.
 *
 * As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
 * matched by expr, then redefine the metadata type and run another $(expr) for other elements.
 * 
 * @name $.metadata.setType
 *
 * @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
 * @before $.metadata.setType("class")
 * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
 * @desc Reads metadata from the class attribute
 * 
 * @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
 * @before $.metadata.setType("attr", "data")
 * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
 * @desc Reads metadata from a "data" attribute
 * 
 * @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>
 * @before $.metadata.setType("elem", "script")
 * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
 * @desc Reads metadata from a nested script element
 * 
 * @example <p id="one" class="some_class" data-item_id="1" data-item_label="Label">This is a p</p>
 * @before $.metadata.setType("html5")
 * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
 * @desc Reads metadata from a series of data-* attributes
 *
 * @param String type The encoding type
 * @param String name The name of the attribute to be used to get metadata (optional)
 * @cat Plugins/Metadata
 * @descr Sets the type of encoding to be used when loading metadata for the first time
 * @type undefined
 * @see metadata()
 */

(function($) {

$.extend({
  metadata : {
    defaults : {
      type: 'class',
      name: 'metadata',
      cre: /({.*})/,
      single: 'metadata'
    },
    setType: function( type, name ){
      this.defaults.type = type;
      this.defaults.name = name;
    },
    get: function( elem, opts ){
      var settings = $.extend({},this.defaults,opts);
      // check for empty string in single property
      if ( !settings.single.length ) settings.single = 'metadata';
      
      var data = $.data(elem, settings.single);
      // returned cached data if it already exists
      if ( data ) return data;
      
      data = "{}";
      
      var getData = function(data) {
        if(typeof data != "string") return data;
        
        if( data.indexOf('{') < 0 ) {
          data = eval("(" + data + ")");
        }
      }
      
      var getObject = function(data) {
        if(typeof data != "string") return data;
        
        data = eval("(" + data + ")");
        return data;
      }
      
      if ( settings.type == "html5" ) {
        var object = {};
        $( elem.attributes ).each(function() {
          var name = this.nodeName;
          if(name.match(/^data-/)) name = name.replace(/^data-/, '');
          else return true;
          object[name] = getObject(this.nodeValue);
        });
      } else {
        if ( settings.type == "class" ) {
          var m = settings.cre.exec( elem.className );
          if ( m )
            data = m[1];
        } else if ( settings.type == "elem" ) {
          if( !elem.getElementsByTagName ) return;
          var e = elem.getElementsByTagName(settings.name);
          if ( e.length )
            data = $.trim(e[0].innerHTML);
        } else if ( elem.getAttribute != undefined ) {
          var attr = elem.getAttribute( settings.name );
          if ( attr )
            data = attr;
        }
        object = getObject(data.indexOf("{") < 0 ? "{" + data + "}" : data);
      }
      
      $.data( elem, settings.single, object );
      return object;
    }
  }
});

/**
 * Returns the metadata object for the first member of the jQuery object.
 *
 * @name metadata
 * @descr Returns element's metadata object
 * @param Object opts An object contianing settings to override the defaults
 * @type jQuery
 * @cat Plugins/Metadata
 */
$.fn.metadata = function( opts ){
  return $.metadata.get( this[0], opts );
};

})(jQuery);







/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 * Thanks to: Seamus Leahy for adding deltaX and deltaY
 *
 * Version: 3.0.4
 *
 * Requires: 1.2.2+
 */
(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(i){var g=i||window.event,f=[].slice.call(arguments,1),j=0,h=true,e=0,d=0;i=c.event.fix(g);i.type="mousewheel";if(i.wheelDelta){j=i.wheelDelta/120}if(i.detail){j=-i.detail/3}d=j;if(g.axis!==undefined&&g.axis===g.HORIZONTAL_AXIS){d=0;e=-1*j}if(g.wheelDeltaY!==undefined){d=g.wheelDeltaY/120}if(g.wheelDeltaX!==undefined){e=-1*g.wheelDeltaX/120}f.unshift(i,j,e,d);return c.event.handle.apply(this,f)}})(jQuery);




/*
 * jScrollPane - v2.0.0beta10 - 2011-04-17
 * http://jscrollpane.kelvinluck.com/
 *
 * Copyright (c) 2010 Kelvin Luck
 * Dual licensed under the MIT and GPL licenses.
 */
(function(b,a,c){b.fn.jScrollPane=function(f){function d(E,P){var aA,R=this,Z,al,w,an,U,aa,z,r,aB,aG,aw,j,J,i,k,ab,V,ar,Y,u,B,at,ag,ao,H,m,av,az,y,ax,aJ,g,M,ak=true,Q=true,aI=false,l=false,aq=E.clone(false,false).empty(),ad=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aJ=E.css("paddingTop")+" "+E.css("paddingRight")+" "+E.css("paddingBottom")+" "+E.css("paddingLeft");g=(parseInt(E.css("paddingLeft"),10)||0)+(parseInt(E.css("paddingRight"),10)||0);function au(aS){var aN,aP,aO,aL,aK,aR,aQ=false,aM=false;aA=aS;if(Z===c){aK=E.scrollTop();aR=E.scrollLeft();E.css({overflow:"hidden",padding:0});al=E.innerWidth()+g;w=E.innerHeight();E.width(al);Z=b('<div class="jspPane" />').css("padding",aJ).append(E.children());an=b('<div class="jspContainer" />').css({width:al+"px",height:w+"px"}).append(Z).appendTo(E)}else{E.css("width","");aQ=aA.stickToBottom&&L();aM=aA.stickToRight&&C();aL=E.innerWidth()+g!=al||E.outerHeight()!=w;if(aL){al=E.innerWidth()+g;w=E.innerHeight();an.css({width:al+"px",height:w+"px"})}if(!aL&&M==U&&Z.outerHeight()==aa){E.width(al);return}M=U;Z.css("width","");E.width(al);an.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}Z.css("overflow","auto");if(aS.contentWidth){U=aS.contentWidth}else{U=Z[0].scrollWidth}aa=Z[0].scrollHeight;Z.css("overflow","");z=U/al;r=aa/w;aB=r>1;aG=z>1;if(!(aG||aB)){E.removeClass("jspScrollable");Z.css({top:0,width:an.width()-g});o();F();S();x();aj()}else{E.addClass("jspScrollable");aN=aA.maintainPosition&&(J||ab);if(aN){aP=aE();aO=aC()}aH();A();G();if(aN){O(aM?(U-al):aP,false);N(aQ?(aa-w):aO,false)}K();ah();ap();if(aA.enableKeyboardNavigation){T()}if(aA.clickOnTrack){q()}D();if(aA.hijackInternalLinks){n()}}if(aA.autoReinitialise&&!ax){ax=setInterval(function(){au(aA)},aA.autoReinitialiseDelay)}else{if(!aA.autoReinitialise&&ax){clearInterval(ax)}}aK&&E.scrollTop(0)&&N(aK,false);aR&&E.scrollLeft(0)&&O(aR,false);E.trigger("jsp-initialised",[aG||aB])}function aH(){if(aB){an.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'),b('<div class="jspDragBottom" />'))),b('<div class="jspCap jspCapBottom" />')));V=an.find(">.jspVerticalBar");ar=V.find(">.jspTrack");aw=ar.find(">.jspDrag");if(aA.showArrows){at=b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",aF(0,-1)).bind("click.jsp",aD);ag=b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",aF(0,1)).bind("click.jsp",aD);if(aA.arrowScrollOnHover){at.bind("mouseover.jsp",aF(0,-1,at));ag.bind("mouseover.jsp",aF(0,1,ag))}am(ar,aA.verticalArrowPositions,at,ag)}u=w;an.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){u-=b(this).outerHeight()});aw.hover(function(){aw.addClass("jspHover")},function(){aw.removeClass("jspHover")}).bind("mousedown.jsp",function(aK){b("html").bind("dragstart.jsp selectstart.jsp",aD);aw.addClass("jspActive");var s=aK.pageY-aw.position().top;b("html").bind("mousemove.jsp",function(aL){W(aL.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",ay);return false});p()}}function p(){ar.height(u+"px");J=0;Y=aA.verticalGutter+ar.outerWidth();Z.width(al-Y-g);try{if(V.position().left===0){Z.css("margin-left",Y+"px")}}catch(s){}}function A(){if(aG){an.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'),b('<div class="jspDragRight" />'))),b('<div class="jspCap jspCapRight" />')));ao=an.find(">.jspHorizontalBar");H=ao.find(">.jspTrack");i=H.find(">.jspDrag");if(aA.showArrows){az=b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",aF(-1,0)).bind("click.jsp",aD);y=b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",aF(1,0)).bind("click.jsp",aD);
if(aA.arrowScrollOnHover){az.bind("mouseover.jsp",aF(-1,0,az));y.bind("mouseover.jsp",aF(1,0,y))}am(H,aA.horizontalArrowPositions,az,y)}i.hover(function(){i.addClass("jspHover")},function(){i.removeClass("jspHover")}).bind("mousedown.jsp",function(aK){b("html").bind("dragstart.jsp selectstart.jsp",aD);i.addClass("jspActive");var s=aK.pageX-i.position().left;b("html").bind("mousemove.jsp",function(aL){X(aL.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",ay);return false});m=an.innerWidth();ai()}}function ai(){an.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){m-=b(this).outerWidth()});H.width(m+"px");ab=0}function G(){if(aG&&aB){var aK=H.outerHeight(),s=ar.outerWidth();u-=aK;b(ao).find(">.jspCap:visible,>.jspArrow").each(function(){m+=b(this).outerWidth()});m-=s;w-=s;al-=aK;H.parent().append(b('<div class="jspCorner" />').css("width",aK+"px"));p();ai()}if(aG){Z.width((an.outerWidth()-g)+"px")}aa=Z.outerHeight();r=aa/w;if(aG){av=Math.ceil(1/z*m);if(av>aA.horizontalDragMaxWidth){av=aA.horizontalDragMaxWidth}else{if(av<aA.horizontalDragMinWidth){av=aA.horizontalDragMinWidth}}i.width(av+"px");k=m-av;af(ab)}if(aB){B=Math.ceil(1/r*u);if(B>aA.verticalDragMaxHeight){B=aA.verticalDragMaxHeight}else{if(B<aA.verticalDragMinHeight){B=aA.verticalDragMinHeight}}aw.height(B+"px");j=u-B;ae(J)}}function am(aL,aN,aK,s){var aP="before",aM="after",aO;if(aN=="os"){aN=/Mac/.test(navigator.platform)?"after":"split"}if(aN==aP){aM=aN}else{if(aN==aM){aP=aN;aO=aK;aK=s;s=aO}}aL[aP](aK)[aM](s)}function aF(aK,s,aL){return function(){I(aK,s,this,aL);this.blur();return false}}function I(aN,aM,aQ,aP){aQ=b(aQ).addClass("jspActive");var aO,aL,aK=true,s=function(){if(aN!==0){R.scrollByX(aN*aA.arrowButtonSpeed)}if(aM!==0){R.scrollByY(aM*aA.arrowButtonSpeed)}aL=setTimeout(s,aK?aA.initialDelay:aA.arrowRepeatFreq);aK=false};s();aO=aP?"mouseout.jsp":"mouseup.jsp";aP=aP||b("html");aP.bind(aO,function(){aQ.removeClass("jspActive");aL&&clearTimeout(aL);aL=null;aP.unbind(aO)})}function q(){x();if(aB){ar.bind("mousedown.jsp",function(aP){if(aP.originalTarget===c||aP.originalTarget==aP.currentTarget){var aN=b(this),aQ=aN.offset(),aO=aP.pageY-aQ.top-J,aL,aK=true,s=function(){var aT=aN.offset(),aU=aP.pageY-aT.top-B/2,aR=w*aA.scrollPagePercent,aS=j*aR/(aa-w);if(aO<0){if(J-aS>aU){R.scrollByY(-aR)}else{W(aU)}}else{if(aO>0){if(J+aS<aU){R.scrollByY(aR)}else{W(aU)}}else{aM();return}}aL=setTimeout(s,aK?aA.initialDelay:aA.trackClickRepeatFreq);aK=false},aM=function(){aL&&clearTimeout(aL);aL=null;b(document).unbind("mouseup.jsp",aM)};s();b(document).bind("mouseup.jsp",aM);return false}})}if(aG){H.bind("mousedown.jsp",function(aP){if(aP.originalTarget===c||aP.originalTarget==aP.currentTarget){var aN=b(this),aQ=aN.offset(),aO=aP.pageX-aQ.left-ab,aL,aK=true,s=function(){var aT=aN.offset(),aU=aP.pageX-aT.left-av/2,aR=al*aA.scrollPagePercent,aS=k*aR/(U-al);if(aO<0){if(ab-aS>aU){R.scrollByX(-aR)}else{X(aU)}}else{if(aO>0){if(ab+aS<aU){R.scrollByX(aR)}else{X(aU)}}else{aM();return}}aL=setTimeout(s,aK?aA.initialDelay:aA.trackClickRepeatFreq);aK=false},aM=function(){aL&&clearTimeout(aL);aL=null;b(document).unbind("mouseup.jsp",aM)};s();b(document).bind("mouseup.jsp",aM);return false}})}}function x(){if(H){H.unbind("mousedown.jsp")}if(ar){ar.unbind("mousedown.jsp")}}function ay(){b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");if(aw){aw.removeClass("jspActive")}if(i){i.removeClass("jspActive")}}function W(s,aK){if(!aB){return}if(s<0){s=0}else{if(s>j){s=j}}if(aK===c){aK=aA.animateScroll}if(aK){R.animate(aw,"top",s,ae)}else{aw.css("top",s);ae(s)}}function ae(aK){if(aK===c){aK=aw.position().top}an.scrollTop(0);J=aK;var aN=J===0,aL=J==j,aM=aK/j,s=-aM*(aa-w);if(ak!=aN||aI!=aL){ak=aN;aI=aL;E.trigger("jsp-arrow-change",[ak,aI,Q,l])}v(aN,aL);Z.css("top",s);E.trigger("jsp-scroll-y",[-s,aN,aL]).trigger("scroll")}function X(aK,s){if(!aG){return}if(aK<0){aK=0}else{if(aK>k){aK=k}}if(s===c){s=aA.animateScroll}if(s){R.animate(i,"left",aK,af)
}else{i.css("left",aK);af(aK)}}function af(aK){if(aK===c){aK=i.position().left}an.scrollTop(0);ab=aK;var aN=ab===0,aM=ab==k,aL=aK/k,s=-aL*(U-al);if(Q!=aN||l!=aM){Q=aN;l=aM;E.trigger("jsp-arrow-change",[ak,aI,Q,l])}t(aN,aM);Z.css("left",s);E.trigger("jsp-scroll-x",[-s,aN,aM]).trigger("scroll")}function v(aK,s){if(aA.showArrows){at[aK?"addClass":"removeClass"]("jspDisabled");ag[s?"addClass":"removeClass"]("jspDisabled")}}function t(aK,s){if(aA.showArrows){az[aK?"addClass":"removeClass"]("jspDisabled");y[s?"addClass":"removeClass"]("jspDisabled")}}function N(s,aK){var aL=s/(aa-w);W(aL*j,aK)}function O(aK,s){var aL=aK/(U-al);X(aL*k,s)}function ac(aX,aS,aL){var aP,aM,aN,s=0,aW=0,aK,aR,aQ,aU,aT,aV;try{aP=b(aX)}catch(aO){return}aM=aP.outerHeight();aN=aP.outerWidth();an.scrollTop(0);an.scrollLeft(0);while(!aP.is(".jspPane")){s+=aP.position().top;aW+=aP.position().left;aP=aP.offsetParent();if(/^body|html$/i.test(aP[0].nodeName)){return}}aK=aC();aQ=aK+w;if(s<aK||aS){aT=s-aA.verticalGutter}else{if(s+aM>aQ){aT=s-w+aM+aA.verticalGutter}}if(aT){N(aT,aL)}aR=aE();aU=aR+al;if(aW<aR||aS){aV=aW-aA.horizontalGutter}else{if(aW+aN>aU){aV=aW-al+aN+aA.horizontalGutter}}if(aV){O(aV,aL)}}function aE(){return -Z.position().left}function aC(){return -Z.position().top}function L(){var s=aa-w;return(s>20)&&(s-aC()<10)}function C(){var s=U-al;return(s>20)&&(s-aE()<10)}function ah(){an.unbind(ad).bind(ad,function(aN,aO,aM,aK){var aL=ab,s=J;R.scrollBy(aM*aA.mouseWheelSpeed,-aK*aA.mouseWheelSpeed,false);return aL==ab&&s==J})}function o(){an.unbind(ad)}function aD(){return false}function K(){Z.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(s){ac(s.target,false)})}function F(){Z.find(":input,a").unbind("focus.jsp")}function T(){var s,aK,aM=[];aG&&aM.push(ao[0]);aB&&aM.push(V[0]);Z.focus(function(){E.focus()});E.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(aP){if(aP.target!==this&&!(aM.length&&b(aP.target).closest(aM).length)){return}var aO=ab,aN=J;switch(aP.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:s=aP.keyCode;aL();break;case 35:N(aa-w);s=null;break;case 36:N(0);s=null;break}aK=aP.keyCode==s&&aO!=ab||aN!=J;return !aK}).bind("keypress.jsp",function(aN){if(aN.keyCode==s){aL()}return !aK});if(aA.hideFocus){E.css("outline","none");if("hideFocus" in an[0]){E.attr("hideFocus",true)}}else{E.css("outline","");if("hideFocus" in an[0]){E.attr("hideFocus",false)}}function aL(){var aO=ab,aN=J;switch(s){case 40:R.scrollByY(aA.keyboardSpeed,false);break;case 38:R.scrollByY(-aA.keyboardSpeed,false);break;case 34:case 32:R.scrollByY(w*aA.scrollPagePercent,false);break;case 33:R.scrollByY(-w*aA.scrollPagePercent,false);break;case 39:R.scrollByX(aA.keyboardSpeed,false);break;case 37:R.scrollByX(-aA.keyboardSpeed,false);break}aK=aO!=ab||aN!=J;return aK}}function S(){E.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function D(){if(location.hash&&location.hash.length>1){var aL,aK;try{aL=b(location.hash)}catch(s){return}if(aL.length&&Z.find(location.hash)){if(an.scrollTop()===0){aK=setInterval(function(){if(an.scrollTop()>0){ac(location.hash,true);b(document).scrollTop(an.position().top);clearInterval(aK)}},50)}else{ac(location.hash,true);b(document).scrollTop(an.position().top)}}}}function aj(){b("a.jspHijack").unbind("click.jsp-hijack").removeClass("jspHijack")}function n(){aj();b("a[href^=#]").addClass("jspHijack").bind("click.jsp-hijack",function(){var s=this.href.split("#"),aK;if(s.length>1){aK=s[1];if(aK.length>0&&Z.find("#"+aK).length>0){ac("#"+aK,true);return false}}})}function ap(){var aL,aK,aN,aM,aO,s=false;an.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(aP){var aQ=aP.originalEvent.touches[0];aL=aE();aK=aC();aN=aQ.pageX;aM=aQ.pageY;aO=false;s=true}).bind("touchmove.jsp",function(aS){if(!s){return}var aR=aS.originalEvent.touches[0],aQ=ab,aP=J;R.scrollTo(aL+aN-aR.pageX,aK+aM-aR.pageY);aO=aO||Math.abs(aN-aR.pageX)>5||Math.abs(aM-aR.pageY)>5;
return aQ==ab&&aP==J}).bind("touchend.jsp",function(aP){s=false}).bind("click.jsp-touchclick",function(aP){if(aO){aO=false;return false}})}function h(){var s=aC(),aK=aE();E.removeClass("jspScrollable").unbind(".jsp");E.replaceWith(aq.append(Z.children()));aq.scrollTop(s);aq.scrollLeft(aK)}b.extend(R,{reinitialise:function(aK){aK=b.extend({},aA,aK);au(aK)},scrollToElement:function(aL,aK,s){ac(aL,aK,s)},scrollTo:function(aL,s,aK){O(aL,aK);N(s,aK)},scrollToX:function(aK,s){O(aK,s)},scrollToY:function(s,aK){N(s,aK)},scrollToPercentX:function(aK,s){O(aK*(U-al),s)},scrollToPercentY:function(aK,s){N(aK*(aa-w),s)},scrollBy:function(aK,s,aL){R.scrollByX(aK,aL);R.scrollByY(s,aL)},scrollByX:function(s,aL){var aK=aE()+s,aM=aK/(U-al);X(aM*k,aL)},scrollByY:function(s,aL){var aK=aC()+s,aM=aK/(aa-w);W(aM*j,aL)},positionDragX:function(s,aK){X(s,aK)},positionDragY:function(aK,s){W(aK,s)},animate:function(aK,aN,s,aM){var aL={};aL[aN]=s;aK.animate(aL,{duration:aA.animateDuration,ease:aA.animateEase,queue:false,step:aM})},getContentPositionX:function(){return aE()},getContentPositionY:function(){return aC()},getContentWidth:function(){return U},getContentHeight:function(){return aa},getPercentScrolledX:function(){return aE()/(U-al)},getPercentScrolledY:function(){return aC()/(aa-w)},getIsScrollableH:function(){return aG},getIsScrollableV:function(){return aB},getContentPane:function(){return Z},scrollToBottom:function(s){W(j,s)},hijackInternalLinks:function(){n()},destroy:function(){h()}});au(P)}f=b.extend({},b.fn.jScrollPane.defaults,f);b.each(["mouseWheelSpeed","arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){f[this]=f[this]||f.speed});var e;this.each(function(){var g=b(this),h=g.data("jsp");if(h){h.reinitialise(f)}else{h=new d(g,f);g.data("jsp",h)}e=e?e.add(g):g});return e};b.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,stickToBottom:false,stickToRight:false,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:c,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:0,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:false,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:0.8}})(jQuery,this);
