// start: mouseover script and image preloader
	
function msover(img,ref)
	{
			document.images[img].src = ref;
	}

function msout(img,ref)
	{
			document.images[img].src = ref;
	}
	
	
// superbrands javascript

var slideTimeOut = null;
var slideShowArray = new Array();
var slideSpeed = 2000;

function doSlide()
{
	if (!slideShowArray.length) return false;
	
	for(var i in slideShowArray)
	{
		var o = document.getElementById(i);
		o.childNodes[slideShowArray[i]].style.display = 'none';
		
		if (slideShowArray[i] == (o.childNodes.length - 1)) slideShowArray[i] = -1;
		o.childNodes[++slideShowArray[i]].style.display = 'inline';
	}
	
	if (slideTimeOut) clearTimeout(slideTimeOut);
	
	slideTimeOut = setTimeout('doSlide()',slideSpeed);
}

function addImageToSlideShow(objId)
{
	slideShowArray[objId] = 0;
	slideShowArray.length++;
	
	

	if (!slideTimeOut)
	{
		slideTimeOut = setTimeout('doSlide()',slideSpeed);
	}
}

function picturePopup(url, width, height)
{
	if(width<800 && height<600)
		window.open(url, "galleryPopup", "toolbar=no, scrollbars=no, resizable=yes, width="+(width+20)+", height="+(height+20));
	else
		window.open(url, "galleryPopup", "toolbar=no, scrollbars=yes, resizable=yes, width=800, height=600");
}


var scrollingObj = null;
var scrollSpeed = 50;
var scrollMove = 0;
var timeOut = null;

function scrollArea(scrollArea, move){
	if (!scrollArea) return false;
	ceaseScroll();
	scrollMove = move;
	scrollingObj = scrollArea;
	doScroll();
}

function doScroll(){
	if (!scrollingObj) return false;
	
	var newTop = (scrollMove + parseInt(document.getElementById(scrollingObj).style.top));
	
	if ((newTop*-1)> document.getElementById(scrollingObj).offsetHeight - document.getElementById(scrollingObj).parentNode.offsetHeight){ 
		ceaseScroll();
		return false;
	}
	
	if (newTop > 0){
		ceaseScroll();
		return false;
	}
	
	document.getElementById(scrollingObj).style.top = newTop + 'px';
	
	if (timeOut) clearTimeout(timeOut);
	timeOut = setTimeout('doScroll()',scrollSpeed);
}

function ceaseScroll(){
	scrollingObj = null;
	scrollMove = 0;
	if (timeOut) clearTimeout(timeOut);
}

				
