jQuery.fn.exists = function(){return jQuery(this).length>0;}

$(window).load(function(){
var mt=0;
var h=225;


	var len=$('.offer-cont').children().length*h*-1;
	$('.bbox .offer-itms').css('height',h+'px')
	.css('overflow','hidden');
	$('.right .itm').css('height',h+'px')
	$('#exarrival').datepicker();	
	$('#exdeparture').datepicker();
	$('#po').click(function(){

		
		
		$(this).attr('href','javascript:;');
		if(mt!=0){
			mt+=h ;
			$('.offer-cont').animate({'marginTop':mt})
		}	
	})
	$('#no').click(function(){

		$(this).attr('href','javascript:;');
		if((mt-h) > len){
			mt-=h;
			$('.offer-cont').animate({'marginTop' : mt})	
		}
	})
	
if($('.wrap .center .nav').exists())
	$('.wrap .center .nav').hide();
			 $('.nchannel').hover(function(){ $('.nchannel-content',this).slideDown(); },function(){  $('.nchannel-content',this).slideUp();  });
if ($("*").is(".jqfancybox")) { 
						$(".jqfancybox").fancybox({
							"padding": 0,
							"speedIn": 300,
							"speedOut": 300,
							"changeSpeed": 300,
							"transitionIn": "elastic",
							"transitionOut": "elastic",
							"titlePosition": "over",
							"titleShow": true,
							"easingIn": "swing",
							"easingOut": "swing",
							"showCloseButton": true,
							"showNavArrows": true,
							"enableEscapeButton": true,
							"overlayShow": true,
							"overlayOpacity": 0.4,
							"overlayColor": "#666",
							"centerOnScroll": false,
							"hideOnContentClick": true,
							"onComplete"		 :	function() {
														$("#fancybox-wrap").hover(function() {
															$("#fancybox-title").show();
														}, function() {
															$("#fancybox-title").hide();
														});
												 	},  "titleFormat": function(title, currentArray, currentIndex, currentOpts) { return '<span id="fancybox-title-over">Bild ' + (currentIndex + 1) + ' von ' + currentArray.length + (title.length ? ' : &nbsp; ' + title : '') + '</span>';}
				});
			 } 

}
)
$(document).ready(function(){

$('.headerslide').cycle({ timeout:10000});
$('.nchannel-content').hide();


	

	
})
