/* get document height */
function getdh() {
var D = document;
return Math.max(
  Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
  Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
  Math.max(D.body.clientHeight, D.documentElement.clientHeight)
);
}





/* get window height */
function getwh() {
var wh;
if (self.innerHeight) {	// all except Explorer
	wh = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
	wh = document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
	wh = document.body.clientHeight;
}
return wh;
}




/* insert links to top of page */
function tp()
{


docht = getdh();
winht = getwh();

sptp = parseInt(winht*1.5);
limit = docht - winht;

loop = 1;

if(docht > (winht*2)) {
  while ((sptp * loop) < (limit)) {
    placetp = (sptp * loop)+'';
    document.write("<div class='rtop' style='top:",placetp,"px' title='top of page'><a class='top' href='#'>&uarr;</a><\/div>");
    loop = loop + 1;
  }
}

}