$ = jQuery;

$(document).ready(function() {

	
	// Create dynamic element for marquee
	$("#branding").append("<ul id=\"marquee\" class=\"marquee\"></ul>");
	
	// Load marquee data and start it
	if ($("#marquee").height) {
		$("#marquee").load("http://heltfrivilligt.dk/wp-content/themes/frivillig/frivilligjob-marquee.php", function(){
   			$("#marquee").marquee({fxEasingShow: "swing",fxEasingScroll: "linear", scrollSpeed: 20});
 		});
	}
	
	if ($("#post-26").height) {
		$('#post-26 h3').each(function() {
			$(this).next().toggle();
		});
			
		$('#post-26 h3').click(function() {
			$(this).next().toggle("fast");
			return false;
		}).next().hide();
	}
	
	if ($("#post-28").height) {	
		
		$('#post-28 h2').each(function() {
			$(this).next().toggle();
		});
			
		$('#post-28 h2').click(function() {
			$(this).next().toggle("fast");
			return false;
		}).next().hide();
		
	}
	
	if ($("#post-60").height) {
		$('#post-60 h2').each(function() {
			$(this).next().toggle();
		});
			
		$('#post-60 h2').click(function() {
			$(this).next().toggle("fast");
			return false;
		}).next().hide();
	}
	
	$("a.external").each(function() {
		$(this).attr('target', '_blank');
	});	
	
	if ($.browser.msie && $.browser.version >= 7) {
   		$("#wrapper").dropShadow({left:0, blur:6, top: 10});
	}
		
	if ($("#spots").height) {
		$("#spot1 a").each(function() {
			$(this).attr("href", "http://heltfrivilligt.dk/wp-content/themes/frivillig/movie1.html");
			$(this).colorbox({width: 720, height: 500, iframe:true});
		});
		$("#spot2 a").each(function() {
			$(this).attr("href", "http://heltfrivilligt.dk/wp-content/themes/frivillig/movie3.html");
			$(this).colorbox({width: 720, height: 500, iframe:true});
		});
		$("#spot3 a").each(function() {
			$(this).attr("href", "http://heltfrivilligt.dk/wp-content/themes/frivillig/movie2.html");
			$(this).colorbox({width: 720, height: 500, iframe:true});
		});
	}
	
	$(".navigation a[href=http://heltfrivilligt.dk/karriere-og-frivilligt-arbejde/super-cv/]").each(function() {
		$(this).attr('href', 'http://heltfrivilligt.dk/wp-content/themes/frivillig/supercv/supercv.html');
		$(this).attr('target', '_blank');
	});	
		
});
