$(document).ready ( function () 
{
    /*
    $(window).keypress(function(e) {
       if (e.keyCode == 27)
       {
           parent.$.fancybox.close();
       }
    });*/


    $("#term").bind("mousemove",function(){
      $("#termpopup").show();
    }).bind("mouseleave",function(){
      $("#termpopup").fadeOut("medium");
    });


    $("a.fancybox").fancybox({
        type:'iframe',
        width:857,
        height:526,
        padding:0,        
        scrolling:'no',
        autoDimensions:false,
        hideOnOverlayClick:false,
        autoScale:false,
        showCloseButton:false,
        overlayOpacity:0.5,
        overlayColor:"#333",
        opacity:true
    });

    $("#commentText").focus(function(){   
        if ($("#commentText").val() == "Kommentar schreiben")
            {
                $("#commentText").val("");
                $("#commentText").css({color:"#000000"});
            }
    });
    $("#commentText").blur(function(){
        if ($("#commentText").val() == "")
            {
                $("#commentText").val("Kommentar schreiben");
                $("#commentText").css({color:"#bbbbbb"});
            }
    });

     $("input[type=file]").filestyle({
         image: "img/upload.gif",
         imageheight : 27,
         imagewidth : 27,
         width : 180

     });
} );