$(document).ready(function(){

	/********Cufon*************/
	
	Cufon.replace(['#menu ul li'],{hover:true});
	Cufon.replace(['.top-menu-item'], {hover:true});
	Cufon.replace(['.menu-item'], {hover:true});
	Cufon.replace('.heading-large');
	Cufon.replace('.heading-large');
	Cufon.replace('.heading-small');
	Cufon.replace('.news-title');
	Cufon.replace('.footer-title');
	Cufon.replace('#slide-description');
	Cufon.replace(['.tab'], {hover:true});

	/********end Cufon**********/

	/********Fancybox*************/

	$("a.grouped_elements").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	100,
		'speedOut'		:	100,
		'overlayShow'	:	true,
		'overlayColor' 	:	'#000',
		'overlayOpacity':	0.4,
		'titleShow'		:	false
	});

	$("a.movie").click(function() {
                 $.fancybox({
                  'padding'             : 0,
                  'autoScale'   : false,
                  'transitionIn'        : 'elastic',
                  'transitionOut'       : 'elastic',
                  'title'               : 'movie',
				  'overlayShow'			: true,
				  'overlayColor'		: '#000',
				  'overlayOpacity'		: 0.6,
                  'width'               : 580,
                  'height'              : 350,
                  'href'                : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
                  'type'                : 'swf',    // <--add a comma here
                  'swf'                 : {'allowfullscreen':'true'} // <-- flashvars here
                  });
                 return false;

            }); 

	/******** end Fancybox********/

	$(".footer-item").hover(
		function(){
			$(this).find('.footer-subs').slideDown();
		},
		function() {
			$(this).find('.footer-subs').slideUp();
		}
)

	$('.show').parent('.box-container').find('.arrow').html('<img src="/public/img/arrow_down.gif" alt=""/>');
	
	function myPopup2() {
		window.open( "templates/controle.php", "myWindow",
		"status = 1, height = 300, width = 300, resizable = 0" )
	}

	$('.top-menu-item').hover(
		function(){
			$(this).find('a').css('color', '#FFFFFF');
			$(this).find('a').css('background', "url('/public/img/menu_item_background.gif') repeat-x");
		},
		function(){

			if($(this).hasClass('top-menu-active'))
			{
				$(this).find('a').css('color', '#FFFFFF');
				$(this).find('a').css('background', "url('/public/img/menu_item_background.gif') repeat-x");
			}
			else
			{
				$(this).find('a').css('color', '#1A2C4A');
				$(this).find('a').css('background', 'none');
			}
		}
	);

	$(".menu-item a").hover(
		function(){
			$(this).css('color', '#e7b51c');
		},
		function(){
			if(!$(this).hasClass('menu-active'))
			$(this).css('color', '#ffffff');
		}
	);
	

	$('.tab').hover(
		function(){
			$(this).css('background', 'url("/public/img/tab_active.gif") no-repeat');
		},
		function(){
			if(!$(this).hasClass('tab-active'))
			{
				$(this).css('background', 'url("/public/img/tab_background.gif") no-repeat');
				$(this).css('color', '#1A2C4A');
			}
		}
	);
	

	$('.empty-click').click(function(){
		var val = $(this).val();
		$(this).val('');
	})
})



