$(document).ready(function() {
	/*Home Slideshow*/
	$("#slideshowcontainer").append("<span id='prevbutton'>Previous</span><span id='nextbutton'>Next</span>");
	$('ul#slideshow').cycle({ 
    	fx: 'fade',
    	speed: 500,
    	pause: 1,
    	delay: 12000, 
    	timeout: 5000,
    	next: 'span#nextbutton', 
    	prev: 'span#prevbutton' 
	});
	
	$("#slideshowcontainer1").append("<span id='prevbutton1'>Previous</span><span id='nextbutton1'>Next</span>");
	$('ul#slideshow1').cycle({ 
    	fx: 'fade',
    	speed: 500,
    	timeout: 0,
    	cleartype: !$.support.opacity,
    	next: 'span#nextbutton1', 
    	prev: 'span#prevbutton1' 
	});
	$("#slideshowcontainer2").append("<span id='prevbutton2'>Previous</span><span id='nextbutton2'>Next</span>");
	$('ul#slideshow2').cycle({ 
    	fx: 'fade',
    	speed: 500,
    	timeout: 0,
    	cleartype: !$.support.opacity,
    	next: 'span#nextbutton2', 
    	prev: 'span#prevbutton2' 
	});
	$("#slideshowcontainer3").append("<span id='prevbutton3'>Previous</span><span id='nextbutton3'>Next</span>");
	$('ul#slideshow3').cycle({ 
    	fx: 'fade',
    	speed: 500,
    	timeout: 0,
    	cleartype: !$.support.opacity,
    	next: 'span#nextbutton3', 
    	prev: 'span#prevbutton3' 
	});

	/*Adds target blank attr to external links*/
	$("a[class=external]").attr('target','_blank');
	$("a[class=pdf]").attr('target','_blank');
	/*Adds current class to news section*/
	if (window.location.toString().match(new RegExp('/news'))) {
      $('#nav li#nav_news--publications').addClass('current');
    }
	/*Custom Styles for Overview Modules*/
	$("#maincolumn .module").css({'margin-left' : '0px', 'margin-right' : '0px'});
	$("#maincolumn .module:odd").css({'margin-left' : '20px'});
	
	$("ul#blog_list_archive li:gt(11)").hide();
	/*$("h2#archive + ul").hide();
 	$("h2.toggle").click(function() {
			$(this).next("ul").toggle();
			return false;
     });*/
     
     /*SWFobject Variables*/
	var flashvars = {}
	var params = { 
		base: ".",
		allowfullscreen: "true",
		scale: "noborder",
		salign: "tl"
	}              
	var attributes = {}
	/*SWFObject Home Page*/
	swfobject.embedSWF("/images/flash_home.swf", "animation", "338", "218", "7.0.0", false, flashvars, params, attributes);
	
});
