// Replace the fonts
Cufon.replace('h1, h2, h3, h4, h5, h6', { fontFamily: 'Droid Sans' });

// Set the default add2any settings
var a2a_config = a2a_config || {};
	a2a_config.show_title = 1; 
	a2a_config.onclick = 0;
	a2a_config.locale = "nl";
	a2a_config.num_services = 6;
	a2a_config.color_main = "ededed";
	a2a_config.color_border = "bfbfbf";
	a2a_config.color_link_text = "333333";
	a2a_config.color_link_text_hover = "333333";

$(document).ready(function () {
	// Initialize the slideshow
	Slider.Init();
	
    // Logo's 
	$("#Logos li.logo").logofy();
    
    // Fix hr small
    if($.browser.mozilla || (!$.browser.msie && $.browser.version != "7.0")) {
        $("hr.Small").css({height: "2px"});
    }

	// The menu slider
	$("a[href='/']").MenuSlider("0px");
	$("a[href*='over-inglorie']").MenuSlider("84px");
	$("a[href*='portfolio']").MenuSlider("169px");
	$("a[href*='contact']").MenuSlider("250px");
	
	// The socials animation effect
	if(!$.browser.msie && $.browser.version != "7.0") {
        $("ul#Networks>li>div>a").each(function() {
    		var $parent = $(this).parent();
    		
    		var $image = $($parent.children("img")[0]);
    		var $title = $($parent.children("h3")[0]);
    		var $subtitle = $($parent.children("h3")[1]);
    		
    		$(this).hover(function() {
    			if($image.is(":animated")) $image.stop();
    			if($title.is(":animated")) $title.stop();
    			if($subtitle.is(":animated")) $subtitle.stop();
    							   
    			$image.addClass("hover").animate({"margin-top": "-6px"}, "fast");
    			$title.animate({"margin-top": "-30px", opacity: 0}, "fast");
    			$subtitle.css({display: "block", opacity: 0}).animate({"margin-top": "0px", opacity: 1}, "fast");
    		}, function() {
    			if($image.is(":animated")) $image.stop();
    			if($title.is(":animated")) $title.stop();
    			if($subtitle.is(":animated")) $subtitle.stop();
    			
    			$image.removeClass("hover").animate({"margin-top": "0px"}, "fast");
    			$title.animate({"margin-top": "0px", opacity: 1}, "fast");
    			$subtitle.animate({"margin-top": "-30px", opacity: 0}, "fast");
    		});
    	});
   	}
	
	// The slider for the contact page
	$("a[title='Zakelijk']").click(function () {
		$("#ContactNavigationSlider").animate({left: "0px"}, 150, "easeInCirc");
		$("#ContactSlider").animate({left: "0px"}, 500, "linear");
	});
	$("a[title='Sollicitatie']").click(function () {
		$("#ContactNavigationSlider").animate({left: "78px"}, 150, "easeInCirc");
		$("#ContactSlider").animate({left: "-781px"}, 500, "linear");
	});
	$("a[title='Berichtje']").click(function () {
		$("#ContactNavigationSlider").animate({left: "160px"}, 150, "easeInCirc");
		$("#ContactSlider").animate({left: "-1561px"}, 500, "linear");
	});
	
});
