/**
 * top.js
 * Taken from MercerLink
 * Mercer Inc.
 * JBossMHR
 * Copyright 2007 All Rights Reserved
 * @since 1.0 Dec 12, 2007
 * =============================================================================================
 * $Id: top.js,v 1.2 2008/02/26 09:32:49 priyankas Exp $
 * =============================================================================================
 */
 
var b2tx=70,b2ty=30,b2th='<nobr>[top]</nobr>';
var moz=(document.getElementById&&!document.all)?1:0;
document.write('<div id="bttl" class="bak2top" style="position:absolute;cursor:'+((moz)?'pointer':'hand')+';" onclick="JavaScript:scrollTo(0,0)"><a href="JavaScript:scrollTo(0,0);void(0);"><img src="images/up_arrow.png" border="0"></a></div>');
b2t();

function b2x(){return ((moz)?window.innerWidth-20:getClientWidth())-b2tx;}

function b2y(){
	if (getScrollHeight()) { 
		if (getScrollHeight() == (getClientHeight()+b2o())) {
			window.scrollBy(0,-1);
			return 1;
		}
	}
	return ((moz)?window.innerHeight:getClientHeight())+b2o()-b2ty-20;
}

function b2o(){return (moz)?window.pageYOffset:getScrollTop();}

function b2t(){
	with(document.getElementById('bttl').style) {
		left=((b2o()<1)?-1500:b2x())+'px';
		top=((b2o()<1)?-1500:b2y())+'px';
	}
	setTimeout('b2t()',99);
}


function getScrollHeight() {
var obj;
	if(document.documentElement && document.documentElement.scrollHeight) {
	 obj = document.documentElement.scrollHeight
	}else if (document.body) { // other Explorers
		obj = document.body.scrollHeight;
	 }
	 return obj
}

function getClientWidth() {
var cw;
	if (document.documentElement && document.documentElement.clientWidth) {
		cw = document.documentElement.clientWidth;
	}else if (document.body){
		cw = document.body.clientWidth;
	}
	return cw
}

function getClientHeight() {
var ch;
	if (document.documentElement && document.documentElement.clientHeight) {
		ch = document.documentElement.clientHeight;
	}else if (document.body){
		ch = document.body.clientHeight;
	}
	return ch
}

function getScrollTop() {
var st;
	if(document.documentElement && document.documentElement.scrollTop) {
	 st = document.documentElement.scrollTop
	}else if (document.body) { // other Explorers
		st = document.body.scrollTop;
	 }
	 return st
}