/*********************************************
 * Special Order bvba
 * (c) Ken Pimontel, ken at specialorder dot be
 * Purpose: Base JQ script settings
 *
 * NOTES
 * From base site 0003
 *
 * DEPENDENCIES
 *
 * TODO
 *
 * HISTORY
 * Last change <!-- hhmts start -->2010-05-07 14:24:40<!-- hhmts end -->
 * 090331 ADDED Topmenu li:not(.active)
 * 090331 UPDATE SideMenu-T2 afgewerkt
 * 090327 ADDED auto form label width
 * 090327 ADDED a.box
 * 090120 First version
 *********************************************/


 // Logging function - kan je gebruiken in de chain. $("blabla").log("Wat je wil zeggen").fadeofzo...
jQuery.fn.log = function (msg) {
      console.log("%s: %o", msg, this);
      return this;
  };

// TopMenu-img
$(document).ready(function(){
	$("#SideMenu li:not(.active) img").fadeTo("slow", 0.3); // This sets the opacity of the thumbs to fade down to 60% when the page loads
	$("#SideMenu li.active img").fadeTo("slow", 0.6); // This sets the opacity of the thumbs to fade down to 60% when the page loads
	$("#SideMenu li:not(.active) img").hover(function(){
		$(this).fadeTo("fast", 1.0); // This should set the opacity to 100% on hover
		},function(){
		$(this).fadeTo("fast", 0.3); // This should set the opacity back to 60% on mouseout
	});
});

// Footer-img
$(document).ready(function(){
	$("#footer").fadeTo("slow", 0.3); // This sets the opacity of the thumbs to fade down to 60% when the page loads
	$("#footer").hover(function(){
		$(this).fadeTo("fast", 1.0); // This should set the opacity to 100% on hover
		},function(){
		$(this).fadeTo("fast", 0.3); // This should set the opacity back to 60% on mouseout
	});
});


jQuery.fn.fancybox.defaults.path = 'http://nethome.be/_js/fancybox-1.2.1/';
$(document).ready(function() {
	 $("a.box").fancybox({
	 	'hideOnContentClick': true,
	 	'zoomSpeedIn': 500,
	 	'zoomSpeedOut': 500,
	 	'frameWidth': 500,
	 	'frameHeight': 600,
	 	'overlayShow': true,
	 	'overlayOpacity': 0.75,
	 	'titleShow': false
	 	});

 });

$(document).ready(function(){
    $("a[href$=pdf]")
        .addClass("pdf")
        .attr({ target: "_blank" });
    $("a[href$=zip]").addClass("zip");
    $("a[href$=psd]").addClass("psd");
    $("a[href*=mailto]").addClass("mailto");
});


// Automatically sets a form's label width correctly

$(document).ready(function() {
    var max = 0;
    $("form.autowidth label").each(function(){
        if ($(this).width() > max)
            max = $(this).width();
    });
    $("form.autowidth label").width(max);
});

