msie  = (navigator.appName.indexOf("Microsoft") >= 0);  
nn = (navigator.appName.indexOf("Netscape") >= 0);
ns6 = (document.getElementById)? true:false;

function mouseEvents(mouse,status,dir) {
  if (nn || msie) {
    if (mouse == 'over') {
      if (dir == 'up')
        scroll(status,5);
      else
        scroll(status,-5);
      window.status='scroll '+dir;
    }
    else { // mouse == 'out'
      noScroll();
      window.status='';
    }
  }
}

pSpeed=40; // speed of scrolling
pHeight=100; //height of text you want to show when already scrolled to the bottom

function makeScrollObj(obj,nest){
        nest=(!nest) ? '':'document.'+nest+'.';
				//if (nn){
				//	this.xyz = eval(nest+'document.'+obj);
				//}else if(msie){
				//	this.xyz = eval('document.all.'+obj+'.style');
				//}else if(ns6){
				//	this.xyz = eval('document.getElementById('+obj+').style');
				//}
        this.xyz=(nn) ? eval(nest+'document.'+obj):eval('document.all.'+obj+'.style');
        this.scrollHeight=nn?this.xyz.document.height:eval('document.all.'+obj+'.offsetHeight');
        this.top=b_gettop;
        return this;
}

function b_gettop(){
        var gleft=(nn) ? eval(this.xyz.top):eval(this.xyz.pixelTop);
        return gleft;
}
//Variables
var scrollTim;
//var active=0;
//active is now 1 or 2
function scroll(active,speed){

        clearTimeout(scrollTim);
        way=speed>0?1:0;
        if((!way && pScroll[active].top()>-pScroll[active].scrollHeight+pHeight)||(pScroll[active].top()<0 && way)){
                pScroll[active].xyz.top=pScroll[active].top()+speed;
                scrollTim=setTimeout("scroll("+active+","+speed+")",pSpeed);
								//alert(freccie[0].visibility );
								//freccie[0].visibility = "visible";
        }
				if(pScroll[active].top()==0){
					freccie[0].visibility = "hidden";
				}else{
					freccie[0].visibility = "visible";
				}
				if(pScroll[active].top()<=(-pScroll[active].scrollHeight+pHeight)){
					freccie[1].visibility = "hidden";
				}else{
					freccie[1].visibility = "visible";
				}
				 //if((pScroll[active].top()<0 && way)){
         //       pScroll[active].xyz.top=pScroll[active].top()+speed;
         //       scrollTim=setTimeout("scroll("+active+","+speed+")",pSpeed);
				//				alert("su?");
				 //}
}

function noScroll(){
        clearTimeout(scrollTim);
}

function init(){
				freccie=new Array();
				if(msie){freccie[0] = document.all.frecciasu.style;freccie[1] = document.all.frecciagiu.style;}
				if(nn){freccie[0] = document.frecciasu;freccie[1] = document.frecciagiu;}
        pScroll=new Array();
        pScroll[0]=new  makeScrollObj('mylayer','ContentS');
				//pScroll[1]=new makeScrollObj('NewsC','NewsL');

        //if (ns6){
				//	pScroll[0].xyz.display='block';
				//}else{
				pScroll[0].xyz.visibility='visible';
				//pScroll[1].xyz.visibility='visible';
				//pScroll[0].xyz.visibility='show';
				//pScroll[1].xyz.visibility='show';
				//}
}
function doNothing(){
}
