$(document).ready(function(){
    
    
    // Berichte Bilder zoom...
    $("a.berichte_img, a.slide_img").fancybox({ 'fit':1,'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': true, 'overlayOpacity': 0.4 , 'zoomOpacity':true});
   // $("a[t3page]").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': true, 'overlayOpacity': 0.4 , 'zoomOpacity':true});
    
    // Berichte (Liste) Animation des EDIT Bildes...
    $(".edit_img").animate({height:"+=5px"},40).animate({width:"+=5px"},40)
    .animate({height:"-=10px"},40).animate({width:"-=10px"},40)
    .animate({height:"+=5px"},40).animate({width:"+=5px"},40)
    .animate({height:"+=5px"},40).animate({width:"+=5px"},40)
    .animate({height:"-=10px"},40).animate({width:"-=10px"},40)
    .animate({height:"+=5px"},40).animate({width:"+=5px"},40);

    //  Dienstplan Mouseover...
    $('td.free').mouseover(function(){
	    $(this).css("cursor","pointer");
	    $(this).css("background","#ECECEC");
    }).mouseout(function(){
	    $(this).css("cursor","default");
	    $(this).css("background","white");
    });    
    $('td.free').click(function(){
	    $('#hiddenID').val($(this).attr('id'));
	    $.blockUI({  
		    message: $('#dienstdialog'),  
		    css: { border: '3px solid #800080'
		    }
	    });
    });

    // Dienstplan Ajax speichern...
    $('#dienstdialog_btn_ok').click(function(){
        var workersName = $('#dienstdialog_input').val();
        var tableID = $('#hiddenID').val();
        $.get(document.URL+"?no_cache=1&save=1&tid="+tableID+"&name="+workersName+"&action=nopass");
        $('#'+tableID).text(workersName);
	$.unblockUI();
//        $('#table_plan').unblock(); 
    });

    // Diensplan Eintrag abbrechen...
    $('#dienstdialog_btn_cancel').click(function(){
        //$('#table_plan').unblock();
	$.unblockUI();
    });


	$('.tx-hbook-pi1 fieldset:first, #editpanel').hide();
	$('.tx-hbook-pi1 fieldset:first').after('<br />');	
	$('.tx-hbook-pi1').prepend('<br /><div id="entry" onclick="$(\'.tx-hbook-pi1 fieldset:first\').slideDown(\'slow\');">Einen neuen Eintrag erstellen...</div><br />');
	$('#entry').css('cursor','pointer');
});



