//edit the below 5 steps

// 1) substitute 116 and 42 with the width and height of your logo image, respectively
var logowidth=12
var logoheight=34
var logoimage=new Image(logowidth,logoheight)

// 2) change the image path to reflect the path of your logo image
logoimage.src="http://pcl.wfu.edu/images/backtotop.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 perpetually visible. 
var visibleduration=0;

// Optional parameters
var Hoffset=175 //Enter logo's offset from left edge of window (edit only if you don't like the default offset)
var Voffset=30 //Enter logo's offset from bottom edge of window (edit only if you don't like the default offset)

///////////////////////////Do not edit below this line/////////////////////////

var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1

var BackToTop_obj=ie? document.all.BackToTop : document.getElementById? document.getElementById("BackToTop") : document.BackToTop

function insertimage(){
if (ie||document.getElementById)
BackToTop_obj.innerHTML='<a href="../%27+logolink+%27"><img src="../%27+logoimage.src+%27" width="'+logowidth+'" height="'+logoheight+'" border=0 alt="'+alttext+'"></a>'
else if (document.layers){
BackToTop_obj.document.write('<a href="../%27+logolink+%27"><img src="../%27+logoimage.src+%27" width="'+logowidth+'" height="'+logoheight+'" border=0 alt="'+alttext+'"></a>')
BackToTop_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){
	BackToTop_obj.style.visibility="hidden";
	BackToTop_obj.style.left=parseInt(dsocleft)+5+Hoffset
	BackToTop_obj.style.top=parseInt(dsoctop)+parseInt(window_height)-logoheight-Voffset
	if (document.body.scrollTop != 0) {
		BackToTop_obj.style.visibility="visible";
	}
	else {
		BackToTop_obj.style.visibility="hidden";
	}
}
else if (document.getElementById){
	BackToTop_obj.style.left=parseInt(dsocleft)+5+Hoffset
	BackToTop_obj.style.top=parseInt(dsoctop)+parseInt(window_height)-logoheight-Voffset
	if (window.pageYOffset != 0) {
		BackToTop_obj.style.visibility="visible";
	}
	else {
		BackToTop_obj.style.visibility="hidden";
	}
}
else if (document.layers){
	BackToTop_obj.left=dsocleft+5+Hoffset
	BackToTop_obj.top=dsoctop+window_height-logoheight-Voffset
	if (window.pageYOffset != 0) {
		BackToTop_obj.visibility="visible";
	}
	else {
		BackToTop_obj.visibility="hide";
	}
}
}

function hideBackToTop(){
if (document.layers)
BackToTop_obj.visibility="hide"
else
BackToTop_obj.style.visibility="hidden"
clearInterval(BackToTopinterval)
}

function showBackToTop(){
BackToTopinterval=setInterval("positionit()",50)
insertimage()
if (visibleduration!=0)
setTimeout("hideBackToTop()",visibleduration*1000)
}

if (ie||document.getElementById||document.layers)
window.onload=showBackToTop
