﻿
function onBefore(curr, next, options) {
		$('#header_overlay').fadeTo(500,.1); 
		$('#header_overlay2').fadeIn(1000);		
		$('#header_overlay3').fadeIn(1200);

 }
function onAfter(curr, next, options) { 
			
			$('#header_overlay2').fadeOut(1800);
			$('#header_overlay3').fadeOut(2000);
			$('#header_overlay').fadeOut(1800);
	
}

$(document).ready(function(){
FLIR.init( { path: './files/js/facelift/' } );
$("h1").each( function() { FLIR.replace(this, new FLIRStyle({ cFont:'helvetica_new', mode:'progressive',realFontHeight:true,fixBaseline:true})); } );
$("h2").each( function() { FLIR.replace(this, new FLIRStyle({ cFont:'helvetica_new'})); } );
	 $("#mainnavi").lavaLamp({
                fx: "easeinout",
                speed: 800/*,
                click: function(event, menuItem) {
                    return false;
                }*/
            });
		$('.social a').each(function(){
	if(!$(this).hasClass('current')){
	linktext = $(this).html();
	$(this).html('<span class="a">'+linktext+'<span class="hover">'+linktext+'</span></span>');
	}else{}
});
$('.social a').hover(function(){
if($('img',this).hasClass('mittig')){
$('.a',this).animate({'marginTop':'-22px'},200);
}else{
$('.a',this).animate({'marginTop':'-16px'},200);
}
},function(){
$('.a',this).animate({'marginTop':'0'},100);

}).find('.hover').css('padding-top','5px');


$('input:not(input[type=submit],input[type=reset]),textarea,select').focus(function(){
$(this).css({'background-color':'#fff','border-color':'#aa5f18','color':'#aa5f18'});
$(this).parent().parent().find('label').css({'color':'#000'});
}).blur(function(){
$(this).css({'background-color':'#fff','border-color':'#aa5f18','color':'#aa5f18'});
}).css({'background-color':'#fff','border-color':'#aa5f18','color':'#aa5f18'});

$('#slideshow').cycle({fx:'fade', speed:3000,timeout:10000, cleartype:true,before: onBefore,  after:   onAfter}).parent().append('<div id="header_overlay"><img src="files/images/play_lounge_header_floral_01.png" class="png"  alt="" /></div><div id="header_overlay2"><img src="files/images/play_lounge_header_floral_02.png" class="png"  alt="" /></div><div id="header_overlay3"><img src="files/images/play_lounge_header_floral_03.png" class="png"  alt="" /></div>');

$('.toggle legend').toggle(function(){
	$(this).next().fadeIn();
	$(this).css({'background':'url(files/images/icon_open.gif) no-repeat 0 0','padding-left':'20px'});
	$(this).parent().addClass('open');
},
function(){
	$(this).next().fadeOut();
	$(this).parent().removeClass('open');
	$(this).css({'background':'url(files/images/icon_close.gif) no-repeat 0 0','padding-left':'20px'})
}
);
$('.open legend').css({'background':'url(files/images/icon_open.gif) no-repeat 0 0','padding-left':'20px'});
$('.toggle:not(.open)').find('legend').css({'background':'url(files/images/icon_close.gif) no-repeat 0 0','padding-left':'20px'}).next().hide();
$('.toggle legend').hover(function(){
$(this).css({'color':'#ff9000','cursor':'pointer'});
},
function(){
$(this).css({'color':'#aa5f18','cursor':'pointer'});
});



})

