//Back to top

$(function () {
    $(window).scroll(function () {
        if ($(this).scrollTop() != 0) {
            $('.back-to-top').fadeIn();
        } else {
            $('.back-to-top').fadeOut();
        }
    });
    $('.back-to-top').click(function () {
        $('body,html').animate({
            scrollTop: 0
        },
        500);
    });
});



// Vertical align

(function($) {
$.fn.vAlign = function() {
    return this.each(function(i) {
        var h = $(this).height();
        var oh = $(this).outerHeight();
        var mt = (h + (oh - h)) / 2;
        $(this).css("margin-top", "-" + mt + "px");
        $(this).css("top", "50%");
        $(this).css("position", "absolute");
    });
};
})(jQuery);



// Run Vertical align

$(document).ready(function() {
	$("#content .header h2").vAlign();
	$("#content .header h3").vAlign();
});

// Opacity!

$(document).ready(function(){
	 $(".logos ul li img").fadeTo("fast", 0.15); // This sets the opacity of the thumbs to fade down to 30% when the page loads
	 $(".logos ul li img").hover(function(){
	 $(this).fadeTo("fast", 1.0); // This should set the opacity to 100% on hover
	 },function(){
	 $(this).fadeTo("medium", 0.15); // This should set the opacity back to 30% on mouseout
	 });
	 });
