jQuery(document).ready(function() {
    jQuery('#carousel_1').jcarousel(); // Carousel of images   
    jQuery('#carousel_2').jcarousel(
		{ scroll: 2}
	); // Carousel of video files
    jQuery('#carousel_b').jcarousel(
    {
    visible: 8.5
    });
    
    
	$("#icoTooltips li").tooltip({     
    bodyHandler: function() {
	   var txt = $(this).contents(".popUpTool").attr("innerHTML");	   
	   return txt; 
    }, 
	delay: 0,
    showURL: false,
	opacity: 1,
	top: -55, 
    left: 5 
});
});

var Confirmator =
{
    deleteBeitrage: function()
    {
        return confirm('Wirklich löschen?');
    },
	deleteGastebuch: function()
	{
        return confirm('Eintrag wirklich löschen?');
	}
}

function estimate(id, count, mouseOver)
{    
	for (var i=0; i < count; i++){
        var el = '#' + id + "" + i;
		if (i > mouseOver) {
		    $(el).removeClass('active');
		} else {		
	        $(el).addClass('active');
        }	
    }	    	
}

function estimate_out(id, count, actualRate)
{
    for (var i=0; i < count; i++) {
        var el = '#' + id + "" + i;
        if (i > actualRate-1) $(el).removeClass('active'); 
    }	
}

function setBeitragePhoto(id, src) 
{
    $('input[@name=photo_id]').attr('value', id);
	if (src) {
		$('#f_photo').empty().html('<img src="/images/ugpic/' + src + '" alt=""');
		$('#f_delete').show();
	} else {
        $('#f_photo').attr('innerHTML','');
		$('#f_delete').hide();
	}
}