var open_first = "1";
$(document).ready(function(){
 
 $("noscript#nojs").remove();
 
 /* menue */ 
 		$('ul#menue li a').hover(function(){
			$(this).stop().animate({paddingTop: '41px',	paddingBottom : '10px'}, 100);
		 }, function(){
			$(this).stop().animate({paddingTop: '51px',	paddingBottom : '0'}, 500);
		});
 
 /* start tooltip script */
 tooltip();
 /* tooltip bgrnd preload */
 $("a#home").after("<img src='_images/tooltip_bgrnd.png' alt='' width='1' height='1' /><img src='_images/tooltipbottom_bgrnd.png' alt='' width='1' height='1' />");
 
 /* suche */
 $("li#menue_suche fieldset input").click(function () {
		$(this).css({'background-color' : '#ffffff'});
  });
		
 /* -- home -- */ 
 $("div.more_content").hide();
 $("div.more_content").after("<h3 class='v-slider_trigger v-slider_trigger_home'><b>mehr Informationen</b><b style='display:none;'>weniger Informationen</b></h3>"); /* add open-close */ 
 
 
 $('.v-slider_trigger b').fadeTo(2500 , 0.3);
  $('.v-slider_trigger').hover(function(){
			$(this).find('b').stop().fadeTo(50 , 1.0);
		 }, function(){
			$(this).find('b').stop().fadeTo(1000 , 0.3);
		});
		
	/* zufallsbilder */
 $('#home_webdesign .slogan_top').prepend("<span class='rand_screen' style='display:none;'><span class='random_image' id='random_image-1'>&nbsp;</span><span class='random_image' id='random_image-2'>&nbsp;</span><span class='random_image' id='random_image-3'>&nbsp;</span><span class='random_image' id='random_image-4'>&nbsp;</span><span class='random_image' id='random_image-5'>&nbsp;</span><span class='random_image' id='random_image-6'>&nbsp;</span><span class='random_image' id='random_image-7'>&nbsp;</span><span class='random_image' id='random_image-8'>&nbsp;</span><span class='random_image' id='random_image-9'>&nbsp;</span><span class='random_image' id='random_image-10'>&nbsp;</span></span>");
 
 /* neueste projekte */
 $("#current_projects").load("_home_current_projects.html");
 
 /* gesund weg */
 $(".gmh").css({"text-indent" : "-5000px", "height" : "1px", "overflow" : "hidden" , "border-bottom" : "none"});
 
 
 
 $("div#home_webdesign .v-slider_trigger").click(function () {
				$("div#home_webdesign_more").slideToggle("fast");
				$(this).find("b").toggle();
		});	
 $("div#home_cms .v-slider_trigger").click(function () {
			$("div#home_cms_more").slideToggle("fast");
			$(this).find("b").toggle();
 }); 
 $("div#home_template .v-slider_trigger").click(function () {
		$("div#home_template_more").slideToggle("fast");
		$(this).find("b").toggle();
 }); 
 /* home cycle */
   $('.rand_screen').show();
   $('.rand_screen').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});

 
 /* #### demo galerie #### */
 $('ul.thumbs').addClass(' thumbsjs');
   $('div#gallery').show();
   $('span.nojs').show();
			// We only want these styles applied when javascript is enabled
			$('div.navigation').css({'width' : '300px', 'float' : 'left'});
			$('div.content').css('display', 'block');

			// Initially set opacity on thumbs and add
			// additional styling for hover effect on thumbs
			var onMouseOutOpacity = 1.0;
			$('#thumbs ul.thumbs li').css('opacity', 1.0)
				.hover(
					function () {
						$(this).not('.selected').fadeTo('fast', 0.7);
					},					
					function () {
						$(this).not('.selected').fadeTo('fast', 1.0);
					}
				);
				
				// Initialize Advanced Galleriffic Gallery
				var galleryAdv = $('#gallery').galleriffic('#thumbs', {
					delay:                  3000,
					numThumbs:              60,
					preloadAhead:           40,
					enableTopPager:         true,
					enableBottomPager:      true,
					imageContainerSel:      '#slideshow',
					controlsContainerSel:   '#controls',
					captionContainerSel:    '#caption',
					loadingContainerSel:    '#loading',
					renderSSControls:       true,
					renderNavControls:      true,
					playLinkText:           'Slideshow starten',
					pauseLinkText:          'Slideshow stoppen',
					prevLinkText:           '&lt; zur&uuml;ck',
					nextLinkText:           'vorw&auml;rts &gt;',
					nextPageLinkText:       '',
					prevPageLinkText:       '',
					enableHistory:          true,
					autoStart:              false,
					onChange:               function(prevIndex, nextIndex) {
						$('#thumbs ul.thumbs').children()
							.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
							.eq(nextIndex).fadeTo('fast', 1.0);
					},
					onTransitionOut:        function(callback) {
						$('#caption').fadeTo('fast', 0.0);
						$('#slideshow').fadeTo('fast', 0.0, callback);
					},
					onTransitionIn:         function() {
						$('#slideshow').fadeTo('fast', 1.0);
						$('#caption').fadeTo('fast', 1.0);
					},
					onPageTransitionOut:    function(callback) {
						$('#thumbs ul.thumbs').fadeTo('fast', 0.0, callback);
					},
					onPageTransitionIn:     function() {
						$('#thumbs ul.thumbs').fadeTo('fast', 1.0);
					}
				});
				
				
				/* ### slider vertical ### */
				$("div.v-slider_content").hide(); /* hide all content */
				/* $(".next-open_close_all").after("<p id='open_close_all'><a id='v-slider_open_all' class='v-slider_more_all_link tooltip' title='alles &ouml;ffnen'>&nbsp;</a><a id='v-slider_close_all' class='v-slider_more_all_link tooltip' title='alles schlie&szlig;en'>&nbsp;</a></p>");  add open-close-all */
				$(".v-slider_trigger").prepend("<p class='open_close_single'><a class='open_close_single open_single'>&nbsp;</a><a class='open_close_single close_single' style='display:none;'>&nbsp;</a></p>"); /* add open-close-single */
				$(".v-slider_trigger").addClass("open_close_bgrnd"); /* add bgrnd-class to open-close-single */
				/* alle open - close */
					$("a#v-slider_open_all").click(function () { /* open all */
								$("div.v-slider_content").slideDown("fast"); /* toggle */
						  $(".v-slider_trigger").find("p.open_close_single a.close_single").show(); /* show close */
						  $(".v-slider_trigger").find("p.open_close_single a.open_single").hide(); /* hide open */
						});
					$("a#v-slider_close_all").click(function () { /* close all */
								$("div.v-slider_content").slideUp("fast");
						  $(".v-slider_trigger").find("p.open_close_single a.close_single").hide(); /* hide close */
						  $(".v-slider_trigger").find("p.open_close_single a.open_single").show(); /* show open */
						});				
			/* open single */
				$(".v-slider_trigger").click(function () {
						/* accordion
						$("div.v-slider_content").slideUp("fast");
						$(".v-slider_trigger").find("p.open_close_single a.close_single").hide(); 
						$(".v-slider_trigger").find("p.open_close_single a.open_single").show(); 
						*/
						$(this).next("div.v-slider_content").slideToggle("fast");
						$(this).find("p.open_close_single a.open_close_single").toggle();
				});
				
if (open_first != '0') {
				/* open first */	
				/* demo */
			 $("body.demo div.v-slider_content:first").show();  /*	open first */
				$("body.demo .v-slider_trigger:first").find("p.open_close_single a.open_close_single").toggle(); /* toggle first open-close-single */
				/* webtools */
			 $("body.webtools div.v-slider_content:first").slideDown("slow");  /*	open first */
				$("body.webtools .v-slider_trigger:first").find("p.open_close_single a.open_close_single").toggle(); /* toggle first open-close-single */
				/* ueber uns */
			 $("body.dieagentur div.v-slider_content:first").slideDown("slow");  /*	open first */
				$("body.dieagentur .v-slider_trigger:first").find("p.open_close_single a.open_close_single").toggle(); /* toggle first open-close-single */
				/* blog */
			 $("body.weblogindex div.v-slider_content:first").slideDown("slow");  /*	open first */
				$("body.weblogindex .v-slider_trigger:first").find("p.open_close_single a.open_close_single").toggle(); /* toggle first open-close-single */
			 $("body.weblogtag div.v-slider_content:first").slideDown("slow");  /*	open first */
				$("body.weblogtag .v-slider_trigger:first").find("p.open_close_single a.open_close_single").toggle(); /* toggle first open-close-single */
};



/* kontakt */
 $("div.map_small").show(); 
 $("div#map").show();  
 $("div#map").css({'position' : 'absolute', 'left' : '-5000px'});
 $("div.map_small")
  .toggle(
  function() {
			$(this).fadeTo(500, 0.2);
   $("div#map").css({'position' : 'relative', 'left' : '0px'})
		},			
  function() { 
			$(this).fadeTo(500, 1.0);
   $("div#map").css({'position' : 'absolute', 'left' : '-5000px'})
		}
		); 
 
				
});

/* tooltip */
this.tooltip = function(){
 /* top */
	$(".tooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - -25) + "px")
			.css("left",(e.pageX + -5) + "px")
			.show();		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$(".tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - -25) + "px")
			.css("left",(e.pageX + -5) + "px");
	});
 
 /* bottom */
	$(".tooltipbottom").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltipbottom'>"+ this.t +"</p>");
		$("#tooltipbottom")
			.css("top",(e.pageY - 75) + "px")
			.css("left",(e.pageX + -7) + "px")
			.show();		
    },
	function(){
		this.title = this.t;		
		$("#tooltipbottom").remove();
    });	
	$(".tooltipbottom").mousemove(function(e){
		$("#tooltipbottom")
			.css("top",(e.pageY - 75) + "px")
			.css("left",(e.pageX + -7) + "px");
	});			
};



/* demo gallery */

// (c) 2008 Trent Foley
;(function($){var ver='galleriffic-1.0';var galleryOffset=0;var galleries=[];var allImages=[];var historyCurrentHash;var historyBackStack;var historyForwardStack;var isFirst=false;var dontCheck=false;var isInitialized=false;function getHashFromString(hash){if(!hash)return-1;hash=hash.replace(/^.*#/,'');if(isNaN(hash))return-1;return(+hash);}
function getHash(){var hash=location.hash;return getHashFromString(hash);}
function registerGallery(gallery){galleries.push(gallery);galleryOffset+=gallery.data.length;}
function getGallery(hash){for(i=0;i<galleries.length;i++){var gallery=galleries[i];if(hash<(gallery.data.length+gallery.offset))
return gallery;}
return 0;}
function getIndex(gallery,hash){return hash-gallery.offset;}
function clickHandler(e,gallery,link){gallery.pause();if(!gallery.settings.enableHistory){var hash=getHashFromString(link.href);if(hash>=0){var index=getIndex(gallery,hash);if(index>=0)
gallery.goto(index);}
e.preventDefault();}}
function historyCallback(){var hash=getHash();if(hash<0)return;var gallery=getGallery(hash);if(!gallery)return;var index=hash-gallery.offset;gallery.goto(index);}
function historyInit(){if(isInitialized)return;isInitialized=true;var current_hash=location.hash;historyCurrentHash=current_hash;if($.browser.msie){if(historyCurrentHash==''){historyCurrentHash='#';}}else if($.browser.safari){historyBackStack=[];historyBackStack.length=history.length;historyForwardStack=[];isFirst=true;}
setInterval(function(){historyCheck();},100);}
function historyAddHistory(hash){historyBackStack.push(hash);historyForwardStack.length=0;isFirst=true;}
function historyCheck(){if($.browser.safari){if(!dontCheck){var historyDelta=history.length-historyBackStack.length;if(historyDelta){isFirst=false;if(historyDelta<0){for(var i=0;i<Math.abs(historyDelta);i++)historyForwardStack.unshift(historyBackStack.pop());}else{for(var i=0;i<historyDelta;i++)historyBackStack.push(historyForwardStack.shift());}
var cachedHash=historyBackStack[historyBackStack.length-1];if(cachedHash!=undefined){historyCurrentHash=location.hash;historyCallback();}}else if(historyBackStack[historyBackStack.length-1]==undefined&&!isFirst){historyCallback();isFirst=true;}}}else{var current_hash=location.hash;if(current_hash!=historyCurrentHash){historyCurrentHash=current_hash;historyCallback();}}}
var defaults={delay:3000,numThumbs:20,preloadAhead:40,enableTopPager:false,enableBottomPager:true,imageContainerSel:'',captionContainerSel:'',controlsContainerSel:'',loadingContainerSel:'',renderSSControls:true,renderNavControls:true,playLinkText:'Play',pauseLinkText:'Pause',prevLinkText:'Previous',nextLinkText:'Next',nextPageLinkText:'Next &rsaquo;',prevPageLinkText:'&lsaquo; Prev',enableHistory:false,autoStart:false,onChange:undefined,onTransitionOut:undefined,onTransitionIn:undefined,onPageTransitionOut:undefined,onPageTransitionIn:undefined};$.fn.galleriffic=function(thumbsContainerSel,settings){$.extend(this,{ver:function(){return ver;},initializeThumbs:function(){this.data=[];var gallery=this;this.$thumbsContainer.find('ul.thumbs > li').each(function(i){var $li=$(this);var $aThumb=$li.find('a.thumb');var hash=gallery.offset+i;gallery.data.push({title:$aThumb.attr('title'),slideUrl:$aThumb.attr('href'),caption:$li.find('.caption').remove(),hash:hash});$aThumb.attr('rel','history');$aThumb.attr('href','#'+hash);$aThumb.click(function(e){clickHandler(e,gallery,this);});});return this;},isPreloadComplete:false,preloadInit:function(){if(this.settings.preloadAhead==0)return this;this.preloadStartIndex=this.currentIndex;var nextIndex=this.getNextIndex(this.preloadStartIndex);return this.preloadRecursive(this.preloadStartIndex,nextIndex);},preloadRelocate:function(index){this.preloadStartIndex=index;return this;},preloadRecursive:function(startIndex,currentIndex){if(startIndex!=this.preloadStartIndex){var nextIndex=this.getNextIndex(this.preloadStartIndex);return this.preloadRecursive(this.preloadStartIndex,nextIndex);}
var gallery=this;var preloadCount=currentIndex-startIndex;if(preloadCount<0)
preloadCount=this.data.length-1-startIndex+currentIndex;if(this.settings.preloadAhead>=0&&preloadCount>this.settings.preloadAhead){setTimeout(function(){gallery.preloadRecursive(startIndex,currentIndex);},500);return this;}
var imageData=this.data[currentIndex];if(!imageData)
return this;if(imageData.image)
return this.preloadNext(startIndex,currentIndex);var image=new Image();image.onload=function(){imageData.image=this;gallery.preloadNext(startIndex,currentIndex);};image.alt=imageData.title;image.src=imageData.slideUrl;return this;},preloadNext:function(startIndex,currentIndex){var nextIndex=this.getNextIndex(currentIndex);if(nextIndex==startIndex){this.isPreloadComplete=true;}else{var gallery=this;setTimeout(function(){gallery.preloadRecursive(startIndex,nextIndex);},100);}
return this;},getNextIndex:function(index){var nextIndex=index+1;if(nextIndex>=this.data.length)
nextIndex=0;return nextIndex;},getPrevIndex:function(index){var prevIndex=index-1;if(prevIndex<0)
prevIndex=this.data.length-1;return prevIndex;},pause:function(){if(this.interval)
this.toggleSlideshow();return this;},play:function(){if(!this.interval)
this.toggleSlideshow();return this;},toggleSlideshow:function(){if(this.interval){clearInterval(this.interval);this.interval=0;if(this.$controlsContainer){this.$controlsContainer.find('div.ss-controls a').removeClass().addClass('play').attr('title',this.settings.playLinkText).attr('href','#play').html(this.settings.playLinkText);}}else{this.ssAdvance();var gallery=this;this.interval=setInterval(function(){gallery.ssAdvance();},this.settings.delay);if(this.$controlsContainer){this.$controlsContainer.find('div.ss-controls a').removeClass().addClass('pause').attr('title',this.settings.pauseLinkText).attr('href','#pause').html(this.settings.pauseLinkText);}}
return this;},ssAdvance:function(){var nextIndex=this.getNextIndex(this.currentIndex);var nextHash=this.data[nextIndex].hash;if(this.settings.enableHistory)
location.href='#'+nextHash;else
this.goto(nextIndex);return this;},goto:function(index){if(index<0)index=0;else if(index>=this.data.length)index=this.data.length-1;if(this.settings.onChange)
this.settings.onChange(this.currentIndex,index);this.currentIndex=index;this.preloadRelocate(index);return this.refresh();},refresh:function(){var imageData=this.data[this.currentIndex];if(!imageData)
return this;var isTransitioning=true;var gallery=this;var transitionOutCallback=function(){isTransitioning=false;if(gallery.$controlsContainer){gallery.$controlsContainer.find('div.nav-controls a.prev').attr('href','#'+gallery.data[gallery.getPrevIndex(gallery.currentIndex)].hash).end().find('div.nav-controls a.next').attr('href','#'+gallery.data[gallery.getNextIndex(gallery.currentIndex)].hash);}
var imageData=gallery.data[gallery.currentIndex];if(gallery.$captionContainer){gallery.$captionContainer.empty().append(imageData.caption);}
if(imageData.image){gallery.buildImage(imageData.image);}else{if(gallery.$loadingContainer){gallery.$loadingContainer.show();}}}
if(this.settings.onTransitionOut){this.settings.onTransitionOut(transitionOutCallback);}else{this.$transitionContainers.hide();transitionOutCallback();}
if(!imageData.image){var image=new Image();image.onload=function(){imageData.image=this;if(!isTransitioning){gallery.buildImage(imageData.image);}};image.alt=imageData.title;image.src=imageData.slideUrl;}
this.relocatePreload=true;return this.syncThumbs();},buildImage:function(image){if(this.$imageContainer){this.$imageContainer.empty();var gallery=this;var nextIndex=this.getNextIndex(this.currentIndex);if(this.$loadingContainer){this.$loadingContainer.hide();}
this.$imageContainer.append('<span class="image-wrapper"><a class="advance-link" rel="history" href="#'+this.data[nextIndex].hash+'" title="'+image.alt+'"></a></span>').find('a').append(image).click(function(e){clickHandler(e,gallery,this);});}
if(this.settings.onTransitionIn)
this.settings.onTransitionIn();else
this.$transitionContainers.show();return this;},syncThumbs:function(){if(this.$thumbsContainer){var page=Math.floor(this.currentIndex/this.settings.numThumbs);if(page!=this.currentPage){this.currentPage=page;this.updateThumbs();}
var $thumbs=this.$thumbsContainer.find('ul.thumbs').children();$thumbs.filter('.selected').removeClass('selected');$thumbs.eq(this.currentIndex).addClass('selected');}
return this;},updateThumbs:function(){var gallery=this;var transitionOutCallback=function(){gallery.rebuildThumbs();if(gallery.settings.onPageTransitionIn)
gallery.settings.onPageTransitionIn();else
gallery.$thumbsContainer.show();};if(this.settings.onPageTransitionOut){this.settings.onPageTransitionOut(transitionOutCallback);}else{this.$thumbsContainer.hide();transitionOutCallback();}
return this;},rebuildThumbs:function(){if(this.currentPage<0)
this.currentPage=0;var needsPagination=this.data.length>this.settings.numThumbs;var $topPager=this.$thumbsContainer.find('div.top');if($topPager.length==0)
$topPager=this.$thumbsContainer.prepend('<div class="top pagination"></div>').find('div.top');if(needsPagination&&this.settings.enableTopPager){$topPager.empty();this.buildPager($topPager);}
if(needsPagination&&this.settings.enableBottomPager){var $bottomPager=this.$thumbsContainer.find('div.bottom');if($bottomPager.length==0)
$bottomPager=this.$thumbsContainer.append('<div class="bottom pagination"></div>').find('div.bottom');else
$bottomPager.empty();this.buildPager($bottomPager);}
var startIndex=this.currentPage*this.settings.numThumbs;var stopIndex=startIndex+this.settings.numThumbs-1;if(stopIndex>=this.data.length)
stopIndex=this.data.length-1;var $thumbsUl=this.$thumbsContainer.find('ul.thumbs');$thumbsUl.find('li').each(function(i){var $li=$(this);if(i>=startIndex&&i<=stopIndex){$li.show();}else{$li.hide();}});$thumbsUl.removeClass('noscript');return this;},buildPager:function(pager){var gallery=this;var startIndex=this.currentPage*this.settings.numThumbs;if(this.currentPage>0){var prevPage=startIndex-this.settings.numThumbs;pager.append('<a rel="history" href="#'+this.data[prevPage].hash+'" title="'+this.settings.prevPageLinkText+'">'+this.settings.prevPageLinkText+'</a>');}
for(i=this.currentPage-3;i<=this.currentPage+3;i++){var pageNum=i+1;if(i==this.currentPage)
pager.append('<span class="current">'+pageNum+'</span>');else if(i>=0&&i<this.numPages){var imageIndex=i*this.settings.numThumbs;pager.append('<a rel="history" href="#'+this.data[imageIndex].hash+'" title="'+pageNum+'">'+pageNum+'</a>');}}
var nextPage=startIndex+this.settings.numThumbs;if(nextPage<this.data.length){pager.append('<a rel="history" href="#'+this.data[nextPage].hash+'" title="'+this.settings.nextPageLinkText+'">'+this.settings.nextPageLinkText+'</a>');}
pager.find('a').click(function(e){clickHandler(e,gallery,this);});return this;}});this.settings=$.extend({},defaults,settings);if(this.interval)
clearInterval(this.interval);this.interval=0;if(this.settings.imageContainerSel)this.$imageContainer=$(this.settings.imageContainerSel);if(this.settings.captionContainerSel)this.$captionContainer=$(this.settings.captionContainerSel);if(this.settings.loadingContainerSel)this.$loadingContainer=$(this.settings.loadingContainerSel);this.$transitionContainers=$([]);if(this.$imageContainer)
this.$transitionContainers=this.$transitionContainers.add(this.$imageContainer);if(this.$captionContainer)
this.$transitionContainers=this.$transitionContainers.add(this.$captionContainer);this.offset=galleryOffset;this.$thumbsContainer=$(thumbsContainerSel);this.initializeThumbs();registerGallery(this);this.numPages=Math.ceil(this.data.length/this.settings.numThumbs);this.currentPage=-1;this.currentIndex=0;var gallery=this;if(this.$loadingContainer)
this.$loadingContainer.hide();if(this.settings.controlsContainerSel){this.$controlsContainer=$(this.settings.controlsContainerSel).empty();if(this.settings.renderSSControls){if(this.settings.autoStart){this.$controlsContainer.append('<div class="ss-controls"><a href="#pause" class="pause" title="'+this.settings.pauseLinkText+'">'+this.settings.pauseLinkText+'</a></div>');}else{this.$controlsContainer.append('<div class="ss-controls"><a href="#play" class="play" title="'+this.settings.playLinkText+'">'+this.settings.playLinkText+'</a></div>');}
this.$controlsContainer.find('div.ss-controls a').click(function(e){gallery.toggleSlideshow();e.preventDefault();return false;});}
if(this.settings.renderNavControls){var $navControls=this.$controlsContainer.append('<div class="nav-controls"><a class="prev" rel="history" title="'+this.settings.prevLinkText+'">'+this.settings.prevLinkText+'</a><a class="next" rel="history" title="'+this.settings.nextLinkText+'">'+this.settings.nextLinkText+'</a></div>').find('div.nav-controls a').click(function(e){clickHandler(e,gallery,this);});}}
historyInit();var hash=getHash();var hashGallery=(hash>=0)?getGallery(hash):0;var gotoIndex=(hashGallery&&this==hashGallery)?(hash-this.offset):0;this.goto(gotoIndex);if(this.settings.autoStart){setTimeout(function(){gallery.play();},this.settings.delay);}
setTimeout(function(){gallery.preloadInit();},1000);return this;};})(jQuery);

/* home cycle */
(function(D){var A="Lite-1.0";D.fn.cycle=function(E){return this.each(function(){E=E||{};if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;this.cyclePause=0;var I=D(this);var J=E.slideExpr?D(E.slideExpr,this):I.children();var G=J.get();if(G.length<2){if(window.console&&window.console.log){window.console.log("terminating; too few slides: "+G.length)}return }var H=D.extend({},D.fn.cycle.defaults,E||{},D.metadata?I.metadata():D.meta?I.data():{});H.before=H.before?[H.before]:[];H.after=H.after?[H.after]:[];H.after.unshift(function(){H.busy=0});var F=this.className;H.width=parseInt((F.match(/w:(\d+)/)||[])[1])||H.width;H.height=parseInt((F.match(/h:(\d+)/)||[])[1])||H.height;H.timeout=parseInt((F.match(/t:(\d+)/)||[])[1])||H.timeout;if(I.css("position")=="static"){I.css("position","relative")}if(H.width){I.width(H.width)}if(H.height&&H.height!="auto"){I.height(H.height)}var K=0;J.css({position:"absolute",top:0,left:0}).hide().each(function(M){D(this).css("z-index",G.length-M)});D(G[K]).css("opacity",1).show();if(D.browser.msie){G[K].style.removeAttribute("filter")}if(H.fit&&H.width){J.width(H.width)}if(H.fit&&H.height&&H.height!="auto"){J.height(H.height)}if(H.pause){I.hover(function(){this.cyclePause=1},function(){this.cyclePause=0})}D.fn.cycle.transitions.fade(I,J,H);J.each(function(){var M=D(this);this.cycleH=(H.fit&&H.height)?H.height:M.height();this.cycleW=(H.fit&&H.width)?H.width:M.width()});J.not(":eq("+K+")").css({opacity:0});if(H.cssFirst){D(J[K]).css(H.cssFirst)}if(H.timeout){if(H.speed.constructor==String){H.speed={slow:600,fast:200}[H.speed]||400}if(!H.sync){H.speed=H.speed/2}while((H.timeout-H.speed)<250){H.timeout+=H.speed}}H.speedIn=H.speed;H.speedOut=H.speed;H.slideCount=G.length;H.currSlide=K;H.nextSlide=1;var L=J[K];if(H.before.length){H.before[0].apply(L,[L,L,H,true])}if(H.after.length>1){H.after[1].apply(L,[L,L,H,true])}if(H.click&&!H.next){H.next=H.click}if(H.next){D(H.next).bind("click",function(){return C(G,H,H.rev?-1:1)})}if(H.prev){D(H.prev).bind("click",function(){return C(G,H,H.rev?1:-1)})}if(H.timeout){this.cycleTimeout=setTimeout(function(){B(G,H,0,!H.rev)},H.timeout+(H.delay||0))}})};function B(J,E,I,K){if(E.busy){return }var H=J[0].parentNode,M=J[E.currSlide],L=J[E.nextSlide];if(H.cycleTimeout===0&&!I){return }if(I||!H.cyclePause){if(E.before.length){D.each(E.before,function(N,O){O.apply(L,[M,L,E,K])})}var F=function(){if(D.browser.msie){this.style.removeAttribute("filter")}D.each(E.after,function(N,O){O.apply(L,[M,L,E,K])})};if(E.nextSlide!=E.currSlide){E.busy=1;D.fn.cycle.custom(M,L,E,F)}var G=(E.nextSlide+1)==J.length;E.nextSlide=G?0:E.nextSlide+1;E.currSlide=G?J.length-1:E.nextSlide-1}if(E.timeout){H.cycleTimeout=setTimeout(function(){B(J,E,0,!E.rev)},E.timeout)}}function C(E,F,I){var H=E[0].parentNode,G=H.cycleTimeout;if(G){clearTimeout(G);H.cycleTimeout=0}F.nextSlide=F.currSlide+I;if(F.nextSlide<0){F.nextSlide=E.length-1}else{if(F.nextSlide>=E.length){F.nextSlide=0}}B(E,F,1,I>=0);return false}D.fn.cycle.custom=function(K,H,I,E){var J=D(K),G=D(H);G.css({opacity:0});var F=function(){G.animate({opacity:1},I.speedIn,I.easeIn,E)};J.animate({opacity:0},I.speedOut,I.easeOut,function(){J.css({display:"none"});if(!I.sync){F()}});if(I.sync){F()}};D.fn.cycle.transitions={fade:function(F,G,E){G.not(":eq(0)").css("opacity",0);E.before.push(function(){D(this).show()})}};D.fn.cycle.ver=function(){return A};D.fn.cycle.defaults={timeout:4000,speed:1000,next:null,prev:null,before:null,after:null,height:"auto",sync:1,fit:0,pause:0,delay:0,slideExpr:null}})(jQuery)

		
