/*************************************************/
/**												**/
/**		Development: Hudson Marinho				**/
/**		Phone: +55 (84) 8821 5277				**/
/**		URL: http://hudsonmarinho.co.cc/		**/
/**		-----------------------------------		**/
/**		Agency: Balaio Ideias					**/
/**		URL: http://balaioideias.com.br/		**/
/**		-----------------------------------		**/
/**		Year/month:		2011/Augu				**/
/**												**/
/*************************************************/


/* all functions
.....................................*/


$(function(){
	
	$('a[rel="blank"]').click(function(){
		window.open(this.href);
		return false;
	});
	
	$(".open-box").fancybox({
		'width'				: 290,
		'height'			: 242,
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'padding'			: 0,
		'overlayColor'		: 'black',
		'overlayOpacity'	: '0.8'
	});
	
	$(".open-box2").fancybox({
		'width'				: 290,
		'height'			: 180,
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'padding'			: 0,
		'overlayColor'		: 'black',
		'overlayOpacity'	: '0.8'
	});
	$(".open-box3").fancybox({
		'width'				: 800,
		'height'			: 400,
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'padding'			: 0,
		'overlayColor'		: 'black',
		'overlayOpacity'	: '0.8'
	});
	
	$('.magic-label').each(function(){
		var self       = $(this);
		var self_id    = self.attr('id');
		var self_label = $('label[for='+self_id+']').hide();
		
		self_label.next('br').hide();
		
		var reset_value = function(){
			if (self.val() == '')
				self.val(self_label.html());
		}
		
		reset_value();
		
		self.focus(function(){
			if (self.val() == self_label.html())
				self.val('');
		}).blur(reset_value);
	
		self.parents('form').submit(function()
		{
			self.focus();
		});
	});

	
	
});

