var http_request = false;
var html_string = "";
function makeRequest(url)
  {
  http_request = false;
  if (window.XMLHttpRequest)
    { // Mozilla, Safari,...
    http_request = new XMLHttpRequest();
    if (http_request.overrideMimeType)
      {
      http_request.overrideMimeType('text/xml');
      }
    }
  else if (window.ActiveXObject)
    { // IE
    try
      {      
      http_request = new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e) 
      {
      try
        {
        http_request = new ActiveXObject("Microsoft.XMLHTTP");
        }
      catch (e)
        {
        }
      }
    }
  if (!http_request)
    {
    return false;
    }
  http_request.onreadystatechange = alertContents;
  http_request.open('GET', url, true);
  http_request.send(null);
  }

function alertContents()
  {
  if (http_request.readyState == 4)
    {
    if (http_request.status == 200)
      {
      var xmldoc = http_request.responseXML;
      var name_node = xmldoc.getElementsByTagName('name').item(0);
      html_string = "";
      if(name_node.firstChild.data == "keine Releases")
        {
        html_string = html_string+"<span class=\"text_bold\">"+name_node.firstChild.data+"<br\/><\/span>";
        }
      else
        {
        var i = 1;
        while(xmldoc.getElementsByTagName('name').length >= i)
          {
          if(i > 1)html_string = html_string+"<div style=\"clear:both; margin-top:5px; padding-top: 5px;\";><hr \/><\/div>";
          var artist_node = xmldoc.getElementsByTagName('artist').item(i-1);
          var cover_node = xmldoc.getElementsByTagName('cover').item(i-1);
          var name_node = xmldoc.getElementsByTagName('name').item(i-1);
          var date_node = xmldoc.getElementsByTagName('date').item(i-1);
          var genre_node = xmldoc.getElementsByTagName('genre').item(i-1);
          var url_node = xmldoc.getElementsByTagName('url').item(i-1);
          var type_node = xmldoc.getElementsByTagName('type').item(i-1);
          if(cover_node.firstChild.data != "kein Cover")
            {
            html_string = html_string+"<img src=\"http:\/\/images.jpop.at\/"+cover_node.firstChild.data+"\" alt=\""+name_node.firstChild.data+"\" align=\"left\" \/>";
            }
          html_string = html_string+"<span class=\"text_bold\">K&uuml;nstler:&nbsp;<\/span><span class=\"text\">"+artist_node.firstChild.data+"<br\/><\/span>";
          html_string = html_string+"<span class=\"text_bold\">Titel:&nbsp;<\/span><span class=\"text\">"+name_node.firstChild.data+"<br\/><\/span>";
          html_string = html_string+"<span class=\"text_bold\">Releasedatum:&nbsp;<\/span><span class=\"text\">"+date_node.firstChild.data+"<br\/><\/span>";
          html_string = html_string+"<span class=\"text_bold\">Releasedtype:&nbsp;<\/span><span class=\"text\">"+type_node.firstChild.data+"<br\/><\/span>";
          html_string = html_string+"<span class=\"text_bold\">Genre:&nbsp;<\/span><span class=\"text\">"+genre_node.firstChild.data+"<br\/><\/span>";
          html_string = html_string+"<span class=\"text_bold\">URL:&nbsp;<\/span><span class=\"text\"><a class=\"link\" href=\""+url_node.firstChild.data+"\">mehr Infos<\/a><br\/><\/span>";
          i = i+1;
          }
        }
      document.getElementById("releases").innerHTML = html_string;
      document.getElementById("rel1").style.visibility = "visible";
      }
    }
  }
function closelayer()
  {
  document.getElementById("rel1").style.visibility = "hidden";
  }
// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this header

isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;

function ddInit(e){
  topDog=isIE ? "BODY" : "HTML";
  whichDog=isIE ? document.all.releases_kopf : document.getElementById("releases_kopf");
  hotDog=isIE ? event.srcElement : e.target;
  if(hotDog.id != "")
    {
  while(hotDog.id!="releases_kopf" && hotDog.tagName!=topDog)
    {
    hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
    }
    }
  if (hotDog.id=="releases_kopf"){
    offsetx=isIE ? event.clientX : e.clientX;
    offsety=isIE ? event.clientY : e.clientY;
    nowX=parseInt(whichDog.style.left);
    nowY=parseInt(whichDog.style.top);
    nowY2=parseInt(isIE ? document.all.releases.style.top : document.getElementById("releases").style.top);
    ddEnabled=true;
    document.onmousemove=dd;
  }
}

function dd(e){
  if (!ddEnabled) return;
  whichDog.style.left=isIE ? nowX+event.clientX-offsetx+"px" : nowX+e.clientX-offsetx+"px";
  document.getElementById("releases").style.left = isIE ? nowX+event.clientX-offsetx+"px" : nowX+e.clientX-offsetx+"px";
  whichDog.style.top=isIE ? nowY+event.clientY-offsety+"px" : nowY+e.clientY-offsety+"px";
  document.getElementById("releases").style.top =isIE ? nowY2+event.clientY-offsety+"px" : nowY2+e.clientY-offsety+"px";;
  return false;  
}

function ddN4(whatDog){
  if (!isN4) return;
  N4=eval(whatDog);
  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
  }
  N4.onmousemove=function(e){
    if (isHot){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}

document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");

