function loadXMLHttpRequest() {
    var pageRequest = false;
    if (typeof XMLHttpRequest != 'undefined') {
        return new XMLHttpRequest();
    }
    /*@cc_on
    @if (@_jscript_version >= 5)
        try {
            pageRequest = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            try {
                pageRequest = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) {
                pageRequest = false;
            }
        }
    @end
    @*/

    return pageRequest;
}

function showUrlPhotobox(a)
{
    var req = loadXMLHttpRequest();
    if(!req) return(true);

    var arrayPageSize = getPageSize();
    var arrayPageScroll = getPageScroll();

    var div = createPopup();
    if(!div) return(true);



    div.className = 'showUrlPhotobox';

  req.onreadystatechange = function callBack()
  {
    if(req.readyState == 4)
    {
      if(req.status == 200)
      {
        divContent = document.createElement('div');
        divContent.innerHTML = req.responseText;
        div.appendChild(divContent);

        var height = 400;
        var width = 600;
        if(div.offsetHeight) height = div.offsetHeight;

        var y = arrayPageScroll[1] + ((arrayPageSize[3] - 35 - height) / 2);
        var x = ((arrayPageSize[0] - 20 - width) / 2);
        div.style.top = y + "px";
        div.style.left = x + "px";

        div.style.visibility = '';

        divLoading.parentNode.removeChild(divLoading);
        divLoading = null;

      }
      else
      {
        alert('An error has occurred: ' + req.statusText);
      }
    }
  };
  req.open('GET', a.href, true);
  req.send(null);

  return false;
}



function showLexikon(a)
{
    var req = loadXMLHttpRequest();
    if(!req) return(true);

    var arrayPageSize = getPageSize();
    var arrayPageScroll = getPageScroll();

    

    var div = createPopup();
    if(!div) return(true);


    div.className = 'lexikonAnsicht';

  req.onreadystatechange = function callBack()
  {
    if(req.readyState == 4)
    {
      if(req.status == 200)
      {
        divContent = document.createElement('div');
        divContent.innerHTML = req.responseText;
        div.appendChild(divContent);

        var height = 400;
        var width = 600;
        if(div.offsetHeight) height = div.offsetHeight;

        var y = arrayPageScroll[1] + ((arrayPageSize[3] - 35 - height) / 2);
        var x = ((arrayPageSize[0] - 20 - width) / 2);
        div.style.top = y + "px";
        div.style.left = x + "px";

        div.style.visibility = '';

        divLoading.parentNode.removeChild(divLoading);
        divLoading = null;

      }
      else
      {
        alert('An error has occurred: ' + req.statusText);
      }
    }
  };
  req.open('GET', a.href, true);
  req.send(null);

  return false;
}




function showNewsWeiterempfehlen(a)
{
    var arrayPageSize = getPageSize();
    var arrayPageScroll = getPageScroll();

    var div = createPopup();
    if(!div) return(true);


    div.className = 'lexikonAnsicht';

        var divContent = document.createElement('iframe');
        divContent.width=600;
        divContent.height=470;
        divContent.frameBorder = 0;
        divContent.src = a.href;
        div.appendChild(divContent);

        var height = divContent.height;
        var width = divContent.width;

        var y = arrayPageScroll[1] + ((arrayPageSize[3] - 35 - height) / 2);
        var x = ((arrayPageSize[0] - 20 - width) / 2);
        div.style.top = y + "px";
        div.style.left = x + "px";

        div.style.visibility = '';

        divLoading.parentNode.removeChild(divLoading);
        divLoading = null;

  return false;
}

