<!--

function checar(formulario)
{
for(var i=0;i<formulario.elements.length;i++)
     {
	 var campo=formulario.elements[i];
	 
	 if(campo.type=="text" || campo.type=="hidden" || campo.type=="select" || campo.type=="select-one" || campo.type=="password" || campo.type=="file" || campo.type=="textarea")
	      {
	 	  var obriga=campo.getAttribute('obrigatorio');
	 	  var nomecampoatual=campo.getAttribute('nomecampo');
		  
		  if(obriga==1 && trim(campo.value)=="")
		       {
			   alert("O campo '" + nomecampoatual + "' não pode ficar vazio.");
			   campo.focus();
			   return false;
			   break;
			   }
		  }
	 }
}





function validarnumero()
{
var tecla=window.event.keyCode;
var valor=String.fromCharCode(tecla);

if( ( (parseInt(valor) !=valor) && tecla!=13 && tecla!=46  && tecla!=8 ) || (valor=="."))
	{
	event.returnValue=false;
	}
}


function validardecimal()
{
var tecla=window.event.keyCode;
var valor=String.fromCharCode(tecla);

if (parseInt(valor)!=valor && valor!="-" && valor!="." && event.keyCode!="13")
	{
	event.returnValue=false;
	}
}


function validardecimalbr()
{
var tecla=window.event.keyCode;
var valor=String.fromCharCode(tecla);

if (parseInt(valor)!=valor && valor!="-" && valor!="," && event.keyCode!="13")
	{
	event.returnValue=false;
	}
}






function janela(str) 
{ 
window.open(str, '','toolbar=no, scrollbars=no, left=200, top=150, width=440, height=370'); 
} 


function cadastro() 
{ 
window.open('envia_cadastro.php', '','toolbar=no, scrollbars=no, left=160, top=10, width=480, height=500'); 
} 


function janela_organizacao(str) 
{
var destino='../organizacao.php?organizacao=' + str;

window.open(destino,'','toolbar=no, scrollbars=no, left=200, top=270, width=420, height=230'); 
}

function mostrafoto(str) 
{
window.open(str,'','toolbar=no, scrollbars=yes, left=120, top=50, width=660,height=470'); 
}


function mostraapenasfoto(foto_url) 
{ 

var destino = '../funcoes/mostrafoto.php?foto_url=' + foto_url;

var largura=50;
var altura=50;
var esquerda=(screen.availWidth)/2;
var topo=(screen.availHeight)/2;


if(screen.availWidth<1024 || screen.availHeight<768)
	{
	var temscroll="yes";
	}
else
	{
	var temscroll="no";
	}


window.open(destino, '','toolbar=no, scrollbars=' + temscroll + ', left=' + esquerda + ', top=' + topo + ', width=' + largura + ', height= ' + altura + ''); 
} 




function abre_carrinho() 
{ 

var destino='http://www.andersonbicicletas.com.br/lojavirtual/carrinho.php';

window.open(destino, '','toolbar=no, scrollbars=yes, left=120, top=50, width=640,height=470');

} 


function detalhes_tabela(produto_id) 
{ 

var destino='http://www.andersonbicicletas.com.br/lojavirtual/detalhes.php?produto_id=' + produto_id;

window.open(destino, '','toolbar=no, scrollbars=yes, left=120, top=50, width=640,height=550');

} 


function detalhes_home(variaveis) 
{ 

var destinopop = 'http://www.andersonbicicletas.com.br/lojavirtual/detalhes.php?' + variaveis;

var destinoprincipal='http://www.andersonbicicletas.com.br/lojavirtual/vitrine_frames.php?' + variaveis;

window.open(destinopop, '','toolbar=no, scrollbars=yes, left=120, top=50, width=640,height=550');

window.location.href=destinoprincipal;

} 


function detalhes_coluna_propaganda(variaveis) 
{ 

var destinopop = 'http://www.andersonbicicletas.com.br/lojavirtual/detalhes.php?' + variaveis;

var destinoprincipal='http://www.andersonbicicletas.com.br/lojavirtual/index.php?' + variaveis;

window.open(destinopop, '','toolbar=no, scrollbars=yes, left=120, top=50, width=640,height=550');

parent.location.href=destinoprincipal;

} 


function janela_400_400(endereco) 
{ 

var destino = 'http://www.andersonbicicletas.com.br/foto.php?endereco=';

destino = destino + endereco;

window.open(destino, '','toolbar=no, scrollbars=no, left=0, top=0, width=400, height=400'); 
} 


function janela_640_480(endereco) 
{ 

var destino = 'http://www.andersonbicicletas.com.br/foto.php?endereco=';

destino = destino + endereco;

window.open(destino, '','toolbar=no, scrollbars=no, left=0, top=0, width=640, height=480'); 
} 


function janela_480_640(endereco) 
{ 

var destino = 'http://www.andersonbicicletas.com.br/foto.php?endereco=';

destino = destino + endereco;

window.open(destino, '','toolbar=no, scrollbars=no, left=0, top=0, width=480, height=640'); 
} 


function janela_resultado(endereco) 
{ 

var destino = 'http://www.andersonbicicletas.com.br/resultados/';

destino = destino + endereco;

window.open(destino, '','toolbar=no, scrollbars=1, left=0, top=0, width=770, height=500'); 
} 

function aviso() 
{ 
window.open('http://www.andersonbicicletas.com.br/aviso_importante.htm', '','toolbar=no, scrollbars=0, left=200, top=250, width=400, height=120'); 
} 



function mostra_perfil(perfil)
{
var destino = 'http://www.andersonbicicletas.com.br/mostra_perfil.php?perfil=';

destino = destino + perfil;

window.open(destino, '','toolbar=no, scrollbars=no, left=0, top=0, width=600, height=350'); 
} 


function mostra_perfil_2003(perfil)
{
var destino = 'http://www.andersonbicicletas.com.br/mostra_perfil_2003.php?perfil=';

destino = destino + perfil;

window.open(destino, '','toolbar=no, scrollbars=no, left=0, top=0, width=600, height=350'); 
} 


function mostra_perfil_2004(perfil)
{
var destino = 'http://www.andersonbicicletas.com.br/mostra_perfil_2004.php?perfil=';

destino = destino + perfil;

window.open(destino, '','toolbar=no, scrollbars=no, left=0, top=0, width=600, height=350'); 
} 


function mostra_perfil_2005(perfil)
{
var destino = 'http://www.andersonbicicletas.com.br/mostra_perfil_2005.php?perfil=';

destino = destino + perfil;

window.open(destino, '','toolbar=no, scrollbars=no, left=0, top=0, width=600, height=350'); 
} 


function camisas() 
{ 
window.open('http://www.andersonbicicletas.com.br/tour_camisas.htm', '','toolbar=no, scrollbars=yes, left=150, top=0, width=500, height=430'); 
} 


function classificacao_tour(ano) 
{ 
window.open('http://www.andersonbicicletas.com.br/reportagens/tour_classificacao_' + ano + '.php', '','toolbar=no, scrollbars=yes, left=150, top=0, width=500, height=430'); 
} 


function camisas_giro() 
{ 
window.open('http://www.andersonbicicletas.com.br/giro_camisas.htm', '','toolbar=no, scrollbars=yes, left=150, top=0, width=500, height=430'); 
} 


function mostra_perfil_giro_2004(perfil)
{
var destino = 'http://www.andersonbicicletas.com.br/mostra_perfil_giro_2004.php?perfil=';

destino = destino + perfil;

window.open(destino, '','toolbar=no, scrollbars=no, left=0, top=0, width=600, height=350'); 
} 


function mostra_perfil_giro_2005(perfil)
{
var destino = 'http://www.andersonbicicletas.com.br/mostra_perfil_giro_2005.php?perfil=';

destino = destino + perfil;

window.open(destino, '','toolbar=no, scrollbars=no, left=0, top=0, width=680, height=520'); 
} 


function confirma(destino, mensagem)
{

var quero;

quero=window.confirm(mensagem);

if(quero)
     {
	 window.location.href=destino;
	 }
}


//-->