$(document).ready(function() {
		
		// Mailto Plugin
		$("a[rel='email']").safeMailTo();
			
		// Delete dotted link from links and images
		$('a').click(function() {
	 	 $(this).blur();
		});
		
		$('table.tabel_aanbod tbody tr:not([th]):odd').addClass('odd');
		$('table.tabel_aanbod tbody tr:not([th]):even').addClass('even');
		$('table.tabel_aanbod tbody tr:not([th]):even td').css('color','#0766b2');
		
		$('table.tabel_aanbod_font tbody tr:not([th]):odd').addClass('odd');
		$('table.tabel_aanbod_font tbody tr:not([th]):even').addClass('even');
		$('table.tabel_aanbod_font tbody tr:not([th]):even td').css('color','#0766b2');
		
		
		$('a[rel*=internelink]').click(function(){
			
			var iny = $(this).attr('href').substr(0,$(this).attr('href').length-5);
			interneLinkPagina(iny);
			return false;
			
		})
		
		$('#errorAjax').hide(); 
		
		$("#contactForm").validate({ 
			errorPlacement:function(label,element){
			label.insertAfter(element);
		},
			submitHandler: function(form) { 
	       $('form').ajaxSubmit({ 
	       	target: '#errorAjax', 
	        dataType: 'json',
	        url: 'inc/contact.php?action=validLog',
	        success: function(data){ 
	        if(data.error){
	        	$("#errorAjax")
	        		.html(data.error)
	        		.fadeIn(600)
	    			.animate({opacity: 1.0}, 3000)
	   				.fadeOut(600, function() {});
			}

	       if(data.message){
				$("#errorAjax").fadeOut('fast')
				$('#contactForm').fadeOut('fast');
				$('p#hideResult strong').html(data.message);
				$("#contactPane").fadeIn(200).animate({opacity: 1.0}, 3000).fadeOut(100);
	     		}
			}                       
	       }); 
	     }
		
	});
});
