$(document).ready(function()
{
  function unmaskMail(mailLink){$.ajax({type:"POST",url:"/_ajax.unmaskMail.php",data:{code:mailLink.attr("rel")},dataType:"json",error:function(XMLHttpRequest, textStatus, errorThrown){alert(textStatus + "\n" + errorThrown);},success:function(data){if(data.error){alert(data.error);}else{mailLink.attr("href", data.href);mailLink.html(data.title);mailLink.removeAttr("rel");mailLink.removeAttr("target");}}});}
  $("a[href^='/email-anzeigen']").click(function(){var mailLink = $(this); if (mailLink.attr("rel")){unmaskMail(mailLink);return false;} });

  $("<div>").attr("id", "img_desc").appendTo(document.body);
  /* Galerie per Drag 'n Drop sortierbar machen */
  $(".content_gallery-item img").mousemove(function(e)
  {
    $("#img_desc").css("left", (e.pageX + 20) + "px");
    $("#img_desc").css("top", (e.pageY + 20) + "px");
  });

  $(".content_gallery-item img").hover(
  function()
  {
    if ($(this).attr("title") != "")
    {
      $(this).attr("alt", $(this).attr("title"));
      $("#img_desc").html($(this).attr("title"));
      $("#img_desc").show();
      $(this).attr("title", "");
    }
  },
  function()
  {
    $(this).attr("title", $(this).attr("alt"));
    $(this).attr("alt", "");
    $("#img_desc").hide();
    $("#img_desc").html("");
  });

});
fernsteuerung=null;
function fernstart(url)
{
 fernsteuerung=window.open("","Fernsteuerung","directories=0,location=0,menubar=0,resizeable=0,scrollbars=1,status=0,toolbar=0,width=450,height=450");
 if (fernsteuerung!=null)
  {
   if (fernsteuerung.opener==null) fernsteuerung.opener=self;
   fernsteuerung.location.href=url;
  }
}
