


var currentNewsScrollPos = 0;
var newsScrollArea = 90;
function ScrollUp(){	
	Timer = setInterval("DoScrollUp()", 15);
}
function ScrollDown(){
	//DoScrollDown()
	Timer = setInterval("DoScrollDown()", 15);
}

function DoScrollUp(){
	//alert(currentScrollPos);
	
	if((currentNewsScrollPos-4)<=0){
		currentNewsScrollPos=0;
		document.getElementById('newItemsScrollContainer').scrollTop  = currentNewsScrollPos;
		return;
	}
	else{
		currentNewsScrollPos-=4; 
		document.getElementById('newItemsScrollContainer').scrollTop  = currentNewsScrollPos;
	}
}
function DoScrollDown(){
	if(currentNewsScrollPos>=newsScrollArea){
		currentNewsScrollPos=newsScrollArea;
		document.getElementById('newItemsScrollContainer').scrollTop  = currentNewsScrollPos;
		return;
	}
	else{
		currentNewsScrollPos+=4; 
		document.getElementById('newItemsScrollContainer').scrollTop  = currentNewsScrollPos;	
	}
}












function thumbNailItemClick(ind){
	manualSetCurImg(ind);
}

//add around 35 per thumbnail to the scrollArea total -- 12 is the max of images in the scroller area 
//scrollArea=185 for 9 images --- scrollArea=222 for 10 images ---259 for 11 images---296 for 12 images
var currentScrollPos = 0;
var scrollArea = 296;
function ScrollLeft(){	
	Timer = setInterval("DoScrollLeft()", 15);
}
function ScrollRight(){
	Timer = setInterval("DoScrollRight()", 15);
}

function DoScrollLeft(){
	//alert(currentScrollPos);
	
	if((currentScrollPos-4)<=0){
		currentScrollPos=0;
		document.getElementById('scrollContainer').scrollLeft = currentScrollPos;
		return;
	}
	else{
		currentScrollPos-=4; 
		document.getElementById('scrollContainer').scrollLeft = currentScrollPos;
	}
}
function DoScrollRight(){
	if(currentScrollPos>=scrollArea){
	//alert(currentScrollPos);
		currentScrollPos=scrollArea;
		document.getElementById('scrollContainer').scrollLeft = currentScrollPos;
		return;
	}
	else{
		currentScrollPos+=4; 
		document.getElementById('scrollContainer').scrollLeft = currentScrollPos;	
	}
}


function tSelect(ob,ind){
	ob.style.borderColor='#66ff00';
	var coors = findPos(ob);
	oLayer = document.getElementById("lyrThumbSelectPrev");
    oLayer.style.visibility="visible";
	oLayer.style.position="absolute";
    oLayer.style.left = (coors[0] - 25 - currentScrollPos) + "px";
    oLayer.style.top = (coors[1] - 70) + "px" ;
    
    document.getElementById("imgThumbPreview").src=KAWMainBackgroundImages_preview[ind-1];
    
}
	
	
function tSelectOff(ob){
	ob.style.borderColor='#ffffff';
	oLayer = document.getElementById("lyrThumbSelectPrev");
    oLayer.style.visibility="hidden";

		
}
	
	
	
		
		
function imageOnMouseOver(prodImg){

    oProdImg = document.getElementById(prodImg);
    oLayer = document.getElementById("LayerProdImg");
    oLayer.style.visibility="visible";
    oImg =  document.getElementById("lgProdImg");
    oImg.src="http://www.kawasaki.com/imagesmain/products/action/" + prodImg

    var coors = findPos(oProdImg);

    oLayer.style.position="absolute";
    oLayer.style.left = (coors[0]) + "px";
    oLayer.style.top = (coors[1] + 36) + "px" ;

}

function imageOnMouseOut(){
    oLayer = document.getElementById("LayerProdImg");
    oLayer.style.visibility="hidden";

}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
		
	return [curleft,curtop];
}
