$(window).load(function() {
	$('#slider').nivoSlider({
		effect:'random',
		slices:15,
	//	animSpeed:500,
		pauseTime:5000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:true, //1,2,3...
		controlNavThumbs:false, //Use thumbnails for Control Nav
		controlNavThumbsSearch: '.jpg', //Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
		keyboardNav:true, //Use left & right arrows
		pauseOnHover:true, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.8 //Universal caption opacity
	});
});


Cufon.replace('h2, h3, .sidebar h4', { fontFamily: 'SansumiDemiBold' });
Cufon.replace('#home h2, #home h3, #home .sidebar h4', { fontFamily: 'klill light' });
Cufon.replace('#home .infoh4', { fontFamily: 'klill light' });

$(document).ready(function(){
$("ul.subnavigation").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled – Adds empty span tag after ul.subnav
$("ul.topnav li span").hover(
function() { //When trigger is clicked…
//Following events are applied to the subnav itself (moving subnav up and down)
$(this).parent().find("ul.subnavigation").slideDown(400).show(); //Drop down the subnav on click
$(this).parent().hover(function() {
}, function(){
$(this).parent().find("ul.subnavigation").slideUp(500); //When the mouse hovers out of the subnav, move it back up
});
//	 //Following events are applied to the trigger (Hover events for the trigger)
//	 }).hover(function() {
//	 $(this).addClass(“subhover”); //On hover over, add class “subhover”
//	 }, function(){ //On Hover Out
//	 $(this).removeClass(“subhover”); //On hover out, remove class “subhover”
},
function () {
//
}
);
});

$(document).ready(function() {
	$("a[rel=lightbox]").fancybox({
		'showCloseButton'	: true,
		'padding'			: 0,
		'hideOnContentClick': true,
		'centerOnScroll'	: true,
		'overlayOpacity'	: 0.6,
		'overlayColor'		: '#000',
		'easingIn'			: 'easeInExpo',
		'easingOut'			: 'easeInExpo',
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'enableEscapeButton': true,
		'titleShow'			: false,
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});

	$("#fancy").fancybox({
		'padding'			: 0,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'frameWidth':700, 
		'frameHeight':700, 
		'transitionOut'		: 'none'
	});
});
