AppVer = parseInt(navigator.appVersion);
var ver = navigator.appVersion;
		

//Browsercheck:*/
ie=document.all?1:0
n=document.layers?1:0

//The speed of the timeout between each scroll.
timSpeed=50

//The height of the container (change this when it scrolls to much or to little)
contHeight=135


function makeScrollObj(obj,nest){
	nest=(!nest) ? '':'document.'+nest+'.'										
	this.css=(n) ? eval(nest+'document.'+obj):eval('document.all.'+obj+'.style')							
	this.scrollHeight=n?this.css.document.height:eval('document.all.'+obj+'.offsetHeight')							
	this.top=b_gettop										
	return this
}

//Getting the top for the top method
function b_gettop(){
	var gleft=(n) ? eval(this.css.top):eval(this.css.pixelTop);
	return gleft;
}

//Variables
var scrollTim;
var scrollCarrello;
var active=0;



function scroll(speed){
	clearTimeout(scrollTim)
	way=speed>0?1:0
	if((!way && oScroll[0].top()>-oScroll[0].scrollHeight+contHeight) || (oScroll[0].top()<0 && way)){
		oScroll[0].css.top=oScroll[0].top()+speed
		scrollTim=setTimeout("scroll("+speed+")",timSpeed)
	}
}

function scroll2(speed){
	clearTimeout(scrollCarrello)
	way=speed>0?1:0
	if((!way && oScroll[1].top()>-oScroll[1].scrollHeight+contHeight) || (oScroll[1].top()<0 && way)){
		oScroll[1].css.top=oScroll[1].top()+speed
		scrollTim=setTimeout("scroll2("+speed+")",timSpeed)
	}
}

//Clears the timeout so the scroll stops, this is called onmouseout.
function noScroll(){
	clearTimeout(scrollTim)
}

function noScroll2(){
	clearTimeout(scrollCarrello)
}
/*********************************************************************************
Changes the active layer. Hides the one that's visible and
shows the "new" one. Also set's the new layers top to
0 so it starts at top.
*********************************************************************************/
function changeActive(num){
	oScroll[active].css.visibility='hidden'
	active=num
	oScroll[active].css.top=0
	oScroll[active].css.visibility='visible'
}
/*********************************************************************************
Initilizes the page, makes a oScroll Array and calls the object constructor.
Here you can add as many scrollObjects as you want
*********************************************************************************/
function scrollInit(){
	oScroll=new Array()
	oScroll[0]=new	makeScrollObj('modello','divCont')
	oScroll[0].css.visibility='visible'
}
/*********************************************************************************
Executes the scrollInit function on pageload.
*********************************************************************************/

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

function getbwidth(){
bwidth = (ns4)? innerWidth-16 : document.body.offsetWidth-20;
}

function moveIt(){
	
	window.onresize=resized;
}

function resized(){
	old_bwidth=bwidth
	getbwidth()	
	if(old_bwidth!=bwidth){
		location.reload() //If the width have changed we reload the page.
	}
}




