function bookmarksite(title,url)
{

if (window.sidebar) 
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ 
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)
	window.external.AddFavorite(url, title);
}

var SelectedItem;
var SelectedX, SelectedY;
var MouseX, MouseY;

function Move(e, ClickedItem)
{
  if(e == null)
  e = window.event;
  SelectedItem = ClickedItem;
  SelectedX = SelectedItem.offsetLeft;
  SelectedY = SelectedItem.offsetTop;
  MouseX = e.clientX;
  MouseY = e.clientY;
  document.onmousemove = Drag;
}

function Drag(e)
{
  
  if(e == null)
  e = window.event;
  SelectedItem.style.left = SelectedX + e.clientX - MouseX + "px";
  SelectedItem.style.top = SelectedY + e.clientY - MouseY + "px";
  document.onmouseup = Drop;
  return false;
}

function Drop(e)
{
  
  if(e == null)
  e = window.event;
  var i = SelectedItem.id.substr(3,2);
  
  var TopLimit = document.getElementById("POS" + i).offsetTop;
  var BottomLimit = document.getElementById("POS" + i).offsetTop +
    document.getElementById("POS" + i).offsetHeight;
  var LeftLimit = document.getElementById("POS" + i).offsetLeft;
  var RightLimit = document.getElementById("POS" + i).offsetLeft + 
    document.getElementById("POS" + i).offsetWidth;
  
  var CenterY = document.getElementById("PUZ" + i).offsetTop + 
    (document.getElementById("PUZ" + i).offsetHeight / 2);
  var CenterX = document.getElementById("PUZ" + i).offsetLeft + 
    (document.getElementById("PUZ" + i).offsetWidth / 2);
  
  if (CenterY >= TopLimit &&
      CenterY <= BottomLimit &&
      CenterX >= LeftLimit &&
      CenterX <= RightLimit ) {
    SelectedItem.style.top = 
      document.getElementById("POS" + i).offsetTop + "px";
    SelectedItem.style.left = 
      document.getElementById("POS" + i).offsetLeft + "px";
  }
  
  document.onmousemove = null;
  document.onmouseup = null;
}