/* -----------------------------------------------
   Floating layer - v.1
   (c) 2006 www.haan.net
   contact: jeroen@haan.net
   You may use this script but please leave the credits on top intact.
   Please inform us of any improvements made.
   When usefull we will add your credits.
  ------------------------------------------------ */
function setVisible(prevurl,prevw,prevh) {
  obj = document.getElementById('toplayer');
  if (obj.style.visibility == 'visible') {
    obj.style.visibility = 'hidden';
    obj.innerHTML = '';
  } else {
    obj.style.visibility = 'visible';
    obj.innerHTML = '<div id="layer1" style="width: "'+prevw+';"><div onclick="setVisible(\'toplayer\',\'\',\'0\',\'0\');" style="font-weight: bold; color: blue; float: right; cursor: hand;">x Close</div><object width="'+prevw+'" height="'+prevh+'" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab"><param name="src" value="'+prevurl+'"/><param name="autoplay" value="true"/><param name="controller" value="true"/><param name="enablejavascript" value="true"/><param name="showlogo" value="false"/><embed src="'+prevurl+'" width="'+prevw+'" height="'+prevh+'" autoplay="true" controller="false" showlogo="false" pluginspage="http://www.apple.com/quicktime/download/"/></embed><p>Listening to previews requires <a href="http://click.linksynergy.com/fs-bin/click?id=jr4AIGyHM9s&amp;offerid=78941.10000337&amp;type=3&amp;subid=0">iTunes</a><img style="border: none;" width="1" height="1" alt="iTunes" src="http://ad.linksynergy.com/fs-bin/show?id=jr4AIGyHM9s&amp;bids=78941.10000337&amp;type=3&amp;subid=0" /></p></object></div>';
    if (document.documentElement) {
      theLeft = document.documentElement.scrollLeft;
      theTop = document.documentElement.scrollTop;
    } else if (document.body) {
      theLeft = document.body.scrollLeft;
      theTop = document.body.scrollTop;
    }
    x = 2;
    y = 2;
    theLeft += x;
    theTop += y;
    obj = document.getElementById('layer1');
    obj.style.top = x + 'px' ;
    obj.style.left = y + 'px' ;
  }
}

function placeIt(obj) {
  obj = document.getElementById(obj);
  if (document.documentElement) {
    theLeft = document.documentElement.scrollLeft;
    theTop = document.documentElement.scrollTop;
  } else if (document.body) {
    theLeft = document.body.scrollLeft;
    theTop = document.body.scrollTop;
  }
  x = 2;
  y = 2;
  theLeft += x;
  theTop += y;
  obj.style.left = theLeft + 'px' ;
  obj.style.top = theTop + 'px' ;
  setTimeout("placeIt('toplayer')",500);
}

function startMove() {
  setTimeout("placeIt('toplayer')",500);
}

window.onscroll = startMove;
