//Funtion originally created at maratz.com. Modified by Tim Hettler (timhettler.com)function backToTop() {	var d = document;	var viewport_height = (self.innerHeight) ? self.innerHeight : (document.getElement && document.documentElement.clientHeight) ? document.documentElement.clientHeight : (document.body) ? document.body.clientHeight : 0;	var page_height = d.getElementsByTagName('body')[0].offsetHeight-50;	if(page_height > viewport_height) {		var elem = d.getElementById("maincontent");		var div = document.createElement("div");		div.setAttribute("id","totop");		var a = document.createElement("a");		a.setAttribute("href","#maincontent");		a.appendChild(document.createTextNode("top of page"));		div.appendChild(a);		document.getElementById("rightcol").appendChild(div);	}}addLoadEvent(backToTop);