/*
jquery hover script for jinies calendar
-d.meehan (5/2010)
*/
jQuery(function () {
	// hide all mouseover boxes by default
	jQuery(".hidden-hover").each( function() {
		jQuery(this).hide(); 
	} );
	
	// delegate all .hidden-hover w/ click evt		
	jQuery('.calnk').delegate(".hidden-hover", "click", function() {
		window.location = 'http://' + window.location.hostname + jQuery(this).prev().attr("href"); // append the href from the sibling of the hidden-hover element to the current browser location
	});
	
	// register rollover show evt
	jQuery(".calnk").mouseenter(function (e) {		
		if ( jQuery(this).find(".hidden-hover").is(":visible") ) {
			return; //already showing it
		}
		// position the box in relation to the current x/y of the .event-title class
		jQuery(this).find(".hidden-hover").css({  
			"position": "absolute",  
			"top": jQuery(this).offset().top - 3,
			"left": (jQuery(this).parent().width + 500) +"px"
		});						
		jQuery(this).find(".hidden-hover").show();
	});		
	
	// register rollout hide evt w/ a slight delay
	jQuery(".calnk").mouseleave(function () {
		jQuery(this).find(".hidden-hover").delay(1600).hide();
	});
});
