
var timer;
function init() {
	clearTimeout(timer);
	if (!document.getElementById('fullload')) {
		timer = setTimeout('init()',100);	
	} else {
		if (document.getElementById('afb_main')) { init_image(); }
	}
}

window.onload = init;

$(document).ready( function() {
	
	if ($('#snoeppot_wrapper').length>0) {
		var origheight = $('#snoeppot_wrapper').height();
		
		if (SNOEPPOT_FRM_SHOW===false) {
			$('#snoeppot_wrapper').css({
				display: 'none',
				visibility: 'visible',
				height: 0,
				overflow: 'hidden'
			});
		} else {
			$('#snoeppot_wrapper').css({ visibility: 'visible', display: 'inline' });
		}
		
		$('#candyaction').bind('click', function(e) {
			e.preventDefault();
			
			$('#snoeppot_wrapper').css({
				display: 'inline'
			}).animate({
				height: origheight
			}, 500);
		});
		
		$('#snoeppot_btn_close').bind('click', function(e) {
			e.preventDefault();
			
			$('#snoeppot_wrapper').animate({
				height: 0
			}, 500, 'linear', function(){
				$('#snoeppot_wrapper').css({ display: 'none' });
			});
		});
	}
	
});
