function move_subs(branch_id)
{  
	var pos = $("#row-" + branch_id).position().top - 0;
	$('#sublevels ul').css("top", pos);
}

function center_banner()
{
	var pos = $(".container").offset();  
	var width = $(".container").width() / 2 - 60;
	  
	//show the menu directly over the placeholder
	$("#banner").css( { "left": (pos.left + width) + "px", "top":pos.top + "px" } );
	$("#banner").show();
}

$(document).ready(function()
{ 
	// Colorbox, sell/buy-form
	$("a[rel='colorbox']").colorbox({width:"400px", height:"600px", iframe:true, rel:"nofollow"});

	// Slideshow top left
	$("#MySlideShow").cjSimpleSlideShow({delay: 10000});

	// Navigation
	$('#main-levels ul li').hover(function () 
	{ 
		$(this).addClass('hover');   
	}, 
	function () {
		$(this).removeClass('hover');  
	}); 
    
	/*
	$('.popup input').click(function()
	{
		$('.over').css('display', 'none');
	}); 
  
	$('.hover-btn').hover(function () 
	{ 
		$(this).stop().animate({opacity: 1}, "slow");   
	}, 
	function () 
	{
		$(this).stop().animate({opacity: 0.7}, "slow");   
	});
  */ 
  $(window).resize(function() {
	  center_banner();
	});

  center_banner();

  // Banner frontpage
	$('#banner-ending a').toggle(
		function()
		{
			$('#banner-content').animate({height: '+=250'}, 500, function() 
			{ 
				$('#banner-more-content').fadeIn(500) 
			});         
		},
		function()
		{
			$('#banner-more-content').fadeOut(500);
			$('#banner-content').animate({height: '-=250'});
		}); 
	})