﻿$(document).ready(
				function() {
				    $('#news').innerfade({
				        animationtype: 'slide',
				        speed: 750,
				        timeout: 2000,
				        type: 'random',
				        containerheight: '1em'
				    });

				    $('ul#portfolio').innerfade({
				        speed: 1000,
				        timeout: 5000,
				        type: 'sequence',
				        containerheight: '220px'
				    });

				    $('.fade').innerfade({
				        speed: 1000,
				        timeout: 6000,
				        type: 'random_start',
				        containerheight: '1.5em'
				    });

				    $('.adi').innerfade({
				        speed: 'slow',
				        timeout: 5000,
				        type: 'random',
				        containerheight: '150px'
				    });

				});

				var Header = {
				    // Let's write in JSON to make it more modular
				    addFade: function(selector) {
				        $("<span class=\"fake-hover\"></span>").css("display", "none").prependTo($(selector));
				        // Safari dislikes hide() for some reason
				        $(selector + " a").bind("mouseenter", function() {
				            $(selector + " .fake-hover").fadeIn("slow");
				        });
				        $(selector + " a").bind("mouseleave", function() {
				            $(selector + " .fake-hover").fadeOut("slow");
				        });

				    }
				};

				$(function() {
				    Header.addFade("#logoheader");
				});