//cufon replace
Cufon.replace('h1');
Cufon.replace('#menu ul li a', {
	hover: true			  
});
//on ready
$(function(){
	init();
});

if(!bWebkey){
	//onresize
	$(window).resize(function(){
		resizeBlock();
	});
	//on load, nog een keer blok checken op bijv afbeeldingen
	$(window).load(function(){
		resizeBlock();
	});
}

function init(){
	if(!bWebkey){
		//tekstblok schalen
		resizeBlock();
	}
	
	//tekstblok sluiten
	$('#block #close').click(function(){
		$(this).parents('#block').fadeOut(300,function(){
			$(this).remove();
		});
	});
	//logo hover
	$('#block_content ul.logos li').hover(function(){
		$(this).children('span').css({
			'background':'#999',
			'opacity':'0.2'
		});
	},function(){
		$(this).children('span').css({
			'background':'none',
			'opacity':'1'
		});
	});
}
function customScroll(){
	$('#block_content').tinyscrollbar();	
}
function resizeBlock(){
	if($('#block').length > 0){
		var nHeight = $(window).height() - 182 - 50;
		$('#block').height(nHeight);
		var nBlockHeight = nHeight - 14 - 90;
		$('#block_content, #block_content .viewport').height(nBlockHeight);
		//fix scrollbar
		var nScrollbarHeight = nBlockHeight - 6;
		$('#block_content .scrollbar .track .bg').height(nScrollbarHeight);
		customScroll();
	}
}
