//Cufon font replacement
Cufon.replace('h2, h3, h4, h5, h6, .slide_title, .content_slide_title', { fontFamily: 'Diavlo Medium' }); 
Cufon.replace('h1', { fontFamily: 'Diavlo Book' });


//Dropdown menu settings
$(document).ready(function() {
ddsmoothmenu.init({
	mainmenuid: "menu", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'dd', //class added to menu's outer DIV
	//customtheme: ["#1c5a80", "#18374a"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
 });
 
 
//Latest projects slider settings
$(document).ready(function(){
        $('#projects').bxSlider({
            displaySlideQty: 3,
            moveSlideQty: 1,
			auto: true,             
        });
    });
	
	
	
	
$(document).ready(function(){
$(".item, .fade, .img").fadeTo("slow", 1.0); // This sets the opacity of the thumbs to fade down to 30% when the page loads
$(".item, .fade, .img").hover(function(){
$(this).fadeTo("fast", 0.8); // This should set the opacity to 100% on hover
},function(){
							   
$(this).fadeTo("fast", 1.0); // This should set the opacity back to 30% on mouseout
});
});
	
 
 // Accordion
 $(document).ready(function(){
	
//Set default open/close settings
$('#joblist .position').hide(); //Hide/close all containers
$('#joblist .header:first').addClass('opened').next().show(); //Add "opened" class to first trigger, then show/open the immediate next container

//On Click
$('#joblist .header').click(function(){
	if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
		$('#joblist .header').removeClass('opened').next().slideUp(); //Remove all .header classes and slide up the immediate next container
		$(this).toggleClass('opened').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
	}
	return true; //Prevent the browser jump to the link anchor
});





//Sliding sidebar navigation
$(document).ready(function()
{
	slide("#sidebar-navigation", 10, 0, 150, .8);
});

function slide(navigation_id, pad_out, pad_in, time, multiplier)
{
	// creates the target paths
	var list_elements = navigation_id + " li";
	var link_elements = list_elements + " a";
	
	// initiates the timer used for the sliding animation
	var timer = 0;
	
	// creates the slide animation for all list elements 
	$(list_elements).each(function(i)
	{
		// margin left = - ([width of element] + [total vertical padding of element])
		if($(this).attr('class') !== 'active' && $(this).attr('class') !== 'heading') {
			
			$(this).css("margin-left","0px");
			// updates timer
			timer = (timer*multiplier + time);
			$(this).animate({ marginLeft: "0" }, timer);
			$(this).animate({ marginLeft: "10px" }, timer);
			$(this).animate({ marginLeft: "0" }, timer);
		}
	});

	// creates the hover-slide effect for all link elements 		
	$(link_elements).each(function(i)
	{
		if($(this).parent().attr('class') !== 'active' && $(this).parent().attr('class') !== 'heading') {
			$(this).hover(
			function()
			{
				$(this).animate({ marginLeft: pad_out }, 150);
			},		
			function()
			{
				$(this).animate({ marginLeft: pad_in }, 150);
			});
		}
	});
}



});




	
	$(document).ready(function(){
			$("a[rel^='prettyPhoto']").prettyPhoto();
		});
		
		
		
		
			/* STYLE SWITCHER */
	$(document).ready(function()
{
	$('.switcher').click(function()
	{
		if ($('.switcher_box').css('left')=='-200px') {
			$('.switcher_box').animate({
			left: '+=200'}, 300, function() {
			});
			$('.switcher').animate({
			left: '+=200'}, 300, function() {
			});
			$('.switcher').css('backgroundPosition','0 0');
		}
		else {
			$('.switcher_box').animate({
			left: '-=200'}, 300, function() {
			});
			$('.switcher').animate({
			left: '-=200'}, 300, function() {
			});
			$('.switcher').css('backgroundPosition','0 0');
		}
	});
	
	
		});

