// FUNÇÃO AJAX PARA MUDAR AS ABAS PAGINA CAPA-C
function ajaxDivs(hidDiv,OpenDiv,IdDiv)
{	
	var idDivHid = document.getElementById(hidDiv).value;
	var hiddenDiv = document.getElementById('hiddenDiv').value;
	//coloca a cor bramca de fundo e verde na fonte
	
	//document.getElementById(IdDiv).style.background = '#ffffff';
	document.getElementById(IdDiv).style.backgroundImage = 'url(imagens/btnEndereco.jpg)';
	document.getElementById(IdDiv).style.color =   '#5B9B98';
	// coloca a imagem e muda a cor da fonte
	if(IdDiv!=document.getElementById('hiddenDiv').value)
	{
		document.getElementById(hiddenDiv).style.backgroundImage = 'url(imagens/box002.jpg)';
		document.getElementById(hiddenDiv).style.backgroundPosition = 'bottom';
		document.getElementById(hiddenDiv).style.backgroundRepeat = 'no-repeat';
		document.getElementById(hiddenDiv).style.color ='#ffffff';	
	}
	//
	document.getElementById(idDivHid).style.display = 'none';
	document.getElementById(OpenDiv).style.display = '';
	document.getElementById(hidDiv).value = OpenDiv;
	document.getElementById('hiddenDiv').value = IdDiv;

}
// FUNÇÃO AJAX PARA MUDAR AS ABAS PAGINA CAPA-C
function ajaxDivs2(hidDiv,OpenDiv,IdDiv)
{	
	var idDivHid = document.getElementById(hidDiv).value;
	var hiddenDiv = document.getElementById('hiddenDiv2').value;
	//coloca a cor bramca de fundo e verde na fonte
	document.getElementById(IdDiv).style.backgroundImage = 'url(imagens/btn02.jpg)';
	document.getElementById(IdDiv).style.color =   '#ffffff';
	// coloca a imagem e muda a cor da fonte
	if(IdDiv!=document.getElementById('hiddenDiv2').value)
	{
		document.getElementById(hiddenDiv).style.backgroundImage = 'url(imagens/btn03.jpg)';
		document.getElementById(hiddenDiv).style.backgroundPosition = 'bottom right';
		document.getElementById(hiddenDiv).style.backgroundRepeat = 'no-repeat';
		document.getElementById(hiddenDiv).style.color ='#ffffff';
	}
	//
	document.getElementById(idDivHid).style.display = 'none';
	document.getElementById(OpenDiv).style.display = '';
	document.getElementById(hidDiv).value = OpenDiv;
	document.getElementById('hiddenDiv2').value = IdDiv;
}

defaultStep=3;
step=defaultStep;

//FUNÇÃO PARA DAS SCROLL NAS IMGS
function scrollDivDown(id,img,imgOut,hid,imgSubOut,imgOff)
{
	document.getElementById(id).scrollLeft+=step;
	document.getElementById(imgOut).src = 'imagens/'+imgSubOut+'.jpg';		

	if(document.getElementById(id).scrollLeft==document.getElementById(hid).value)
	{
		document.getElementById(img).src = 'imagens/'+imgOff+'.jpg';
	}	
	
	document.getElementById(hid).value = document.getElementById(id).scrollLeft;
	timerDown=setTimeout("scrollDivDown('"+id+"','"+img+"','"+imgOut+"','"+hid+"','"+imgSubOut+"','"+imgOff+"')",10)
}

function scrollDivUp(id,img,imgOut,imgSubOut,imgOff)
{
	document.getElementById(id).scrollLeft-=step;
	document.getElementById(imgOut).src = 'imagens/'+imgSubOut+'.jpg';
	if(document.getElementById(id).scrollLeft==0)
	{
		document.getElementById(img).src = 'imagens/'+imgOff+'.jpg';
	}
	timerUp=setTimeout("scrollDivUp('"+id+"','"+img+"','"+imgOut+"','"+imgSubOut+"','"+imgOff+"')",10)
}





// função roll over
/*
function mouseOver(idimg,nImg)
{
	document.getElementById(idimg).src = 'imagens/'+nImg+'.jpg';
}
function mouseOut(idimg,nImg)
{
	document.getElementById(idimg).src = 'imagens/'+nImg+'.jpg';
}*/
