// test if scrolltop can be written
function testbrowser2(TreadScroll)
{
//	alert (document.getElementById('maintext').style.width);
//	if (document.getElementById('titleforprint').style.display !='none')
//	{
//		document.getElementById('centrepanel').vAlign='top';
//	}
	if (TreadScroll != 1) 
	{
		return
	}
	if ((navigator.appVersion.indexOf("MSIE") >= 0) && (navigator.appVersion.indexOf("Macintosh") >= 0))
	{
		document.getElementById('scrollothers').style.display='none';
		document.getElementById('others').style.overflow='auto';
		document.getElementById('others').style.styleFloat='none';
	}
	else
	{
		
		if (document.getElementById('others').offsetHeight 	>= document.getElementById('others').scrollHeight)
			{
				document.getElementById('scrollothers').style.visibility='hidden';
			}
		else
			{
				document.getElementById('scrollothers').style.visibility='visible';
			}
	}
}


var current='';
var st=0;
var flg='';
function tscroll(ac,flg)
{
//	document.getElementById('minmenu').innerHTML=document.getElementById('row1').scrollHeight;
	if (current == "stop" && flg=='x')
	{
		current='';
	}
	else
	{
		current='';		
		///****************************************************************************************////
		
		if (ac == "down")
			{
				maxscroll= document.getElementById('others').scrollHeight-50;
				if (st < maxscroll )
					{			
						st=st+1;
						document.getElementById('others').scrollTop=st;
						setTimeout("tscroll('down','x')",5);
					}	
			}
		if (ac == "up")
		{
			if (st >0)
			{
				st=st-1;
				document.getElementById('others').scrollTop=st;			
				setTimeout("tscroll('up','x')",5);
			}
		}
		/*********************************************************************************/
		
			if (ac == "stop")
		{
			current="stop";
		}
		
	}
}


function vscroll(ac,flg)
{
//	document.getElementById('minmenu').innerHTML=document.getElementById('topright2').scrollHeight;
	if (current == "stop" && flg=='x')
	{
		current='';
	}
	else
	{
		current='';
		if (ac == "right")
		{
			maxscroll= document.getElementById('topright1').scrollWidth-40;
			if (st < maxscroll )
			{			
				st=st+1;
				document.getElementById('topright1').scrollTop=st;
				setTimeout("tscroll('right','x')",10);
			}	
		}
		if (ac == "left")
		{
			if (st >0)
			{
				st=st-1;
				document.getElementById('topright1').scrollTop=st;			
				setTimeout("tscroll('left','x')",10);
			}
		}
		if (ac == "stop")
		{
			current="stop";
		}
	}
		
}



	//code taken from
//	http://simon.incutio.com/archive/2004/05/26/addLoadEvent
function addLoadEvent(func) 
	{
  	var oldonload = window.onload;
  	if (typeof window.onload != 'function') 
  		{
    		window.onload = func;
  		}
  	else 
  		{
    		window.onload = function() 
    			{
	      		oldonload();
      			func();
    			}
  		}
		}