if (($('.thirdMenu').html()) > '') {
	$('.innerContent').css({'width':'540px', 'margin-left':'130px'});
	$('.thirdMenu').fadeIn(100);
	$('.thirdMenu').css('position','absolute');
};

$('.menuButton').click(function(){
	if ($(this).next('.menucontent').hasClass('openmenu') == false) {
		$('.button').removeClass('activeButton');
		$(this).addClass('activeButton');
		$('.menucontent').removeClass('openmenu').slideUp(400);
		$(this).next('.menucontent').slideDown(400).addClass('openmenu');
	} 
	else{
		return false
	};
});

$('.buttonWinter').click(function(){
	if (($(this).hasClass('closedButton')) == true) {
		$('.menuWinter').slideDown(200);
		$(this).removeClass('closedButton')
	} 
	else{
		window.location.href = 'http://www.sport-brugger.at/skiverleih/ski-boots.html';
	};
});

$('.buttonSommer').click(function(){
	if (($(this).hasClass('closedButton')) == true) {
		$('.menuSommer').slideDown(200);
		$(this).removeClass('closedButton')
	} 
	else{
		window.location.href = 'http://www.sport-brugger.at/soelden-tirol/wandern.html';
	};
	
});

$('.buttonSki').click(function(){
	if (($(this).hasClass('closedButton')) == true) {
		$('.menuSki').slideDown(200);
		$(this).removeClass('closedButton')
	} 
	else{
		window.location.href = 'http://www.sport-brugger.at/skiverleih-soelden.html';
	};
});

$('.closeSommer').click(function(){
	$('.menuSommer').slideUp(300);
	$('.buttonSommer').addClass('closedButton')
});
$('.closeWinter').click(function(){
	$('.menuWinter').slideUp(300);
	$('.buttonWinter').addClass('closedButton')
});
$('.closeSki').click(function(){
	$('.menuSki').slideUp(300);
	$('.buttonSki').addClass('closedButton')
});


$('.videoTrigger').click(function(){
	$(this).fadeOut(200);
	$('.video').css('display', 'block');
	$('.videoplayer').html('<iframe width="560" height="315" src="http://www.youtube.com/embed/DdP54T89mrU" frameborder="0" allowfullscreen></iframe>');
	$('.video').animate({
	    top: '100'
	  }, {duration: 300, easing: 'easeOutBack'}, function() {
	  });
});

$('.closeVideo').click(function(){
	$('.videoTrigger').delay(700).fadeIn(500);
	$('.videoplayer').html('');
	$('.video').animate({
	    top: '-450'
	  }, {duration: 300, easing: 'easeInBack'}, function() {
	    $('.video').css('display', 'none');
	  });
});


$('.radioTrigger').click(function(){
	newwindow=window.open('http://www.shoutcast.com/shoutcast_popup_player?station_id=1415249&play_status=1&stn=181.FM%20-%20The%20Buzz%20(Your%20Alternative%20Stat','name','height=100,width=400');
		if (window.focus) {newwindow.focus()}
		return false;
});

$(".showmore").toggle(
  function(){
	$('#subMenuAct a').css('cursor', 'default');
	var h1link1 = ($('.boxFirst h1 a').attr('href'));
	$('.boxFirst').append('<div class="morelink"><a href="'+h1link1+'" target="_self">more <img src="fileadmin/img/right.png" /></div>');
	var h1link2 = ($('.boxSecond h1 a').attr('href'));
	$('.boxSecond').append('<div class="morelink"><a href="'+h1link2+'" target="_self">more <img src="fileadmin/img/right.png" /></div>');
	var h1link3 = ($('.boxThird h1 a').attr('href'));
	$('.boxThird').append('<div class="morelink"><a href="'+h1link3+'" target="_self">more <img src="fileadmin/img/right.png" /></div>');
	
    $(this).html('less <img src="fileadmin/img/minus.png" alt="" />');
	$('.homebottom').animate({
	   bottom: '-230'
	  }, {duration: 400, easing: 'easeOutBack'}, function() {
	    $('.video').css('display', 'none');
	  });
	
  },
  
  function(){
    $(this).html('show more <img src="fileadmin/img/plus.png" alt="" />');
	$('.homebottom').animate({
	   bottom: '-685'
	  }, {duration: 700, easing: 'easeOutBounce'}, function() {
	    $('.video').css('display', 'none');
	  });
	
  }

);
$(".toggleContent").toggle(
  function(){
    $(this).html('show more <img src="fileadmin/img/plus.png" alt="" />');
	$('.bottom').fadeOut(200);
	$(this).animate({
	   top: '60',
		opacity: '0.5'
	  }, {duration: 700, easing: 'easeOutQuint'}, function() {
	    $('.video').css('display', 'none');
	  });
  },
  
  function(){
    $(this).html('show less <img src="fileadmin/img/minus.png" alt="" />');
	$('.bottom').fadeIn(500);
	$(this).animate({
	   top: '115'	,
			opacity: '1.0'
	  }, {duration: 700, easing: 'easeOutQuint'}, function() {
	    $('.video').css('display', 'none');
	  });
	
  }

);




$('#wetterbox').click(function(){
	$('.wetterBigBox').fadeIn(500);
});
$('#wetterbox').mouseleave(function(){
	$('.wetterBigBox').fadeOut(400);
});

$('#subMenuAct a').click(function(){
	return false
});
$('.lang .sprache:nth-child(1)').fadeIn(100);
$('.lang').mouseenter(function(){
	$(this).stop(true, true).animate({
	   height: '170'
	  }, {duration: 700, easing: 'easeOutQuint'}, function() {
	  });
	
	$('.lang').children('.sprache').fadeIn(200);
});
$('.lang').mouseleave(function(){
	$(this).stop(true, true).animate({
	   height: '40'
	  }, {duration: 700, easing: 'easeOutQuint'}, function() {
	  });
	$('.lang').children('.sprache').fadeOut(200);
	$('.lang .sprache:nth-child(1)').fadeIn(10);
});

$(document).ready(function(){

$('.preistabelle .td-0:contains("4*")').append('<div class="starBox">&#9733&#9733&#9733&#9733</div>');
$('.preistabelle .td-0:contains("5*")').append('<div class="starBox">&#9733&#9733&#9733&#9733&#9733</div>');
$('.preistabelle .td-0:contains("6*")').append('<div class="starBox">&#9733&#9733&#9733&#9733&#9733&#9733</div>');
$('.preistabelle .td-0:contains("7*")').append('<div class="starBox">&#9733&#9733&#9733&#9733&#9733&#9733&#9733</div>');
	
});
