var totalWidth = 0;
var totalHeight = 0;
function initItemScroll() {
	totalWidth = Element.getWidth('itemScroll');
	new Control.Slider('hSliderButton','hSlider',{
    onSlide:function(v){moveItemScroll(v)},
    onChange:function(v){moveItemScroll(v)}});
}
function moveItemScroll(x) {
	left = Math.round(x*totalWidth);
	$('itemScroll').style.left = '-'+left+'px';
}
function initArmoireScroll() {
	totalHeight = Element.getHeight('armoireItemsScroll');
	new Control.Slider('vScrollButton','vScroll',{axis:'vertical',
    onSlide:function(v){moveArmoireScroll(v)},
    onChange:function(v){moveArmoireScroll(v)}});
}
function moveArmoireScroll(x) {
	topPos = Math.round(x*totalHeight);
	$('armoireItemsScroll').style.top = '-'+topPos+'px';
}
function initNewsScroll() {
	totalHeight = Element.getHeight('newsItemsScroll')-100;
	new Control.Slider('vScrollButton','vScroll',{axis:'vertical',
    onSlide:function(v){moveNewsScroll(v)},
    onChange:function(v){moveNewsScroll(v)}});
}
function moveNewsScroll(x) {
	topPos = Math.round(x*totalHeight);
	$('newsItemsScroll').style.top = '-'+topPos+'px';
}
function swapNav(id,on,upFactor) {
	obj = $(id+'Nav');
	if (on) {
		obj.src=upFactor+"images/nav/"+id+"_over.png";
	} else {
		obj.src=upFactor+"images/nav/"+id+".png";
	}
}

