var speed=5;
var crossobject = "";
var crossobj = "";
var down = 0;
var up = 0;
var contenidoheight = "";
var contenidowidth = "";
var iens6 = "";
var ns4 = "";
var contentheight = "";
var contentwidth = "";

function inici(contenido)
{
	//comprovant quin navegador está fent servir l'usuari...
	iens6=document.all||document.getElementById;
	ns4=document.layers;
	getcontenido_height();
	crossobject=document.getElementById? document.getElementById(contenido) : document.all.contenido;
	contenidoheight=crossobject.offsetHeight;
}

//mou cap avall el contingut
function movedown(){

if (window.moveupvar) clearTimeout(moveupvar)
if (iens6&&parseInt(crossobject.style.top)>=(contenidoheight*(-1)+100))
{
crossobject.style.top=parseInt(crossobject.style.top)-speed+"px";
}
else if (ns4&&crossobject.top>=(contenidoheight*(-1)+100))
{
crossobject.top-= speed;
}
movedownvar=setTimeout("movedown()",20);
}

//mou cap amunt el contingut
function moveup(){
if (window.movedownvar) clearTimeout(movedownvar)
if (iens6&&parseInt(crossobject.style.top)<=0)
crossobject.style.top=parseInt(crossobject.style.top)+speed+"px"
else if (ns4&&crossobject.top<=0)
crossobject.top+=speed
moveupvar=setTimeout("moveup()",20)
}



//para el moviment
function stopscroll(){
if (window.moveupvar) clearTimeout(moveupvar)
if (window.movedownvar) clearTimeout(movedownvar)
}

function getcontenido_height(){
if (iens6)
		contenidoheight=crossobject.offsetHeight;
else if (ns4)
		document.nscontainer.document.nscontenido.visibility="show";
}

function inici2(content2)
{
	//comprovant quin navegador está fent servir l'usuari...
	iens6=document.all||document.getElementById;
	ns4=document.layers;
	getcontent_height();
	crossobj=document.getElementById? document.getElementById(content2) : document.all.content2;
	contentheight=crossobj.offsetHeight;
}

//mou cap avall el contingut
function movedown2(){

if (window.moveup2var) clearTimeout(moveup2var)
if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
{
crossobj.style.top=parseInt(crossobj.style.top)-speed+"px";
}
else if (ns4&&crossobj.top>=(contentheight*(-1)+100))
{
crossobj.top-= speed;
}
movedown2var=setTimeout("movedown2()",20);
}

//mou cap amunt el contingut
function moveup2(){
if (window.movedown2var) clearTimeout(movedown2var)
if (iens6&&parseInt(crossobj.style.top)<=0)
crossobj.style.top=parseInt(crossobj.style.top)+speed+"px"
else if (ns4&&crossobj.top<=0)
crossobj.top+=speed
moveup2var=setTimeout("moveup2()",20)
}



//para el moviment
function stopscroll2(){
if (window.moveup2var) clearTimeout(moveup2var)
if (window.movedown2var) clearTimeout(movedown2var)
}

function getcontent_height(){
if (iens6)
		contentheight=crossobj.offsetHeight;
else if (ns4)
		document.nscontainer2.document.nscontent.visibility="show";
}

