var timer;
function shareDigg()
{
	u=location.href;
	t=document.title;
	window.open('http://digg.com/submit?phase=2&url='+encodeURIComponent(u)+'&title='+encodeURIComponent(t),'sharer','toolbar=1,status=1,resizeable=1,scrollbars=1,location=1,menubar=1,width=1000,height=600');
}

function shareFacebook()
{
	u=location.href;
	t=document.title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=1,status=1,resizeable=1,scrollbars=1,location=1,menubar=1,width=626,height=436');
}

function shareDelicious()
{
	u=location.href;
	t=document.title;
	window.open('http://del.icio.us/post?url='+encodeURIComponent(u)+'&title='+encodeURIComponent(t),'sharer','toolbar=1,status=1,resizeable=1,scrollbars=1,location=1,menubar=1,width=1000,height=600');
}

function shareReddit()
{
	u=location.href;
	t=document.title;
	window.open('http://reddit.com/submit?url='+encodeURIComponent(u)+'&title='+encodeURIComponent(t),'sharer','toolbar=1,status=1,resizeable=1,scrollbars=1,location=1,menubar=1,width=626,height=436');
}

function shareMyYahoo()
{
	u=location.href;
	t=document.title;
	window.open('http://myweb2.search.yahoo.com/myresults/bookmarklet?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=1,status=1,resizeable=1,scrollbars=1,location=1,menubar=1,width=600,height=800');
}

function shareGoogleBookmarks()
{
	u=location.href;
	t=document.title;
	window.open('http://www.google.com/bookmarks/mark?op=edit&bkmk='+encodeURIComponent(u)+'&title='+encodeURIComponent(t),'sharer','toolbar=1,status=1,resizeable=1,scrollbars=1,location=1,menubar=1,width=800,height=700');
}

function shareLinkedIn()
{
	u=location.href;
	t=document.title;
	window.open('http://www.linkedin.com/shareArticle?mini=true&url='+encodeURIComponent(u)+'&title='+encodeURIComponent(t),'sharer','toolbar=1,status=1,resizeable=1,scrollbars=1,location=1,menubar=1,width=520,height=570');
}

function shareTwitter()
{
	u=location.href;
	t=document.title;
	window.open('http://www.twitter.com/home?status='+encodeURIComponent(u)+encodeURIComponent(' - ')+encodeURIComponent(t),'sharer','toolbar=1,status=1,resizeable=1,scrollbars=1,location=1,menubar=1,width=520,height=570');
}

function displayPopup(sourceControl, targetControl)
{
		//Determine if the browser supports x and y coordinate properties
    if (sourceControl.x)
    {
       //Assign the offset for the popup
       targetControl.style.top = (sourceControl.y + sourceControl.height)+"px"; 
       targetControl.style.left =(sourceControl.x)+"px";        
    } else {
        //If the browser doesn't support x/y coordinates, crawl the dom manually
        var objItem = sourceControl;
        var objParent = null;
        var intX = 0;
        var intY = 0;

                        
        do
        {            
        	// Walk up our document tree until we find the body
          // and add the distance from the parent to our counter.
          intX += objItem.offsetLeft
          intY += objItem.offsetTop
          objParent = objItem.offsetParent.tagName
          objItem = objItem.offsetParent
        } while(objParent != 'BODY')

         //Assign the offset for the popup
         targetControl.style.top = (intY + sourceControl.height)+"px";
         targetControl.style.left = (intX)+"px";
    }
    targetControl.style.display="block";
}

function hidePopup(control)
{
		control.style.display="none";
}

function hidePopupEvent(e)
{
	if (!e) var e = window.event;
	var destTarget = (window.event) ? e.toElement : e.relatedTarget;

    if (destTarget != null)
    {
      if(destTarget.id != 'ShareImage' &&
	  (destTarget.id != 'DropShadow'
	  && destTarget.offsetParent.id != 'DropShadow'))
        {
            if (destTarget.offsetParent.id != "")
            {
                if (destTarget.offsetParent.offsetParent.id != 'DropShadow' )
                {
                    if (destTarget.offsetParent.offsetParent.id != "")
                    {
                        if (destTarget.offsetParent.offsetParent.offsetParent.id != 'DropShadow')
                        {
                            window.clearInterval(timer);
                            timer = window.setTimeout ("document.getElementById('DropShadow').style.display='none';",300);
                        }
                    } else {
                        window.clearInterval(timer);
                        timer = window.setTimeout ("document.getElementById('DropShadow').style.display='none';",300);
                    }

                }
            } else {
                window.clearInterval(timer);
                timer = window.setTimeout ("document.getElementById('DropShadow').style.display='none';",300);
            }
        } else {
             window.clearInterval(timer);
             timer = window.setTimeout ("document.getElementById('DropShadow').style.display='none';",300);
        }
    }
}

function highlight(control)
{
	
		control.style.background = "#e2f6ff";
}

function unhighlight(control)
{
	
		control.style.background = "#FFFFFF";
}