var opened = false;
var profilprogress = null;
var profiltitle = null;
var profil = null;

function hide() {
    profilprogress.slideUp();
    profiltitle.slideUp();
    profil.slideUp();
}
$(document).ready(function() {
    profilprogress = $("#profilprogress");
    profiltitle = $("#profiltitle");
    profil = $("#profil");

    $("#header li a").hover(function(event) {
        $(this).animate({ backgroundColor: "#012" }, 600);
    }, function(event) {
        $(this).stop().css("backgroundColor", "#039");
    });

    $(".event-shortmessage-listing li a").hover(function(event) {
        $(this).stop().animate({ backgroundColor: "#bbb" }, 350);
    }, function(event) {
        $(this).stop().css("backgroundColor", "transparent");
    });

    $(".news a").hover(function(event) {
        $(this).stop().animate({ backgroundColor: "#bbb" }, 350);
    }, function(event) {
        $(this).stop().css("backgroundColor", "transparent");
    });


    
    $("a.eventtrigger").click(function(evt) {
      evt.preventDefault();
      var event = $("#event");
      event.load("/" + $(this).attr("name"));
      

      /*
      var event = $("#event");
      var top = ($(document).scrollTop() + (screen.height - 500) / 2) - 80;
      var left = (screen.width - parseInt(event.css("width"))) / 2;
      event
        .css({top:top + 8, left:left + 6, height:"100px", opacity:0})
        .html("")
        .load("/" + $(this).attr("name"), null, function() {
          $(this)
            .animate({
              height:"500px",
              opacity:0.95,
              top:top,
              left:left
            }, 800, "easeout", function() {

            });
        });
        */

    });



});
