﻿// JavaScript Document

//Puglin BounceEaseOut
jQuery.easing['BounceEaseOut'] = function(p, t, b, c, d) {
	if ((t/=d) < (1/2.75)) {
		return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
			} else if (t < (2.5/2.75)) {
				return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
				} else {
		return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
};

//<![CDATA[
		   
//Controle Externo Carrossel
	function mycarousel_initCallback(carousel) {
		jQuery('.menuGeral a').bind('click', function() {
			carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
			return false;
		});
	};

//Carroussel
	jQuery(document).ready(function() {
		jQuery("#mycarousel").jcarousel({
			scroll: 1,
			//easing: 'BounceEaseOut',
			animation: 2000,
			initCallback: mycarousel_initCallback,
			buttonNextHTML: null,
			buttonPrevHTML: null
		});

//Musicas
		$('a.letraClick').click(function(){
			var bloco = $(this).attr('rel');
			var htmlConteudo = $('#' + bloco).html();
			$('#letras').html(htmlConteudo);
		});
		
		$('a.ouvirClick').click(function(){
			alert('Em breve músicas do AMERICA ASSAULT');
		});		
		
	});
// ]]>	

//Abrir Popup Musicas
function abrirMusica(URL) {

  var width = 300;
  var height = 180;

  var left = 99;
  var top = 99;

  window.open(URL,'janela', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no')
};

//Lightbox
$(function() {
	$('#gallery a').lightBox();
	$('.dataShow a').lightBox();
});

//Popup Onload
function popup() {
	winprops = 'width=339,height=480,top=0,left=0,scrollbars=no,resizable'
	win = window.open('pop.html', 'show', winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

//Focus Formulario
$(function() {
		$('input:eq(0)').focus(function(){
		$('input:eq(0)').css({background:'yellow'});
		});
		
		$('input:eq(1)').focus(function(){
		$('input:eq(1)').css({background:'yellow'});
		});	
		
		$('textarea').focus(function(){
		$('textarea').css({background:'yellow'});
		});		
		
		$('input,textarea').blur(function(){
			$('input,textarea').css({background:'#ffffff'});
		});
	});	

//Validacao de formulario
function enviardados(){
	
   if(document.contato.nome.value=="" || document.contato.nome.value.length < 2){
	alert("Preencha o campo NOME corretamente.")
	document.contato.nome.focus()
	return false;}
	
   if(document.contato.email.value=="" || document.contato.email.value.indexOf('@')==-1 || document.contato.email.value.indexOf('.')==-1){
	alert("Preencha o campo EMAIL corretamente.")
	document.contato.email.focus()
	return false;}
	
   if(document.contato.mensagem.value==""){
	alert("Preencha o campo MENSAGEM corretamente.")
	document.contato.mensagem.focus()
	return false;}
	
   if(document.contato.mensagem.value.length <10){
	alert("Preencha o campo MENSAGEM com no mínimo 10 carácteres.")
	document.contato.mensagem.focus()
	return false;}
	
	return true;}	