function openSubWin(url, winWidth, winHeight) {
	window.open(url, 'subwin','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0, copyhistory=0,width='+winWidth+',height='+winHeight);
}

function ss(url)
{
	openSubWin(url, 870, 630);
	return false;
}

function delicious()
{
	location.href="http://del.icio.us/post?url="+encodeURIComponent(document.location.href)+"&title="+encodeURIComponent(document.title);
}

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText 
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }    
}

var downloadLinkMouseOverFlag = 0;
var pantherBubbleMouseOverFlag = 0;

function downloadLinkMouseOver(sender)
{
	var y = 65;
	
	if (sender != document.getElementById("downloadLink")) y = 47;

	var pantherDownload = document.getElementById("pantherDownload");
	pantherDownload.style.top = p_offsetTop(sender) - sender.offsetHeight - y + "px";
	pantherDownload.style.left = p_offsetLeft(sender) + sender.offsetWidth + "px";
	downloadLinkMouseOverFlag = 1;
	pantherBubbleMouseOverFlag = 0;
	Effect.Appear('pantherDownload', {duration: 0.4});
}

function downloadLinkMouseOut(sender)
{
	downloadLinkMouseOverFlag = 0;
	setTimeout("p_fadePantherBubble()", 500);
}

function pantherBubbleMouseOver(sender)
{
	pantherBubbleMouseOverFlag = 1;
}

function pantherBubbleMouseOut(sender)
{
	pantherBubbleMouseOverFlag = 0;
	setTimeout("p_fadePantherBubble()", 500);
}

function p_fadePantherBubble()
{
	if (downloadLinkMouseOverFlag == 0 && pantherBubbleMouseOverFlag == 0)
		Effect.Fade('pantherDownload', {duration: 0.4});
}

function p_offsetLeft(sender)
{
	var obj = sender;
	var curLeft = obj.offsetLeft;
	
	while (obj = obj.offsetParent)
	{
		curLeft += obj.offsetLeft;
	}
	
	return curLeft;
}

function p_offsetTop(sender)
{
	var obj = sender;
	var curTop = obj.offsetTop;
	
	while (obj = obj.offsetParent)
	{
		curTop += obj.offsetTop;
	}
	
	return curTop;
}
