// JavaScript Document

 $(document).ready(function() {
	$('#coda-slider-1').codaSlider({
	dynamicArrows: false,
	autoSlide: true,
	autoSlideInterval: 3000
	});
 });
 
 // Roundabout do momento ILha
 
			$(document).ready(function() {
				//var interval;
				
				$('.roundabout-example ul')
					.roundabout({minScale:0.8})
					//.hover(
					//	function() {
							// oh no, it's the cops!
					//		clearInterval(interval);
					//	},
					//	function() {
							// false alarm: PARTY!
					//		interval = startAutoPlay();
				//		}
				//	);
				
				// let's get this party started
				//interval = startAutoPlay();
			});
			
			//function startAutoPlay() {
			//	return setInterval(function() {
			//		$('.roundabout-example ul').roundabout_animateToNextChild();
			//	}, 3000);
			//}

// Apagando valores

$('.pesqtext').click(function(){if(this.value == this.defaultValue) {this.value = "" ;}});
$('.pesqtext').blur(function(){if (this.value == "") {this.value = this.defaultValue;}});

// Boxy Dialogo

$(function() {
  $('.boxy').boxy({
	message: "<h1 style='font-size:18px; margin-bottom:20px;'>Atenção:</h1><p>Deseja enviar o convite Chopp em Dobro?</p>"
  });
});

// Submit Formulario

 var options = { 
        target:        '#uploadOutput',   // target element(s) to be updated with server response  
        // other available options: 
        //url:       url         // override for form's 'action' attribute 
        //type:      type        // 'get' or 'post', override for form's 'method' attribute 
        //dataType:  null        // 'xml', 'script', or 'json' (expected server response type) 
        //clearForm: true        // clear all form fields after successful submit 
        //resetForm: true        // reset the form after successful submit 
 
        // $.ajax options can be used here too, for example: 
        //timeout:   3000 
    }; 
 
    // bind form using 'ajaxForm' 
    $('#postaMural').ajaxForm(options);
	$('#atualizar_perfil').ajaxForm({target: '#uploadOutput2'});
	$('#atualizar_foto').ajaxForm({target: '#uploadOutput3'});
	$('#atualizar_senha').ajaxForm({target: '#uploadOutput4'});

	var requisitaPostContato = function() {
		$('#nomeContato, #emailContato, #assuntoContato, #mensagemContato').unbind('focus');
		var nomeEnviado = $('#nomeContato').val();
		var emailEnviado = $('#emailContato').val();
		var assuntoEnviado = $('#assuntoContato').val();
		var mensagemEnviado = $('#mensagemContato').val();
		$.post('cad_contato.php',
		{ nomeContato: nomeEnviado, emailContato: emailEnviado, assuntoContato: assuntoEnviado, mensagemContato: mensagemEnviado },
		function(data) {
			$('#insere_aqui2').fadeIn(2000).html(data);
		},
		'html');
		return false;
	};
	$('#submitContato').bind('click', requisitaPostContato);
	
	$('a.lightbox').lightBox();
