
/** floating image text (using #calendarinfo from calendar) **/

jQuery("a[rel=gallery_group] img, span[rel=gallery_group] img, a.fancygallery img").live('mouseover', function(event) {
    jQuery("#calendarinfo").html("<div class=\"cnt\">"+this.alt+"</div>");
    if(this.alt!='') jQuery("#calendarinfo").show();
});

jQuery('a[rel=gallery_group] img, span[rel=gallery_group] img, a.fancygallery img').live('mousemove', function (e) {
    changeCalendarPosition(e);
});

jQuery('a[rel=gallery_group] img, span[rel=gallery_group] img, a.fancygallery img').live('mouseout', function() {
    jQuery("#calendarinfo").hide();
});

/** links **/

jQuery('a.ajax').live('click', function (event) {
    event.preventDefault();
    jQuery.get(this.href);
});


/** small box calendar events **/

function changeCalendarPosition(e) {
    var box = jQuery("#calendar").offset();
    var realXposition = e.pageX - box.left;
    var realYposition = e.pageY - box.top;               
    jQuery("#calendarinfo").css('left',(realXposition+10)).css('top',(realYposition+10));  
}      

jQuery('a.calendarday').live('mousemove', function (e) {
    changeCalendarPosition(e);
});

jQuery('a.calendarday').live('mouseover', function (e) {         
    var day = this.rel;
    if (day < 10 ) day = "0"+day;
    var html = "";
    jQuery("#cmperf div#cmperfday-"+day+" p.perf a").each(function() { 
        html += jQuery(this).html()+'<br />'; 
    });
    jQuery("#calendarinfo").html("<div class=\"cnt\">"+html+"</div>");
    jQuery("#calendarinfo").show();
});

jQuery('a.calendarday').live('mouseout', function() {
    jQuery("#calendarinfo").hide();
});

