function troca(x){
document.getElementById(x).src = "/css/img/"+x+"a.jpg";
}
function troca_(x){
document.getElementById(x).src = "/css/img/"+x+".jpg";
}

function embeds(url,w,h){
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+w+'" height="'+h+'">');
document.write('<param name="movie" value="'+url+'">');
document.write('<param name="quality" value="high">');
document.write('<param name="wmode" value="transparent">');
document.write('<embed src="'+url+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'" wmode="transparent"></embed>');
document.write('</object>');
}


function comprar(){
document.pedido.submit();
}



function popup(x,y,z,w){
window.open(x,'janela','width='+y+',height='+z+',scrollbars='+w+'');

}




fotos=new Array();
texto_fotos=new Array();
alt_fotos=new Array();
link_fotos=new Array();
	xf=0;
	
	function galeria(d){
		
	if(d=="vai"){xf=xf+1;if(xf>=total){xf=0;}}
	if(d=="volta"){xf=xf-1;if(xf<0){xf=total-1;}}
	if(d=="1"){xf=0;}
	if(d=="2"){xf=1;}
	if(d=="3"){xf=2;}
	if(d=="4"){xf=3;}
	
	for(ty=0;ty<4;ty++){
  document.getElementById("aba"+ty).style.color = "#ffffff";
  }
  document.getElementById("aba"+xf).style.color = "#be6058";
	
	//document.getElementById("galeria").innerHTML="<img src=\""+fotos[xf]+"\" width=\"539\" height=\"229\" ><br>";
img=fotos[xf];
abrePagina( img );
	}


		function abrePagina( img )
{
    carregar = new Image();
    carregar.src = img;
    document.getElementById("galeria").innerHTML = "Carregando...";
    setTimeout( "verificaCarregamento()", 100 );
}

function verificaCarregamento()
{
    if( carregar.complete )
    {
        document.getElementById("galeria").innerHTML = "<a href=\""+link_fotos[xf]+"\"><img src=\"" + carregar.src + "\" width=\"560\" height=\"280\" alt=\""+alt_fotos[xf]+"\"  title=\""+alt_fotos[xf]+"\" /></a>";
        document.getElementById("texto_destaque").innerHTML = "<a href=\""+link_fotos[xf]+"\" class=\"aba\">"+texto_fotos[xf]+"</a>";
    }
    else
    {
        setTimeout( "verificaCarregamento()", 100 );
    }
}

function buscar_marca(){
if(document.busca_marca.marcas.value != ""){document.busca_marca.submit();}
}

function buscar(){
if(document.buscador.busca.value != ""){document.buscador.submit();}else{alert("Digite um termo no campo busca");document.buscador.busca.focus();}
}


