function goTo(l) {
		
		//alert(l);
			
			w = screen.availWidth;
		
			if (screen.availHeight < 1100) {
				w = screen.availWidth - 15;
			}
			
			
			if (screen.availWidth < 1004) {
				w = '1250';
			}
			
			if(l==0){
				$('#menuHome').hide();
				$('#menuHome2').show();
				
				$('#menuQuem').show();
				$('#menuQuem2').hide();
				
				$('#menuPort').show();
				$('#menuPort2').hide();
				
				$('#menuCliente').show();
				$('#menuCliente2').hide();
			}
			
			if(l==1){
				carregaHistorico();
				
				$('#menuHome').show();
				$('#menuHome2').hide();
				
				$('#menuQuem').hide();
				$('#menuQuem2').show();
				
				$('#menuPort').show();
				$('#menuPort2').hide();
				
				$('#menuCliente').show();
				$('#menuCliente2').hide();
			}
			
			if(l==2){
				carregaImpressos();
				
				$('#menuHome').show();
				$('#menuHome2').hide();
				
				$('#menuQuem').show();
				$('#menuQuem2').hide();
				
				$('#menuPort').hide();
				$('#menuPort2').show();
				
				$('#menuCliente').show();
				$('#menuCliente2').hide();
			}
			
			if(l==3){
				$('#menuHome').show();
				$('#menuHome2').hide();
				
				$('#menuQuem').show();
				$('#menuQuem2').hide();
				
				$('#menuPort').show();
				$('#menuPort2').hide();
				
				$('#menuCliente').hide();
				$('#menuCliente2').show();
			}
            
            l = l * w;
			
			//alert(l);
            
			$('#Conteudo').scrollTo( l+'px', 800 );
			
			
        }
		
		function goTo2() {
		
		//alert(l);
			
			w = screen.availWidth;
		
			$("body").scrollTo({top: "820", left: "0"}, 800);

			
        }
		
		
		function carregaHistorico() {
		
		//alert(l);
			
			$('#ConteudoQuem').html("<table width='627' border='0' cellspacing='0' cellpadding='0'><tr><td width='627' height='300' align='center' valign='middle'><img src='imagens/load-site.gif' width='412' height='199' alt='Loading'></td></tr></table>");
			$('#ConteudoQuem').load("historico.php");
			$('#BtPremios').css("background-position", "0px -160px");
			$('#BtEquipe').css("background-position", "0px -80px");
			$('#BtHistorico').css("background-position", "0px -40px");
			
        }
		
		function carregaEquipe() {
		
		//alert(l);
			
			$('#ConteudoQuem').html("<table width='627' border='0' cellspacing='0' cellpadding='0'><tr><td width='627' height='300' align='center' valign='middle'><img src='imagens/load-site.gif' width='412' height='199' alt='Loading'></td></tr></table>");
			$('#ConteudoQuem').load("equipe.php");
			$('#BtHistorico').css("background-position", "0px 0px");
			$('#BtPremios').css("background-position", "0px -160px");
			$('#BtEquipe').css("background-position", "0px -120px");
			
        }
		
		function carregaEquipePagina(a) {
		
		//alert(l);
			
			$('#ConteudoQuem').html("<table width='627' border='0' cellspacing='0' cellpadding='0'><tr><td width='627' height='300' align='center' valign='middle'><img src='imagens/load-site.gif' width='412' height='199' alt='Loading'></td></tr></table>");
			$('#ConteudoQuem').load("equipe.php?p="+a);
			
        }
		
		function carregaPremios() {
		
		//alert(l);
			
			$('#ConteudoQuem').html("<table width='627' border='0' cellspacing='0' cellpadding='0'><tr><td width='627' height='300' align='center' valign='middle'><img src='imagens/load-site.gif' width='412' height='199' alt='Loading'></td></tr></table>");
			$('#ConteudoQuem').load("premios.php");
			$('#BtHistorico').css("background-position", "0px 0px");
			$('#BtEquipe').css("background-position", "0px -80px");
			$('#BtPremios').css("background-position", "0px -200px");
			
        }
		
		function carregaPremiosPagina(a) {
		
		//alert(l);
			
			$('#ConteudoQuem').html("<table width='627' border='0' cellspacing='0' cellpadding='0'><tr><td width='627' height='300' align='center' valign='middle'><img src='imagens/load-site.gif' width='412' height='199' alt='Loading'></td></tr></table>");
			$('#ConteudoQuem').load("premios.php?p="+a);
			
        }
		
		
		
		//
		
		function carregaImpressos() {
		
		//alert(l);
			$("#BoxFilme").html('');
			$("#BoxRadio").html('');
			$("#BoxInternet").html('');
			
			$("#BoxFilme").hide('slow');
			$("#BoxRadio").hide('slow');
			$("#BoxInternet").hide('slow');
			
			$('#BoxImpresso').show('slow', function() {
				$('#BoxImpresso').html("<table width='739' border='0' cellspacing='0' cellpadding='0'><tr><td width='739' height='383' align='center' valign='middle'><img src='imagens/load-site.gif' width='412' height='199' alt='Loading'></td></tr></table>");
				$('#BoxImpresso').load("impressos.php");
			});
			
        }
		
		function carregaImpressoPagina(a) {
		
		//alert(l);
			
			$('#BoxImpresso').html("<table width='739' border='0' cellspacing='0' cellpadding='0'><tr><td width='739' height='383' align='center' valign='middle'><img src='imagens/load-site.gif' width='412' height='199' alt='Loading'></td></tr></table>");
			$('#BoxImpresso').load("impressos.php?p="+a);
			
        }
		
		function carregaFilmes() {
		
		//alert(l);
			$("#BoxImpresso").html('');
			$("#BoxRadio").html('');
			$("#BoxInternet").html('');
			
			$("#BoxImpresso").hide('slow');
			$("#BoxRadio").hide('slow');
			$("#BoxInternet").hide('slow');
			
			$('#BoxFilme').show('slow', function() {
				$('#BoxFilme').html("<table width='739' border='0' cellspacing='0' cellpadding='0'><tr><td width='739' height='383' align='center' valign='middle'><img src='imagens/load-site.gif' width='412' height='199' alt='Loading'></td></tr></table>");
				$('#BoxFilme').load("filmes.php");
			});
			
			
			
        }
		
		function carregaFilmePagina(a) {
		
		//alert(l);
			
			$('#BoxFilmeLista').html("<table width='320' border='0' cellspacing='0' cellpadding='0'><tr><td width='320' height='292' align='center' valign='middle'><img src='imagens/load-site.gif' width='320' height='199' alt='Loading'></td></tr></table>");
			$('#BoxFilmeLista').load("filmeslista.php?p="+a);
			
        }
		
		function carregaClientesPagina(a) {
		
		//alert(l);
			
			$('#ListaCliente').html("<table width='727' border='0' cellspacing='0' cellpadding='0'><tr><td width='727' height='350' align='center' valign='middle'><img src='imagens/load-site.gif' width='320' height='199' alt='Loading'></td></tr></table>");
			$('#ListaCliente').load("clientes.php?p="+a);
			
        }
		
		function carregaVideo(a) {
		
		//alert(l);
			
				$('#PlayVideo').html("<table width='399' border='0' cellspacing='0' cellpadding='0'><tr><td width='399' height='275' align='center' valign='middle'><img src='imagens/load-site.gif' width='412' height='199' alt='Loading'></td></tr></table>");
				$('#PlayVideo').load("playvideo.php?video="+a);
			
        }
		
		function carregaRadios() {
		
		//alert(l);
			$("#BoxImpresso").html('');
			$("#BoxFilme").html('');
			$("#BoxInternet").html('');
		
			$("#BoxImpresso").hide('slow');
			$("#BoxFilme").hide('slow');
			$("#BoxInternet").hide('slow');
			
			$('#BoxRadio').show('slow', function() {
				$('#BoxRadio').html("<table width='739' border='0' cellspacing='0' cellpadding='0'><tr><td width='739' height='383' align='center' valign='middle'><img src='imagens/load-site.gif' width='412' height='199' alt='Loading'></td></tr></table>");
				$('#BoxRadio').load("radios.php");
			});
			
        }
		
		function carregaRadioPagina(a) {
		
		//alert(l);
			
			$('#BoxRadio').html("<table width='739' border='0' cellspacing='0' cellpadding='0'><tr><td width='739' height='383' align='center' valign='middle'><img src='imagens/load-site.gif' width='412' height='199' alt='Loading'></td></tr></table>");
			$('#BoxRadio').load("radios.php?p="+a);
			
        }
		
		function carregaInternet() {
		
		//alert(l);
			$("#BoxImpresso").html('');
			$("#BoxFilme").html('');
			$("#BoxRadio").html('');
		
			$("#BoxImpresso").hide('slow');
			$("#BoxFilme").hide('slow');
			$("#BoxRadio").hide('slow');
			
			$('#BoxInternet').show('slow', function() {
				$('#BoxInternet').html("<table width='739' border='0' cellspacing='0' cellpadding='0'><tr><td width='739' height='383' align='center' valign='middle'><img src='imagens/load-site.gif' width='412' height='199' alt='Loading'></td></tr></table>");
				$('#BoxInternet').load("internet.php");
			});
			
        }
		
		function carregaInternetPagina(a) {
		
		//alert(l);
			
			$('#BoxInternet').html("<table width='739' border='0' cellspacing='0' cellpadding='0'><tr><td width='739' height='383' align='center' valign='middle'><img src='imagens/load-site.gif' width='412' height='199' alt='Loading'></td></tr></table>");
			$('#BoxInternet').load("internet.php?p="+a);
			
        }
		
		
	function iniciaSite() {
			
			mexeBallom();
            
			$("#carregando").css({
                    display: 'none'
        	});
			
			$("#corpoSiteFundo").css({
                    display: 'block'
        	});
            
			
			$("#LogoArteCapital").animate({
			opacity: 1,
			paddingTop: "38px",
				'filter': ''
			}, 1500, function() {
    			// Animation complete.
				carregaMenu()
  			});
			
			carregaHistorico();
			carregaImpressos();
			$('#ListaCliente').load("clientes.php");
			
			
        }
		
		function mexeBallom() {
			
			$("#ballom").animate({
			paddingTop: "5px"
			}, 1500, function() {
    			// Animation complete.
				$("#ballom").animate({
				paddingTop: "0px"
				}, 1500, function() {
    			// Animation complete.
				mexeBallom()
  				});
  			});
			
		}
		
		function carregaMenu() {
            
            $("#menuHome").animate({
				opacity: 1,
				marginTop: "70px"
				}, 800);
				
			$("#menuQuem").animate({
				opacity: 1,
				marginTop: "70px"
				}, 900);
				
			$("#menuPort").animate({
				opacity: 1,
				marginTop: "70px"
				}, 1000);
				
			$("#menuCliente").animate({
				opacity: 1,
				marginTop: "70px"
				}, 1100);
				
			$("#menuContato").animate({
				opacity: 1,
				marginTop: "70px"
				}, 1200);
			
			$("#menuBlog").animate({
				opacity: 1,
				marginTop: "70px"
				}, 1300, function() {
    			// Animation complete.
				$("#Slideshow").animate({
				opacity: 1,
				'filter': ''
				}, 1000, function() {
					// Animation complete.
					$("#bts").animate({
					opacity: 1,
					marginTop: "0px"
					}, 1000 );
  				});
  			});
			
			$('#menuHome').hide();
			$('#menuHome2').show();
			
        }
		
		
		
		

		
		
		function carregaBts() {
            
            $("#btfacebook").animate({
				width: "113px",
				'filter': ''
				}, 300);
				
			$("#bttwitter").animate({
				width: "112px",
				'filter': ''
				}, 300);
				
			$("#btnovidades").animate({
				width: "165px",
				'filter': ''
				}, 300);
			
        }
		
		function escondeBts() {
			
			$('#boxnovidade').hide();
            
            $("#btfacebook").animate({
				width: "20px",
				'filter': ''
				}, 200);
				
			$("#bttwitter").animate({
				width: "24px",
				'filter': ''
				}, 200);
				
			$("#btnovidades").animate({
				width: "47px",
				'filter': ''
				}, 200);
			
        }
		
		
		function funcoes(){
		
		
		
		
			
		//Set Default State of each portfolio piece
	$(".paging").show();
	$(".paging a:first").addClass("active");
		
	//Get size of images, how many there are, then determin the size of the image reel.
	var imageWidth = $(".window").width();
	//alert('Window = '+ imageWidth);
	var imageSum = $(".image_reel img").size();
	//alert('Imagem = '+ imageSum);
	var imageReelWidth = imageWidth * imageSum;
	//alert('Corpo = '+ imageReelWidth);
	
	//Adjust the image reel to its new size
	$(".image_reel").css({'width' : imageReelWidth});
	
	//Paging + Slider Function
	rotate = function(){	
		var triggerID = $active.attr("rel") - 1; //Get number of times to slide
		var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide
		//alert(image_reelPosition);
		$(".paging a").removeClass('active'); //Remove all active class
		$active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function)
		
		//Slider Animation
		$(".image_reel").animate({ 
			left: -image_reelPosition
		}, 500 );
		
	}; 
	
	//Rotation + Timing Event
	rotateSwitch = function(){		
		play = setInterval(function(){ //Set timer - this will repeat itself every 3 seconds
			$active = $('.paging a.active').next();
			if ( $active.length === 0) { //If paging reaches the end...
				$active = $('.paging a:first'); //go back to first
			}
			rotate(); //Trigger the paging and slider function
		}, 7000); //Timer speed in milliseconds (3 seconds)
	};
	
	rotateSwitch(); //Run function on launch
	
	//On Hover
	$(".image_reel a").hover(function() {
		clearInterval(play); //Stop the rotation
	}, function() {
		rotateSwitch(); //Resume rotation
	});	
	
	//On Click
	$(".paging a").click(function() {	
		$active = $(this); //Activate the clicked paging
		//Reset Timer
		clearInterval(play); //Stop the rotation
		rotate(); //Trigger rotation immediately
		rotateSwitch(); // Resume rotation
		return false; //Prevent browser jump to link anchor
	});		
		
		
		
		
		
        
        w = screen.availWidth;
		
		if (screen.availHeight < 1100) {
			w = screen.availWidth - 15;
		}
		
		if (screen.availWidth < 1004) {
			w = '1250';
		}
		
        //alert(screen.availHeight);
        
        $("#total").css({
                    width: w * 4
        });
		
		
		$("#corpoSiteFundo").css({
                    width: w
        });
		
		$("#corpoSiteFrente").css({
                    width: w
        });
		
		$("#Conteudo").css({
                    width: w
        });
		
		
		$("#Page1").css({
                    width: w
        });
		
		$("#Page2").css({
                    width: w
        });
		
		$("#Page3").css({
                    width: w
        });
		
		$("#Page4").css({
                    width: w
        });
		
    
        
        
       $('#btnovidades, #btfacebook, #bttwitter, #btphone').mouseover(function() {
		  clearTimeout(esconde);
		  carregaBts();
		});
		
		$('#btnovidades, #btfacebook, #bttwitter, #btphone, #boxnovidade').mouseout(function() {
		  esconde = setTimeout("escondeBts()", 2000);
		});
		
		$('#btnovidades').click(function() {
			$('#boxnovidade').show();
		});
		
		$('#boxnovidade').mouseover(function() {
		  clearTimeout(esconde);
		});
		
		
			
		}
		
		
		
		AudioPlayer.setup("http://www.artecapital.com.br/swf/player.swf", {  
			width: 207,
			transparentpagebg: 'yes'  
		});
