$(document).ready(function(){
	
	jQuery('#nieuwsbrief-form A#open-panel').click(function() {         jQuery('#nieuwsbrief-panel').show("slow");     }); 
	jQuery('#nieuwsbrief-form A#close-panel').click(function() {         jQuery('#nieuwsbrief-panel').hide("slow");     }); 

	$("a.gallery").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200,
		'titleShow'		:	true,
		'titlePosition'	: 	'inside',
		'type' 			: 	'image',
		'content'		:	'<p>bla bla</p>'
	});

	$('#main-menu LI:first .left-item').addClass('home');
	$('#menu-footer-menu LI:first').append('&nbsp;|&nbsp;');
	$('#menu-footer-menu LI:first').append('&nbsp;|&nbsp;');
	$('A[rel=external]').attr('target', '_blank');
	Cufon.set('fontFamily', 'ScalaSans').replace('h1.main-title')('.title-row h2');
	
	
	$(".social-icons a[href^='http://']").attr("target","_blank");
	$(".social-icons a[href^='https://']").attr("target","_blank");
	
	function isIE() {     if(navigator.userAgent.match(/MSIE \d\.\d+/))         return true;     return false; }   
	
	function zIndexWorkaround() {     // If the browser is IE,     
	
	if(isIE())     {         /*         ** For each div with class menu (i.e.,         ** the thing we want to be on top),         */        
	
	$("#nieuwsbrief-form").parents().each(function() {             
										  var p = $(this);             
										  var pos = p.css("position");               
										  // If it's positioned,             
										  if(pos == "relative" ||              
											 pos == "absolute" ||                
											 pos == "fixed")             
										  {                 /*                 
										  ** Add the "on-top" class name when the                 ** mouse is hovering over it, and remove 
										  ** it when the mouse leaves.                 */              
										  p.hover(function() { 
														   $(this).addClass("on-top");
														   },                     
														   function() {                         $(this).removeClass("on-top");                     });             }         });     } } 

	zIndexWorkaround();
});
