$(document).ready( function() {
	Cufon.replace('.top nav ul li a', {'hover': true});
	Cufon.replace('article h1');
	Cufon.replace('article h2');
	Cufon.replace('article h3');
	Cufon.replace('article h4');
	Cufon.replace('article h5');
	Cufon.replace('.menu ul li a');

	$('.picture-side').fadeImages(2000, 5);
	
//Set default open/close settings
$('.acc_container').hide(); //Hide/close all containers
$('.acc_trigger:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container

//On Click
$('.acc_trigger').click(function(){
	if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
		$('.acc_trigger').removeClass('active').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container
		$(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
	}
	return false; //Prevent the browser jump to the link anchor
});
});


/*

jQuery('.picture-side').cycle({
	fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
});
*/



$.fn.fadeImages = function (d, t) {
	$(this).find('img:first').addClass('active').next().addClass('next');
	var ob = $(this);
	setInterval( function() {
		$(ob).find('img.active').fadeOut(d, function () {
			$(this).removeClass('active');
			$(ob).find('img.next').removeClass('next').addClass('active');
			$(ob).find('img.active').next().addClass('next');
			if( $(ob).find('img.next').length < 1 ) {
				$(ob).find('img:first').addClass('next');
			}
			$(ob).find('img').show();
		});
	}, t*1000);
}


$(function() {
	$('a[href^=http]').click( function() {        
		window.open(this.href);        
		return false;    
	});
});
