// Menu Drop Down
jQuery(function(){
	jQuery('ul.sf-menu').superfish();
});

// Caroulsel Produos
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;
	}
};

jQuery(document).ready(function() {

    jQuery("#txtEmail").focus(function() {
        jQuery(this).val('');
    });
    
    jQuery("#txtEmail").blur(function() {
      if(jQuery(this).val()=='') jQuery(this).val('Seu email...');
    });
    
    jQuery("#txtNome").focus(function() {
        jQuery(this).val('');
    });

    jQuery("#txtNome").blur(function() {
      if(jQuery(this).val()=='') jQuery(this).val('Seu email...');
    });

    jQuery("#btnCadastrar").click(function() {
        if(validaForm()) jQuery('#formInformativo').submit();
    })

    
    jQuery('#mycarousel, #mycarousel2').jcarousel({
        easing: 'BounceEaseOut',
        animation: 1000
    });
});

// Facebox
jQuery(document).ready(function($) {
  $('a[rel*=facebox]').facebox()
}) 

// Vitrine

//Informativo
function validaForm()
{

    if(document.getElementById('txtEmail').value=='' || document.getElementById('txtEmail').value.toString().toLowerCase()=='Seu Email...'.toLowerCase())
    {
        $.facebox('Você deve preencher um e-mail');
        document.getElementById('txtEmail').focus();
        return false;
    }
    if(document.getElementById('txtNome').value=='' || document.getElementById('txtNome').value.toString().toLowerCase()=='Seu nome...'.toLowerCase())
    {
        $.facebox('Você deve preencher um nome');
        document.getElementById('txtNome').focus();
        return false;
    }

    if(document.getElementById('txtNome').value.indexOf('@')>1 && document.getElementById('txtNome').value.indexOf('@')<1)
    {
        var tmp = document.getElementById('txtNome').value;
        document.getElementById('txtNome').value = document.getElementById('txtEmail').value;
        document.getElementById('txtEmail').value = tmp;
    }
    return true;
}
