var flashObject;

var flashvars = {

	header: 'images/pic.jpg',

	logolinks: 'images/logo_links.png',

	koffie: 'images/koffie.png',

	textspeed: 20,			// # of pixels to move to the right every 35 miliseconds. Decimals allowed, lower then 1 not recommended.

	scrollspeed: 10, 		// # of pixels to move to the left/right every 35 miliseconds in the product scroller. 

					 		// If your mouse is located all the way left of the scroller, the scroller moves 100% of 

					 		// this value to the left. If your mouse is around 50% the scroller moves at 10% value of this speed.

	scrollbarBottom: 20,	// # of pixels the between the scrollbar and the top of the menu.

	scrollbarAlphaActive: 1,	// Alpha level of the scrollbar when active (scrollable). Values from 0 (invisible) to 1 (opaque)

	scrollbarAlphaInactive: 0.2, // Alpha level of the scrollbar when inactive (product focus). Values from 0 (invisible) to 1 (opaque)

	productFocusSpeed: 250, // # of avg miliseconds to use for moving the product in focus and back.

							//	Recommended to use a fast (low) value...

	productDetailRight: 0,	// # of pixels the product in focus is moved from the right, based on the scroller's position and width.

	productDetailBottom: 20	// # of pixels the product in focus is moved from the bottom, based on the scroller's position and height.

	

};

var params = {

	menu: "false",

	scale: "noScale"

};

if (document.all) {

	swfobject.embedSWF("UpTo.swf", "header", "100%", "305", "9.0.0", "expressInstall.swf", flashvars, params);

} else {

	$(document).ready(function() {

		$('#header').flash({

			src: 'UpTo.swf',

			width: '100%',

			height: 305,

			flashvars: flashvars

		});	

	});

}



var loading = false;

function flashInit() {

	$('#header .alt').hide();

	if (!document.all) {

		flashObject = document.embeds[0];

	} else {

		flashObject = document.getElementById('header');

	}

	

	$('a[type=flashlink]').each(function() {

		$(this).click(function() {

			if (loading == false) {

				loading = true;

				goto($(this).attr('link'));

				$('#menu ul li a.actief').removeClass('actief');

				$(this).addClass('actief');

			}

		});

		flashObject.addFilename($(this).attr('link'), $(this).html(), ($(this).attr('productslider') == 'true' ? true : false));

	});

	

	$('a[type=flashproduct]').each(function() {

		flashObject.addProduct($(this).attr('link'), $(this).attr('thumb'), $(this).html(), $(this).attr('width'), $(this).attr('height'));

	});

	

	$('a[type=flashproductinfo]').each(function() {

		flashObject.addProductInfo($(this).attr('link'), $(this).attr('thumb'), $(this).html(), $(this).attr('width'), $(this).attr('height'));

	});

	

	//goto("nl/products.php");

}



function goto(loc,manual) {
	
	if (manual == true) {
		
		$('#menu ul li a').each(function() {
			$(this).removeClass('actief');
			if ($(this).attr('link') == loc) {
				$(this).addClass('actief');
			}
		});
		
	}

	if (loc.indexOf('home') != -1) {

		$('body').removeClass('vervolg');

	} else {

		$('body').addClass('vervolg');

	}

	if (flashObject) {

		flashObject.goto(loc);

	}

}



String.prototype.repeat = function(l){

	return new Array(l+1).join(this);

};

$(function() {
	$('#balk').css('width',$('#taalversies').width()-$('#actief').width());
});

$(window).resize(function() {
 	$('#balk').css('width',$('#taalversies').width()-$('#actief').width());
});

var collapse=false;
function show_tv() {
	
	if(collapse==false) {
	 	$('#balk').animate({
			width: $('#taalversies').width()-$('#actief').width()-$('#selectie').width()
	  	},1000);
		collapse=true;
	} else {
		
		$('#balk').animate({
			width: $('#taalversies').width()-$('#actief').width()
	  	},1000);
		collapse=false;
	}
	 

	
}

function loadPage(loc) {
	$('#preloader').show();
	$('#content').html("");

	$('#content').load('pages/'+loc, function() { 
		$('#preloader').hide(); 
		loading = false; 
		$('.slideshow').cycle({
			fx: 'fade',
			speed:    3000, 
		    timeout:  100 
		});
	});

}
