/*
	GovertMuijs.nl ~ jQuery frontpage functions 
	Author: J.N. van Oosten (www.jannico.nl)
	Creation date: 24-03-2010
	Description: Different jquery functions & calls for the frontpage
	Copyright (C) Jan Nico van Oosten
*/

"use strict";

// --------------------------------------------------------------------------------
// functions to start on document.ready
// --------------------------------------------------------------------------------	
function initMuijsFront(){
	// --------------------------------------------------------------------------------
	// time of day greeting
	// --------------------------------------------------------------------------------	
	var day = new Date();
	var hr = day.getHours();
	if (hr <= 12) {
		$("span#greeting").append("Goedemorgen");
	} else if (hr > 12 && hr < 18) {
		$("span#greeting").append("Goedemiddag");
	}
	else {
		$("span#greeting").append("Goedenavond");
	}

	// --------------------------------------------------------------------------------
	// front-page blocks
	// --------------------------------------------------------------------------------		
	// add class on hover
	$("div.grid_blocks div.block").hover(
	  function () {
		$(this).addClass("hover");
	  }, 
	  function () {
		$(this).removeClass("hover");
	  }
	);
	
	// make divs clickable
	$("div.grid_blocks div.block").click(function() {
		window.location = $(this).find("a").attr("href");
	});
}

