
// JavaScript Document

function hideIntro()
{
	document.getElementById('stitch').style.display='none';
}

$(document).ready(function() {						   
	$("#kroonimage_1").mouseover(function() {
		$(document).toonkroon(1);
	});	
	$("#kroonimage_1").mouseout(function() {
		$(document).hidekroon(1);
	});
	$("#kroonimage_2").mouseover(function() {
		$(document).toonkroon(2);
	});	
	$("#kroonimage_2").mouseout(function() {
		$(document).hidekroon(2);
	});	
	$("#kroonimage_3").mouseover(function() {
		$(document).toonkroon(3);
	});	
	$("#kroonimage_3").mouseout(function() {
		$(document).hidekroon(3);
	});
	$("#kroonimage_4").mouseover(function() {
		$(document).toonkroon(4);
	});	
	$("#kroonimage_4").mouseout(function() {
		$(document).hidekroon(4);
	});	
	$(document).initialize();		
 });

$.fn.showHelp = function() {
	$("#help").fadeIn(500);
}

$.fn.initialize = function() {

	var so = new SWFObject("flsSource/intro.swf", "stitch", "550", "280", "8.0.23", "", true);	
	so.addParam("menu", "0");
	so.addParam("wmode", "transparent");
	so.write("stitch");
	
	//setTimeout("writeIntro();",4000);
	
	setTimeout("$(document).showHelp();",10000);
	
}

function writeIntro()
{
	var io = new SWFObject("flsSource/int_tekst.swf", "introtekst", "650", "70", "8.0.23", "", true);	
	io.addParam("menu", "0");
	io.write("introtekst");	
}

$.fn.toonkroon = function(id) {
	$("#kroonimage_" + id).animate( { opacity:"1.0",width:"100px",height:"73px",marginLeft:"4px",marginTop:"3px" } , 120 );		
}

$.fn.hidekroon = function(id) {
	$("#kroonimage_" + id).animate( { opacity:"0.0",width:"85px",height:"61px",marginLeft:"15px",marginTop:"15px" } , 80 );		
}

$.fn.initScrollBars = function() {
	$('#fotolijst').animate( { top: "0px" }, 1 );
	var hGalerij = document.getElementById('fotolijst').clientHeight;
	var fHeight = document.getElementById('vlak_midden').clientHeight;
	if (hGalerij > fHeight) {
		document.getElementById('fotogalerij_nav').style.display='block';
	} else {
		document.getElementById('fotogalerij_nav').style.display='none';	
	}
}

$.fn.scrollDown = function() {	
	var hGalerij = document.getElementById('fotolijst').clientHeight;
	var positie = document.getElementById('fotolijst').style.top;
	var fHeight = document.getElementById('vlak_midden').clientHeight;
	
	positie = parseInt(positie);
	hGalerij = parseInt(hGalerij);
	var som = positie + hGalerij;	
	var status = document.getElementById('state').value;
	if (som>(fHeight-15) && status==1) {
			newpos = positie - 200;
			document.getElementById('state').value=0;
			$('#fotolijst').animate( { top: newpos + 'px' }, 600 );
			setTimeout("document.getElementById('state').value=1;",700);
	}	
	
}

$.fn.scrollUp = function() {	
	var hGalerij = document.getElementById('fotolijst').clientHeight;
	var positie = document.getElementById('fotolijst').style.top;
	var fHeight = document.getElementById('vlak_midden').clientHeight;
	var status = document.getElementById('state').value;

	positie = parseInt(positie);
	if (positie<0 && status==1) {
			newpos = positie + 200;
			document.getElementById('state').value=0;
			$('#fotolijst').animate( { top: newpos + 'px' }, 600 );
			setTimeout("document.getElementById('state').value=1;",700);
	}	
	
}




$.fn.loadBackFlash = function(theme) {
		var so = new SWFObject("flsSource/stich_" + theme + ".swf", "stitch", "600", "450", "8.0.23", "", true);							
		so.addParam("menu", "0");
		so.addParam("wmode", "transparent");
		so.write("stitch");
}

$.fn.randomTheme = function() {
	var themas =  
	[ 
	 "a",  
	 "b",  
	 "c",  
	 "d"
	] 
	var thema = themas[Math.floor(Math.random()*themas.length)] 
	
	$(document).chooseTheme(thema);
}

$.fn.loadFoto = function(foto) {
	if (document.getElementById('inhoud')) {		
		$("#inhoud").animate( { opacity:"0.0" } , 1 );
		$("#inhoud").animate( { opacity:"1.0" } , 800).css({ backgroundImage: 'url("' + foto + '")'});	
	}
}


