$(document).ready(function(){

	/* dimensions 
	var wHeight = 0;
	if (document.documentElement) {
		wHeight = document.documentElement.offsetHeight;
	} else if (window.innerWidth && window.innerHeight) {
		wHeight = window.innerHeight;
	}
	if (wHeight < 655 ) {
		$('#wrapper').css({
			'position': 'relative', 
			'top': 0, 
			'left': 0, 
			'margin': '10px auto'
		})
	}
*/
	
	/*	Fade-In  */   
    $("#content").hide();
    $("#content").fadeIn('slow');
    $("#galerie_cycle").hide();
    $("#galerie_cycle").fadeIn('slow');
	   
	/* Disable/Hide Links */
    $("a.hidden").hide();
    $('a.disabled').click(function(event){				
	   event.preventDefault();
	});

	/*	Hauptnavigation	  */
	$("ul#nav_main").superfish({
		animation : { height:"show"}
	}).find(">li:has(ul)").mouseover(function(){
		$("ul", this).bgIframe({opacity:false});
	}).find("a").focus(function(){
		$("ul", $("#nav_main>li:has(ul)")).bgIframe({opacity:false});
	});
	
	
	/*  colorbox  */
	$("a[rel='galerie']").colorbox({
		height:"670px",
		width:"920px",
		scalePhotos: false,
		current: "Bild {current} von {total}"
	});
	$("a.openInquiryForm").colorbox({
		width:"920px", 
		height:"670px", 
		iframe:true
	});

	/*  slideshow cycle-plugin  */
	$('#header_cycle').cycle({ 
		 fx:     'fade', 
		 speed:   500, 
		 timeout: 0, 
		 next:  '#header_cycle_next' 
	});
	$('#galerie_cycle').cycle({ 
		 fx:     'fade', 
		 speed:   500, 
		 timeout: 3000,
		 pause:   1,
		 next:    '#galerie_cycle_next', 
		 prev:    '#galerie_cycle_prev' 
	});
	$('#content .cycle').cycle({ 
		fx:     'fade', 
	    speed:   500, 
	    timeout: 3000, 
	    next:   '#content .cycle', 
	    pause:   1 
	});
	
});
