
$(document).ready(function() {						   				
	$(document).initialize();		
 });


$.fn.initialize = function() {

	
}

$.fn.comeIn = function() {
	$('#menu_area').fadeOut(1);
	$('#menu_area').fadeIn(500);
	$('#tweeblok').fadeOut(1);
	$('#tweeblok').fadeIn(2000);
	
}


$.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 + '")'});	
	}
}


