
setTimeout(function(){belmeterug_terug();},1000);

init();

function init()
{
	//check all div tags
	var agendaItems = document.getElementsByTagName('a');
	
	for(var i = 0; i < agendaItems.length; i++)
	{
		if(agendaItems.item(i).id.indexOf("agendaItem") != -1)
			attach(agendaItems[i]);
	}
	
	var illustratieUpload = document.getElementById('illustratieUpload');
	
	$("#illustratieUpload").click(function() 
	{
		$.fancybox.showActivity();
	});
}

function attach(object)
{
	//attach fancybox form to the agenda items
	$("#" + object.id).fancybox({
		'width'				: '40%',
		'height'			: '50%',
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
}

var config = {    
		 over: belmeterug_open, // function = onMouseOver callback (REQUIRED)    
		 timeout: 500, // number = milliseconds delay before onMouseOut    
		 out: belmeterug_terug // function = onMouseOut callback (REQUIRED)    
	};	
	
$('#belmeterug').hoverIntent(config);

function belmeterug_terug()
{
	$('#belmeterug').animate({
		  "margin-left": "-320"
	}, "slow");
}

function belmeterug_open()
{
	$('#belmeterug').animate({
		  "margin-left": "-20"
	  }, "slow");
}

function questionClicked()
{
	window.location = "mailto:info@swingcafedearend.nl?subject=Vraag of opmerking";
}
