/**
 * 
 */
$(document).ready(function() {
	$("#footer").width($(window).width());					   
	//$('img').load(function() {
	   toggleZoomer();
       setTimeout("$('div.zoom img').animate({ 'opacity' : '1.00', 'width' : '600px', 'height' : '200px' },4200);",100);
 //   });						   
	
	if (document.getElementById('menu')) {					   
		$('#menu').menu({
				subWidth: 100,
				subHeight: 25,
				subClass: 'sub',
				subBorderStyle: '1px solid #CCCCCC',
				subBackColor: '#FFFFFF',
				linkPadding: '10px 0px 0px 0px',
				topPosition: 16,
				leftPosition: 0,
				showAction: 'slide',
				speed: 200
		});						   
	}
	if (document.getElementById('langmenu')) {	
		$("#langmenu li").mouseover(function() {
			$(this).css("background-color","#DEDEDE");
		});	
		$("#langmenu li").mouseout(function() {
			$(this).css("background-color","#FFF");
		});					   
		$('#langmenu').menu({
				subWidth: 80,
				subHeight: 16,
				subClass: 'sub',
				subBorderStyle: '1px solid #CCCCCC',
				subBackColor: '#FFFFFF',
				linkPadding: '0px 0px 0px 0px',
				topPosition: 29,
				leftPosition: -5,
				showAction: 'slide',
				speed: 200
		});						   
	}	
	$('div.button, div.buttonActive').click(function() {
		if ($('#save').attr('checked') == true) {
			$('#save').attr('checked', false);
			$(this).attr('class', 'button');
		} else {
			$('#save').attr('checked', true);
			$(this).attr('class', 'buttonActive');
		}
	});
	
	$('#footerTrigger').click(function() {
		toggleFooterMenu();
	});
});

function showLangMenu(target, trigger)
{
	$('.leftMenu li a').removeClass('active');
	trigger.addClass('active');
	$('.rightMenu,.officeselect').hide();
	$('#' + target).fadeIn(500);
}

function showOfficeMenu(target, trigger)
{
	$('.officeselect li a').removeClass('active');
	trigger.addClass('active');
	$('.rightMenu').hide();
	$('#' + target).fadeIn(500);
}

function toggleFooterMenu()
{
	var footerWidth = $('#filler').width();
	
	if(footerWidth > 100) {
		$('#filler').animate({
			'width' : '50px'
		}, 1000);
		setTimeout('$("#overlay").fadeOut(500);',1000);
	} else {
		$('#filler').animate({
			'width' : '800px'
		}, 1000);	
	}
}

function toggleZoomer()
{
	var footerZoomWidth = $("div.zoomer div.zoom img").width();
	var biggerZoom = 690;
	$("div.zoomer div.zoom img").width(biggerZoom);	
	$("div.zoomer div.zoom img").height(230);		
}

function loadPageIn(elem,div,url)
{
	var val = document.getElementById(elem).value;
	url = url + val;
	loadPage(url,div);
}

function loadPageInJobs(url,id)
{
	location.href=url + document.getElementById(id).value;
}

function loadPageInNews(url,id)
{
	location.href=url + document.getElementById(id).value;	
}

function loadPage(url,div)
{
 	jQuery('#' + div).fadeOut(10);
	jQuery.get(url, function(data) {
	  jQuery('#' + div).html(data);
	  jQuery('#' + div).fadeIn(500);
	});
	
}

function openkaart(pagina,title) {
	window.open(pagina,title,'top=100,left=50,toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=550,height=300');
	return void(0);
}
