
jQuery(document).ready(function() {

	jQuery('#contactUs').live('click', function(){
		jQuery('#enterTelephone input').val('');
		jQuery('#enterTelephone').dialog({
			resizable: false,
			draggable: false,
			height: 190,
			width: 360,
			modal: true,
			buttons: [
				{
			        text: 'Verstuur',
			        click: function() 
					{
						var telefoonnummer = jQuery('#belmijterug-telefoonnummer').val(); 
						
						jQuery.ajax({ 
							type: 'POST',
							url: 'ajax.bel-mij-terug', 
							dataType: 'json',
							data: '&telefoonnummer='+telefoonnummer,
							success: function(data) 
							{
								if(data.status == 'SUCCES')
								{
									jQuery('#enterTelephone').dialog('close'); 
									showDialog('Bedankt, we zullen z.s.m contact met u opnemen. ', '', 'succes');
									jQuery('#enterTelephone input').val('');
								}
								else
								{
									showDialog('Het opgegeven telefoonnummer is niet geldig', 'Ongeldig telefoonnummer', 'error')						
								}
							}
						});
					}
				}
				,
				{
			        text: 'Annuleren',
			        click: function() 
					{ 
						jQuery(this).dialog('close'); 
							}
					    }
					]
 
				});
			});
			
			function showDialog(message, title, type)
			{
				if(type == 'error')
		{
			msg = '<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>'+message+'</p>';
		}
		else
		{
			msg = '<p>'+message+'</p>';
		}
		var msgConfirm = jQuery('<div></div>')
			.html(msg)
			.dialog({
				resizable: false,
				draggable: false,
				height:150,
				modal: true,
				title: title,
				buttons: {
					Ok: function() {
						jQuery(this).dialog('close');
					}
				}
		});
	}
	
 	startSlideShow();
	mlddminit();
});

jQuery().ready(function(){
	jQuery('#vacatureList').accordion({
		alwaysOpen: false,
		active: false,
		autoHeight: false,
		clearStyle: true
	});
});
