$(document).ready(function(){
	  
	// carousel
	$('.carousel_cycle').cycle({ 
	    fx: 'fade',
	    timeout:  7500,
		prev:    '#prev',
        next:    '#next',
        pager:  '.carousel_nav',
		cleartype:  true,
	    cleartypeNoBg:  true
	});
	
			
			
	// Returns anchor from link string
	var hash = false; 
	checkHash();
	
	function checkHash(){ 
	    if(window.location.hash != hash) { 
	        hash = window.location.hash; 
	        processHash(hash); 
	    }
	}
	
	function processHash(hash){
		var cleanHash = hash.replace("#", "");
	    //alert('.description.' + cleanHash);
		$('.description.' + cleanHash).slideToggle(250);
	}
	
	$('.box_blue.calendar .button').click(function() {
		var hashID = $(this).attr('id');
		processHash(hashID);
	});
	
	
/*
	$('div.quarter_box').hover(function() {
		$(this).find('div.normal').stop(true, true).fadeOut(250);
		$(this).find('div.blurred').stop(true, true).fadeIn(250);
		$(this).children('.quarter_actions').stop(true, true).delay(150).fadeIn(250);
	}, function() {
		$(this).children('.quarter_actions').stop(true, true).fadeOut(250);
		$(this).find('div.normal').stop(true, true).delay(150).fadeIn(250);
		$(this).find('div.blurred').stop(true, true).delay(150).fadeOut(250);
	});
*/
	
	
	$('a.hoverFade').hover(function() {
		$(this).find('span').stop(true, true).fadeOut(250);
	}, function() {
		$(this).find('span').stop(true, true).fadeIn(250);
	});



	$('a.quarter_box').hover(function () {
		
		this.t = this.title;
		var c = (this.t != "") ? this.t : "";
		
		$('div.company_image_frame').stop(true,true).fadeOut(500);
		$('div.' + c).stop(true,true).fadeIn();
		
	}, function() {
	
		$('div.company_image_frame').stop(true,true).fadeOut(500);
		   
	});
	
});


