var active;
var hide;
var ready = 1;
var o=1;
var ch=1;
var scrolltimerdown = 0;
var scrolltimerup = 0;

var text = new Array(10);

function show_menu(n){
	if (ready) {
	hide_menu();
	document.getElementById('rf' + n).style.display='block';
	active=n;
	}
}

function hide_menu(){
	if (ready) {
	if ( active ) {
		document.getElementById('rf' + active).style.display='none';
		active=0;
	}
	}
}

function post_menu(n){
	if (ready) {
	hide=0;
	show_menu(n);
	}
}

function queue_unpost(){
	if (ready) {
	if ( active ) {
		hide = 1;
		setTimeout(unpost_menu, 100);
	}
	}
}

function unpost_menu(){
	if (ready) {
	if ( hide ) {
		hide_menu();
		hide = 0;
	}
	}
}

function show_cont(n,m){
	ready = 1;
	queue_unpost();
	post_menu(n);
	ready = 0;
	o.innerHTML = text[m];
	initScroll();
}
function hide_cont() {
	ready = 1;
	if ( active ) {
		hide = 1;
		unpost_menu();
	}
}

function initScroll () {
	o=document.getElementById('txt');
	o.style.top=0;
	ch=o.offsetHeight;
	ch = parseInt(ch) - 180;
//			alert (ch);
}

	function scrolldown () {
	if (parseInt(o.style.top) > -ch) {
		o.style.top = parseInt(o.style.top) - 5;
		scrolltimerdown = setTimeout("scrolldown()",15);
	}
}

	function scrollup () {
	if (parseInt(o.style.top) < 0) {
		o.style.top = parseInt(o.style.top) + 5;
		scrolltimerup = setTimeout("scrollup()",15);
	}
	else
	{
		o.style.top = 0;
	}
	
}

	function sd () {
  if (scrolltimerdown)
  	{clearTimeout(scrolltimerdown)};
}
	function su () {
  if (scrolltimerup)
  	{clearTimeout(scrolltimerup)};
}


function NewWindow (url, win_name, w, h) {
	newWin = window.open(url, win_name, "toolbar=no,scrollbars=yes,directories=no,status=no,menubar=no,resizable=yes,width=" + w + ",height=" + h);
	newWin.focus();
}