var stop = false;
var y = 50;

function has_scrollbar(elem_id) {
	elem = document.getElementById(elem_id);
		if (elem.clientHeight < elem.scrollHeight) 
			document.getElementById(elem_id + '_arrows').style.visibility="visible";
		else
			document.getElementById(elem_id + '_arrows').style.visibility="hidden";
  } 
  
function slowScroll(i) {
	mainw = document.getElementById('main');

	if(i==1) { setTimeout ("slowScroll(0)", 3000); }

	if(mainw.scrollTop < 250 && i == 0 && !stop) { 
		mainw.scrollTop = main.scrollTop + 1;
		setTimeout ("slowScroll(0)", y);
		if (y>20) y = y-(51-y);
	}
	
}


function startScrollDown(dest) {
	stop = false;
	scrollDown(dest);
	//test = test + 1;
}

function scrollDown(dest) {
	if(!stop) { 
	mainw = document.getElementById(dest)
	mainw.scrollTop = main.scrollTop + 5;
	setTimeout ("scrollDown('"+dest+"')", 5);
	}
}

function startScrollUp(dest) {
	stop = false;
	scrollUp(dest);
}

function scrollUp(dest) {
	if(!stop) {
	mainw = document.getElementById(dest)
	mainw.scrollTop = main.scrollTop - 5;
	setTimeout ("scrollUp('"+dest+"')", 5);
	}
}

function stopScrolling() {
	stop = true;
}

function fixTitle() {

	if (whichBrs() == 'Safari')
	{
		document.getElementById('title').style.top = -25;
	}
}

function showPopup() {

}


// Browser Detection Javascript
// copyright 1 February 2003, by Stephen Chapman, Felgall Pty Ltd

// You have permission to copy and use this javascript provided that
// the content of the script is not changed in any way.

function whichBrs() {
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("opera") != -1) return 'Opera';
if (agt.indexOf("staroffice") != -1) return 'Star Office';
if (agt.indexOf("webtv") != -1) return 'WebTV';
if (agt.indexOf("beonex") != -1) return 'Beonex';
if (agt.indexOf("chimera") != -1) return 'Chimera';
if (agt.indexOf("netpositive") != -1) return 'NetPositive';
if (agt.indexOf("phoenix") != -1) return 'Phoenix';
if (agt.indexOf("firefox") != -1) return 'Firefox';
if (agt.indexOf("safari") != -1) return 'Safari';
if (agt.indexOf("skipstone") != -1) return 'SkipStone';
if (agt.indexOf("msie") != -1) return 'Internet Explorer';
if (agt.indexOf("netscape") != -1) return 'Netscape';
if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
if (agt.indexOf('\/') != -1) {
if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
return navigator.userAgent.substr(0,agt.indexOf('\/'));}
else return 'Netscape';} else if (agt.indexOf(' ') != -1)
return navigator.userAgent.substr(0,agt.indexOf(' '));
else return navigator.userAgent;
}