$(function() {
/*	
if ( firstpage == "1_0_0" && flash == "yes") { 
	
	//$("#wrapper").hide();	

$('#intro_layer_swf')
	.load(function(){
		$('#result').text('Flash is installed!');	
	}) 
	.error(function(){
		$('#result').text('Flash is not installed!');
	});
}
*/

// ##############################  INTRO Animation #####################################
//alert(firstpage);
//alert("Startseite - "+ firstpage +"  - Flash: - "+ flash +" - ");

// Startseite - mit Flash
// Preload FlashAnimation
  
if ( firstpage == "1_0_0" && flash == "yes") {	
	
$("body").css({"backgroundColor": "#b51334" }); 
$("#intro_preload_swf").show(); 
	
$.ajax({
	url: "../userfiles/flash/intro_flash_01.swf",	
	// url: "../site_de/site.php?kombi=1_0_0",	
	// cache: true,
	
	complete: function() {		
	// alert("Flash geladen!");
	
	$("#intro_preload_swf").hide();
	$("body").delay(1000).animate({"backgroundColor": "#FFFFFF" }, 8000);	  
	$("#intro_layer_swf").show();	
	$("#intro_layer_swf").delay(12000).fadeOut(1000);		
			
    }
    });

} //if  Startseite - mit Flash // ENDE !!!
	

// Startseite - kein Flash

if ( firstpage == "1_0_0" && flash == "no" && $.cookie('intro_viewed') == null )	{	
$("body").css({"backgroundColor": "#b51334" });
$("body").delay(1000).animate({"backgroundColor": "#FFFFFF" }, 4000);

$("#intro_layer_js").css({"display": "block" });

$("img.bg_white").delay(1000).fadeOut(3000);

$("img.intro_squares").delay(4000).fadeIn(2000);
$("img.bg_transp").delay(4000).fadeOut(3000);

$("img.intro_squares").animate({
	  "top": "+=30px",
	  "left": "+=0px",	
		width: 255,
		height: 255,
		"opacity": "0.8"
	}, 2000, function() {
    $("#intro_layer_js, img.intro_squares").fadeOut(1000);
	$("#intro_layer_js").css({"display": "none" });
  });

  
// Cookie setzen - nur einmal Intro Logo Clicked

// $.cookie ('intro_viewed', 'yes',{ expires: 7, path: '/site_de/site.php?kombi=1_0_0', domain: 'wlhdesign.de', secure: true });

$.cookie('intro_viewed', 'yes', { expires: 1, path: '/' });

// $.cookie('intro_viewed', null);  // loeschen
  
} //if  Startseite - kein Flash // Ende


}); // Ende Function	
