/**
 Unobtrusive JavaScript events
 */

$(document).ready(function(){
	
	//backgroundimage caching aanzetten voor MSIE
	if($.browser.msie){
		if (document && document.execCommand) {
			try { document.execCommand("BackgroundImageCache",false, true); }
			catch (e) { }
		}	
	}
	
	//scroll initieren
	if(typeof $('.scroll') != 'undefined'){
		$('.scroll').jScrollPane({showArrows:true,reinitialiseOnImageLoad:true});
	}
	
	//gallery initialiseren
	if(typeof $('ul.productListView') != 'undefined'){
		$('ul.productListView').initGallery({  
			placeholder: '.mainImg a:eq(0)',
			lightbox: '.mainImg a',
			thumb: 'div.imgWrapper a.productImg',
			duration: 800,
			fadeIn: true
		});
	}
	
	/* Inlogscherm (overlay) */
	$("a[href='/login.html']").click(function(){
		$(this).attr('href','javascript:void(0);');
		showLogin();
		return false;
	});	
	
	//printen
	$("a.print").click(
		function(){
			window.print(); return false;
		}
	);
	
	$('ol.mainNav > li').not('.active').hover(function(event){
		$('ol.active').css('display','none');
	},
	function(){
		$('ol.active').css('display','block');
	});
	
	/* Lightbox triggeren */
	$("a[rel^='prettyPhoto']").prettyPhoto({
		theme: 'dark_square',
		padding: 40,
		opacity: 0.4,
		showTitle: false,
		allowresize: false
	});	

});

/* Nogmaals de height fixen (indien resize) */
$(window).load(function(){
	fixHeight();
});