/////////////////////////// Edit the five step below /////////////////////////

// 1) change the width and height of your logo image (in pixels), respectively
var logowidth = 40
var logoheight = 85
var logoimage = new Image(logowidth,logoheight)

// 2) change the image path to reflect the path of your logo image
logoimage.src="images/top_arrow.gif"

// 3) Change url below to the target URL of the logo
var logolink = "#TOP"

// 4) change the alttext variable to reflect the text used for the "alt" attribute of the image tag
var alttext = "Back to Top"

// 5) Finally, below variable determines the duration the logo should be visible after loading, in seconds. If you'd like the logo to appear for 20 seconds, for example, enter 20. Entering a value of 0 causes the logo to be perpectually visible. 
var visibleduration = 0 // not used in this rendition of this javascript.

// Optional parameters
var Hoffset = 0 //Enter logo's offset from left edge of window
var Voffset = 8 //Enter logo's offset from bottom edge of window

/////////////////////////// Do not edit below this line /////////////////////////

var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1

var watermark_obj=ie? document.all.returnToTopButton : document.getElementById? document.getElementById("returnToTopButton") : document.returnToTopButton

function insertimage()
{
	if (ie||document.getElementById)
		watermark_obj.innerHTML='<a href="'+logolink+'"><img src="'+logoimage.src+'" width="'+logowidth+'" height="'+logoheight+'" border=0 alt="'+alttext+'"></a>'
	else if (document.layers)
	{
		watermark_obj.document.write('<a href="'+logolink+'"><img src="'+logoimage.src+'" width="'+logowidth+'" height="'+logoheight+'" border=0 alt="'+alttext+'"></a>')
		watermark_obj.document.close()
	}
}

function positionit()
{
	var dsocleft=ie? document.body.scrollLeft : pageXOffset
	var dsoctop=ie? document.body.scrollTop : pageYOffset
	var window_height=ie? document.body.clientHeight : window.innerHeight

	if (ie||document.getElementById)
	{
		if (parseInt(dsoctop) < (0.5 * parseInt(window_height)))
			hidewatermark;
		else
			showwatermark;

		watermark_obj.style.right=parseInt(dsocleft)+5+Hoffset
		watermark_obj.style.top=parseInt(dsoctop)+parseInt(window_height)-logoheight-Voffset
	}
	else if (document.layers)
	{
		if (dsoctop < (0.5 * window_height))
			hidewatermark;
		else
			showwatermark;

		watermark_obj.right=dsocleft+5+Hoffset
		watermark_obj.top=dsoctop+window_height-logoheight-Voffset
	}
}

function hidewatermark()
{
	if (document.layers)
		watermark_obj.visibility="hide"
	else
		watermark_obj.style.visibility="hidden"
}

function showwatermark()
{
	if (document.layers)
		watermark_obj.visibility="show"
	else
		watermark_obj.style.visibility="visible"
}

function beingwatermark()
{
	watermarkinterval=setInterval("positionit()",50)

	insertimage()

	if (visibleduration!=0)
		setTimeout("hidewatermark()",visibleduration*1000)
}

if (ie||document.getElementById||document.layers)
	window.onload=beingwatermark