$(document).ready(function() {
        $("div.membershort div.foto").mouseover(function() {
                var pos = $(this).parent().parent().position();
                //hide all anotations
                $("div.memberdetail").css("display", "none");
                //display this particular anotation
                $(this).parent().siblings("div.memberdetail").removeClass("hidden");
                $(this).parent().siblings("div.memberdetail").css("top", pos.top).css("left", pos.left).css("position", "absolute");
                $(this).parent().siblings("div.memberdetail").fadeIn("fast");
        });
        $("div.memberdetail").mouseout(function() {
            $(this).fadeOut("fast");
            $(this).addClass("hidden");
        });
        $(".EventCalendar div.item").mouseover(function() {
            $(this).css("background-color", "white");
        });
        $(".EventCalendar div.item").mouseout(function() {
            $(this).css("background-color", "transparent");
        });
        $("span.expire").each(function() {
            var str = $(this).text();
            if(str!="") {
                var courseDate = new Date(str.substr(0,4),str.substr(4,2)-1, str.substr(6,2),0,0,0,0);
                var today = new Date();
                if(today>courseDate) {
                    $(this).parent().css("display","none");
                }
            }
        });
        /*hiding inactive courses*/
        $("span.acl_link").each(function() {
            if($("span.acl_date", this).length == 0) {
                $(this).remove();
            }
            else{
                if($("span.acl_date", this).text()=="") $(this).remove();
            }
        });
        $("a.magicwand").click(function() {
            $('div.hiddeninfo').slideDown();
            $(this).remove();
            return false;
        });
});

var GLOBE = new Object();
GLOBE.lib = {
  debug:function(message, type){
    if(!type) type = "error";
    var consoleDefinition = typeof(console) != "undefined";
    if(type=="error") {
      if (!consoleDefinition) {/*ie solution*/
        if (window.debug) alert('console:'+message);
      } else {
        console.error(message);
      }
    }
    else if(type=="warning" && consoleDefinition) {
      console.warn(message);
    }
    else if(type=="info" && consoleDefinition) {
      console.info(message);
    }
    else if(type=="debug" && consoleDefinition) {
      console.debug(message);
    }
  },
  exists:function(selector) {
    if($(selector).length>0) {
      return true;
    } else {
      return false;
    }
  }
};

