// krueger dirndl - general.js

 // Set JQuery in Compatibility Mode
 jQuery.noConflict();
 
/*
 *	DOCUMENT LOADED
 */
 jQuery(document).ready(function(){
	
		jQuery.fn.supersized.options = {  
				startwidth: 1857,  
				startheight: 1239,
				vertical_center: 0,
				slides : [
					{image : 'http://www.krueger-dirndl.de/fileadmin/templates/default/intro/intro.jpg' }
				]
		};
	     jQuery('#supersized').supersized(); 
		
		// add resize btn
		jQuery("#intro-content").append('<span class="resize-btn">&nbsp;</span>');
		
		jQuery(".resize-btn").click(function() {
			toggleConent();
		});
		
		// intro effects
		jQuery("#intro-content").hide();
		jQuery("#intro-content").css("top","40%");
		jQuery(".intro-bottom").hide();
		jQuery("#intro-content").height("70"); 
		//jQuery("#intro-content-inner").height("30"); 
		
		// fade field in
		jQuery("#intro-content").delay("10").fadeIn("slow");
		
		// show whole field
		//jQuery("#intro-content-inner").delay("5000").animate({height:'460px'}, 3000 );
		jQuery("#intro-content").delay("1000").animate({height:'315px',top:"20%"}, 2000, function() {
    			jQuery(".intro-bottom").fadeIn("slow");
		});
  		
		function toggleConent() {
			if (jQuery("#intro-content").height() > 70 && jQuery("#intro-content").height() != 315) {
				// transforming at the moment
				return false;	
			} else if(jQuery("#intro-content").height() == 70) {
				// show
				//jQuery("#intro-content-inner").animate({height:'460px'}, 3000 );
				jQuery("#intro-content").animate({height:'315px',top:"20%"}, 2000, function() {
    				jQuery(".intro-bottom").fadeIn("slow");
				});	
			}
			 else if(jQuery("#intro-content").height() == 315) {
				// hide
				jQuery(".intro-bottom").hide();
				//jQuery("#intro-content-inner").animate({height:'30px'}, 3000 );
				jQuery("#intro-content").animate({height:'70px',top:"40%"}, 2000);	
			}
		}

		 
		
 });
