var bIE = navigator.userAgent.indexOf("MSIE") != -1;
function checkScrollPos(){
	var _nScrollY = (bIE) ? document.body.scrollTop : window.pageYOffset;
	return _nScrollY;
}
function checkInnerHeight(){
if (document.all && document.getElementById && (document.compatMode=='CSS1Compat')) {
	var _nHeight = document.documentElement.clientHeight;
} else {
	var _nHeight = (bIE) ? document.body.clientHeight : window.innerHeight;
}
	return _nHeight;
}
function pageTop(){
	var _tScroll = setTimeout("pageTop()", 20);
	var _nScrollY = (bIE) ? document.body.scrollTop : window.pageYOffset;
	var _nY = _nScrollY+(0 -_nScrollY)*0.3;
	window.scrollTo(0,_nY);
	if(_nY <= 1){
		clearTimeout(_tScroll);
		window.scrollTo(0,0);
	}
}
function pageScrollToTop(){
	var speed1 = 2;
	var speed2 = 5;
	var sec = 20;
	var y;
	var cy;
	var gy = 0;
	var scrollEngine;
	if(document.all){
		cy = document.body.scrollTop;
	}
	else if(document.layers || document.getElementById){
		cy = pageYOffset;
	}
	y = cy-gy;
	if(Math.abs(y)>50){
		cy = Math.round(cy-(y/speed1));
		window.scroll(0,cy);
		scrollEngine = setTimeout("pageScrollToTop()",sec);	
	}else if(Math.abs(y)>2){
		cy = Math.round(cy-(y/speed2));
		window.scroll(0,cy);
		scrollEngine = setTimeout("pageScrollToTop()",sec);	
	}else{
		window.scroll(0,0);
		clearTimeout(scrollEngine);
	}
}


function setImgHeight (H) {
    var ua = navigator.userAgent;
    var bFF3 = false;
    if (ua.match(/Gecko/)) {
        if (ua.match(/(Firebird|Firefox)\/([\.\d]+)/)) {
            if (ua.match(/Firefox\/3/)) {
                bFF3 = true;
            }
        }
    }
    
    if(bFF3){
	    document.getElementById("heightAdjuster").style.height = H + "px";
    }else{
		document.getElementById("heightAdjuster").style.height = H + "px";
		document.getElementById("base").style.height = H + "px";
		document.body.style.height =  "100%";    
    }
}
