$(function(){
	
	/**
	 * DEFAULTS
	 **/
	
	// Alert/Flash Message
	setTimeout(hideAlert,4000);
	$("#alert-message").click(function(){
	    hideAlert();
	});
	function hideAlert(){
	    if ($("#alert-message")[0]) { $("#alert-message").slideUp('fast'); }
	}
	
	// END
	
	/**
	 * TARGET BLANK
	 */
	$('.target-blank').click(function(){
		$(this).attr('target', '_blank').click();
		return false;
	});
  
	//fancybox
 	$("a[rel=group]").fancybox({
 					'width'				: '50%',
					'height'			: '80%',
					'autoScale'			: false,
					'transitionIn'	:	'elastic',
		 			'transitionOut'	:	'elastic',
					'type'				: 'iframe'
 	});
	//corner
	$("img.corner").corner();
	
	//jcheck
 	var v = $("#form-contact").jcheck({language: 'pt-br'});
 	v.validates("name", "title_message", "message", {presence: true});
  v.validates("email", {format: {"with": "email", message: "Utilize um e-mail válido"}});
         
	var vv = $("#mc-embedded-subscribe-form").jcheck({language: 'pt-br'});
 		vv.validates("name","email", {presence: true});
         
 	// var vs = $("#from-events").jcheck({language: 'pt-br'});
 	// vs.validates("check","day","months","year","radio", {presence: true});
 		
	var va = $("#from-email_date").jcheck({language: 'pt-br'});
 		va.validates("name","email","fone", {presence: true});
    va.validates("day", "months", {length: {minimum: 2, maximum: 2}});
    va.validates("year", {length: {minimum: 4, maximum: 4}});
});
