rotator=true; 	// needed for initialising the rotator
n=0;			// initialising the first image 
// The images, add and delete yours here...
theImages="img/slide/0.png, img/slide/1.png, img/slide/2.png, img/slide/3.png, img/slide/4.png, img/slide/5.png, img/slide/6.png, img/slide/7.png, img/slide/8.png, img/slide/9.png".split(", ");
allImages=theImages.length;
// Creating the needed image objects => preloading
imgObjects=new Array();
for (i in theImages){
	imgObjects[i]=new Image();
	imgObjects[i].src=theImages[i];
	}
/* --------------------------------------------------------------------
 *	function autoplay() 
 *  Allows to automatically change the images.
 *  Options:
 *    run - can be 1 or 0, 1 starts the play, 0 ends it 
 *    srcimage - defines the image that will be replaced by the others
 *    direction - 1 forward -1 backward
 *    speed - speed in milliseconds
 *  requires the function rotate()
 * --------------------------------------------------------------------*/
function autoplay(run,srcimage,direction,speed){
	// delete old settings
	clearInterval(rotator)
	if (run != 0){rotator=setInterval("rotate('"+srcimage+"',"+direction+")",speed)}
	else{clearInterval(rotator)}
	}

/* --------------------------------------------------------------------
 *	function rotate() 
 *  Allows to change the source image to the next or last in the list.
 *  Options:
 *    srcimage - defines the image that will be replaced by the others
 *    direction - 1 forward -1 backward
 * --------------------------------------------------------------------*/
function rotate(srcimage,direction){

n=n+direction;
if (n==allImages) n=0;
if (n==-1) n=allImages-1;
document.images[srcimage].src=imgObjects[n].src;
}

function loadSwf(larg,alt,swf){
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='"+larg+"' height='"+alt+"' id='barra' align='middle'><param name='allowScriptAccess' value='sameDomain' /><param name='movie' value='img/"+swf+".swf' /><param name='quality' value='high' /><param name='wmode' value='transparent'><param name='scale' value='default' /><param name='menu' value='false'><param name='bgcolor' value='#eaf9e8' /><embed src='img/"+swf+".swf' quality='high' scale='default' bgcolor='#eaf9e8' width='"+larg+"' height='"+alt+"' name='barra' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' wmode='transparent'/></object>");	
}

function playSlide(){ play_slide.style.display = "none"; stop_slide.style.display = "block";	}
function stopSlide(){ stop_slide.style.display = "none"; play_slide.style.display = "block";	}
// JavaScript Document



function fadeOut(id, time) {
	target = document.getElementById(id);
	alpha = 100;
	timer = (time*1000)/50;
	var i = setInterval(
			function() {
				if (alpha <= 0)
					clearInterval(i);
				setAlpha(target, alpha);
				alpha -= 2;
			}, timer);
}

function fadeIn(id, time) {
	target = document.getElementById(id);
	alpha = 0;
	timer = (time*1000)/50;
	var i = setInterval(
			function() {
				if (alpha >= 100)
					clearInterval(i);
				setAlpha(target, alpha);
				alpha += 2;
			}, timer);
}

function setAlpha(target, alpha) {
	target.style.filter = "alpha(opacity="+ alpha +")";
	target.style.opacity = alpha/100;
}

// JavaScript Document
var erro = "Por favor preencha o campo ";

///////CODIGO V1.2 Criado Por Isaac Victor\\\\\\\\\\\\
///////////////////COPYRIGHT 2008\\\\\\\\\\\\\\\\\\\\\

////////////////////////////////Funções para trocar o cpf eo cnpj\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
function trocar(){

if(div_cpf.style.display == "none"){
div_cpf.style.display = "block";
div_cnpj.style.display = "none";

}

}
function trocar2(){

if(div_cnpj.style.display == "none"){
div_cpf.style.display = "none";
div_cnpj.style.display = "block";

} 
}

///////////////////////////////Funções para trocar a numeração adulta e infantil!\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
function trocar3(){
	
		infantil.style.display = "block";
		adulto.style.display = "none";
		adulto_erro.style.display = "block";
		infantil_erro.style.display = "none";
		
}
function preencher_campos(){
	if(document.form1.q_2526.value == "" || document.form1.q_2728.value == "" || document.form1.q_2930.value == "" || document.form1.q_3132.value == "" || document.form1.q_3334.value == "" || document.form1.q_3536.value == "" || document.form1.q_3738.value == "" || document.form1.q_3940.value == "" || document.form1.q_4142.value == "" || document.form1.q_4344.value == ""){
	
document.form1.q_2526.value = "0";
document.form1.q_2728.value = "0";
document.form1.q_2930.value = "0";
document.form1.q_3132.value = "0";
document.form1.q_3334.value = "0";
document.form1.q_3536.value = "0";
document.form1.q_3738.value = "0";
document.form1.q_3940.value = "0";
document.form1.q_4142.value = "0";
document.form1.q_4344.value = "0";
}
}
function total2() {		
document.form1.total_infan.value = eval(document.form1.q_2526.value +"+"+ document.form1.q_2728.value +"+"+ document.form1.q_2930.value +"+"+ document.form1.q_3132.value);
}

function total() {		


document.form1.total_adul.value = eval(document.form1.q_2526.value +"+"+ document.form1.q_2728.value +"+"+ document.form1.q_2930.value +"+"+ document.form1.q_3132.value +"+"+ document.form1.q_3334.value +"+"+ document.form1.q_3536.value +"+"+ document.form1.q_3738.value +"+"+ document.form1.q_3940.value +"+"+ document.form1.q_4142.value +"+"+ document.form1.q_4344.value);
}


function trocar4(){
	if(adulto.style.display == "none"){
		adulto.style.display = "block";
		infantil.style.display = "none";
		adulto_erro.style.display = "none";
		infantil_erro.style.display = "block";
		}
}

//////////////////////////////////Funções para trocar o MENU TNT\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
function trocar5() {
	if(tnt.style.display == "none"){
		tnt.style.display = "block";
		document.form1.cor_tnt.value = "";
		document.form1.tnt_imp.value = "";
		document.form1.tnt_nulo.value = "Sim";
		
	}
}

function trocar6() {
	if(tnt.style.display == "block"){
		tnt.style.display = "none";
		document.form1.cor_tnt.value = "-------";
		document.form1.tnt_imp.value = "-------";
		document.form1.tnt_nulo.value = "N&atilde;o";
	}
}


///////////////////////////////////////Função Para as Alças SIM/NÃO\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
function alca_sim() {
		document.form1.alcas_nulo.value = "Sim";
}

function alca_nao() {
	document.form1.alcas_nulo.value = "N&atilde;o";
}

//////////////////////////////Funções de validar as caixas de testo do form de pedidos\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
function verificar(){
if(document.form1.texto.value == "" || document.form1.texto.value.length < 10){
alert(erro + "NOME completo!");
document.form1.texto.focus();
return false;
}
if(document.form1.endereco.value == "" || document.form1.endereco.value.length < 10){
alert(erro + "ENDERECO completo!");
document.form1.endereco.focus();
return false;
}

if(document.form1.bairro.value == "" || document.form1.bairro.value.length < 3){
alert(erro + "BAIRRO completo!");
document.form1.bairro.focus();
return false;
}


if(document.form1.cidade.value == ""){
alert(erro + "CIDADE completo!");
document.form1.cidade.focus();
return false;
}

if(document.form1.cep.value == "" || document.form1.cep.value.length < 9){
alert(erro + "CEP completo!");
document.form1.cep.focus();
return false;
}

if(document.form1.estado.value == ""){
alert(erro + "ESTADO completo!");
document.form1.estado.focus();
return false;
}



if(document.form1.telefone1.value == ""){
alert(erro + "DDD completo!");
document.form1.telefone1.focus();
return false;
}

if(document.form1.telefone2.value == "" || document.form1.telefone2.value.length < 5){
alert(erro + "TELEFONE completo!");
document.form1.telefone2.focus();
return false;
}

if(document.form1.email.value == "" || document.form1.email.value.indexOf("@") == -1 || document.form1.email.value.indexOf(".") == -1){
alert(erro + "EMAIL completo!");
document.form1.email.focus();
return false;
}


if(document.form1.empresa.value == ""){
document.form1.empresa.value = "-------";
}
/////////////////////////////////////////////////////////////// CPF E CNPJ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
if(document.form1.cpf.value == ""){
document.form1.cpf.value = "-------";
}
if(document.form1.rg.value == ""){ 
document.form1.rg.value = "-------";
}

if(document.form1.cnpj.value == ""){
document.form1.cnpj.value = "-------";
}
if(document.form1.ie.value == ""){
document.form1.ie.value = "-------";
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


if(document.form1.modelo.value == ""){
alert(erro + "MODELO corretamente!");
document.form1.modelo.focus();
return false;
		}

if(document.form1.cor_imp.value == ""){
alert(erro + "COR DA IMPRESSAO corretamente!");
document.form1.cor_imp.focus();
return false;
}

}


///////////////////////////////////////Função do menu orçamento\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\    
function verificar2(){
	if(document.form1.texto.value == "" || document.form1.texto.value.length < 10){
alert(erro + "NOME completo!");
document.form1.texto.focus();
return false;
}

if(document.form1.cep.value == ""){
alert(erro + "CEP completo!");
document.form1.cep.focus();
return false;
}
	
	if(document.form1.cidade.value == ""){
alert(erro + "CIDADE completo!");
document.form1.cidade.focus();
return false;
}

if(document.form1.telefone1.value == ""){
alert(erro + "DDD completo!");
document.form1.telefone1.focus();
return false;
}

if(document.form1.telefone2.value == "" || document.form1.telefone2.value.length < 5){
alert(erro + "TELEFONE completo!");
document.form1.telefone2.focus();
return false;
}

if(document.form1.email.value == "" || document.form1.email.value.indexOf("@") == -1 || document.form1.email.value.indexOf(".") == -1){
alert(erro + "EMAIL completo!");
document.form1.email.focus();
return false;
}

}

///////////////////////////////////Função Para Abrir Imagem\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

function abrir(theURL,winName,features) { 
window.open(theURL,winName,features);


}


/////////////////////////////////////////Mudar texto de botao\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
function mudar() {
	document.form1.button.value = "Enviar pedido Sr(a) " + document.form1.texto.value;
}

function swfNulo(){
	banner_index.style.display = "none";
	
}