// JavaScript Document


function telkontakt()
	{
		Name = escape(document.getElementById('formName').value);
		Telefon = escape(document.getElementById('formTelefon').value);
		Link	= "tel_kontakt.php?name=" + Name + "&telefon=" + Telefon;
		if(Name > "" && Telefon > "") {
			if(Name != "Name%20eingeben" && Telefon != "Telefonnummer%20eingeben") {
				window.open(Link, 'Kontakt','scrollbars=no,resizable=no,width=200,height=160');
			}
		}
	}

$('.milieuEinklinker').corner("15px tr tl");

$(document).ready(function() {
	//$('a[rel=lightbox]').css('border','1px solid red');
	//$('a[rel=lightbox]').lightBox(); 
	$('a[rel^=lightbox]').lightBox();

	$('<img class="scrollButtons right" src="typo3conf/ext/kiwi_slider/pi1/res/scroll_right.png">').click();
	$('<img class="scrollButtons right" src="typo3conf/ext/kiwi_slider/pi1/res/scroll_right.png">').css('border','1px solid red');
	$('.tx-kiwislider-pi1 .milieuEinklinker').each(function() {
		$(this)
			.css( {bottom: "-280px"} )
			.click(function(){
				$(this).stop().animate({bottom:"-8px"}, 200, function() 
				{ 
					$(this).children(".contentHeader").stop().hide(100); 
					$(this).children(".contentHeaderArrow").stop().hide(100);					
          $(this).unbind('click'); 
				});
			})
	});
	
	$('.tx-kiwislider-pi1 .contentHeaderClose').each(function() {
	 	$(this)			
			.click(function(){
				$(this).parent('.milieuEinklinker').stop().animate({bottom:"-280px"}, 200, function() 
				{ 
					$(this).children(".contentHeader").stop().show(100); 
					$(this).children(".contentHeaderArrow").stop().show(100);
					                 $('.tx-kiwislider-pi1 .milieuEinklinker').each(function() {
                          		$(this)
                          			.css( {bottom: "-280px"} )
                          			.click(function(){
                          				$(this).stop().animate({bottom:"-8px"}, 200, function() 
                          				{ 
                          					$(this).children(".contentHeader").stop().hide(100); 
                          					$(this).children(".contentHeaderArrow").stop().hide(100);					
                                    $(this).unbind('click'); 
                          				});
                          			})
                          	});
           
				}); 
			})
	});
	
	
	// ########################
	// Breite Box
	// ########################
	$('div.box1_Einklinker').each(function() {
		$(this)
			.css( {top: "-280px"} )
			.click(function(){
				$(this).stop().animate({top:"-8px"}, 200, function() 
				{ 
					$(this).children(".contentHeader").stop().hide(50); 
					$(this).children(".contentHeaderArrow").stop().hide(100);
					$(this).children(".content").stop().show(100);
           $(this).unbind('click');
				});
			})
			
	});
	$('.contentHeaderClose').each(function() {
		$(this)
			.click(function(){		    	
				$(this).parent(".box1_Einklinker").animate({top:"-280px"}, 200, function() 
				{            
          $(this).children(".contentHeader").stop().show(100); 
					$(this).children(".contentHeaderArrow").stop().show(100);
					$(this).children(".content").stop().hide(100);
          $('div.box1_Einklinker').each(function() {
          		$(this)
          			.css( {top: "-280px"} )
          			.click(function(){
          				$(this).stop().animate({top:"-8px"}, 200, function() 
          				{ 
          					$(this).children(".contentHeader").stop().hide(50); 
          					$(this).children(".contentHeaderArrow").stop().hide(100);
          					$(this).children(".content").stop().show(100);
                     $(this).unbind('click');
          				});
          			})
          			
          	}); 
           
				});
			})
			
	});
	// #########################
	// Bildergalerie	
	//##########################
	/*$('.box4_mouseover').each(function() {
		$(this)		  
			.click(function(){							
			     	
           $(this).parents('.box4_inner').next('.boxlightbox').stop().show(100);
		   $('#sbOverlay').show();
			     
			})
			
	});
	
	$('.boxlightbox .contentHeaderClose').each(function() {
	  $(this)		  
			.click(function(){ 
				 $('#sbOverlay').hide();
			     $(this).parents('.boxlightbox').stop().hide(100);			
			})
			
	});
	
	$('#sbOverlay').each(function() {
	  $(this)		  
			.click(function(){ 
				 $('#sbOverlay').hide();
			     $('.boxlightbox').each(
				function() {
					$(this).hide();
					})			
			})
			
	});
	*/
	//##########################
	// Sofa Lila Weiß
	//##########################
	
	$('.sofa, .sofa .bubble').each(function() {
	  $(this)		  
			.mouseenter(function(){            
			     $(this).children('.bubble').show(10);			
			})
			.mouseleave(function(){            
			     $(this).children('.bubble').hide(10);			
			})
			
	});
	// ########################
	
	
	$('div.menuItem').each(function() {
	
		$(this).mouseenter(function() {
			$(this).children('div').show(100);
		});
		$(this).mouseleave(function() {
			$(this).children('div').hide(100);
		});		
	
	});
	
	
	
//##### Öffnungszeitenbanner ##############

	$('#opencloseBanner').mouseover(function() {
	  $('#opencloseCloud').show(200);
	});
	
	$('#opencloseCloud').mouseleave(function() {
	  $('#opencloseCloud').hide(200);
	});
	
//##### Kontakt und Anfahrtsbanner ##############

	$('#approachBanner').mouseover(function() {
	  $('#approachCloud').show(200);
	});
	$('#approachCloud').mouseleave(function() {
	  $('#approachCloud').hide(200);
	});
	
	
	
	
	
	
});


function show(rueber) {
	$("#"+rueber).show(200);
}

function hide(rueber) {
	$("#"+rueber).hide(200);
}


