$(document).ready(function(){
	$('#navigation > ul > li').hover(
		function(){
			$(this).find('a').eq(0).addClass('hover');
			$(this).find('.subnav').show();
		},
		function(){
			$(this).find('a').eq(0).removeClass('hover');
			$(this).find('.subnav').hide();
		}
	);
	$("a[rel^='fancy']").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	150, 
		'speedOut'		:	150,
		'padding'		:	20,
		'overlayShow'	:	true,
		'autoDimensions':	false,
		'overlayColor'	:	'#fff',
		'width'			:	800,
		'centerOnScroll':	true,
		'showNavArrows'	:	false,
	});
	$('#btn-find-agent').hover(
		function(){
			$(this).parent().find('.popup').show('fast');
		},
		function(){
			$(document).bind('mouseout', monitor_close_popup);
		}
	);
	function monitor_close_popup(e) {
		if ($(e.relatedTarget).hasClass('popup')) {
			return;
		}
		if ($(e.relatedTarget).parents('.popup').length !== 0) {
			return;
		}
		$('.popup').hide();
	}
	
	$('.blink').focus(function () {
		if ($(this).val() == $(this).attr('title')) {
			$(this).val('');
		}
	})
	$('.blink').blur(function () {
		if ($(this).val() == '') {
			$(this).val($(this).attr('title'));
		}
	});
		
	$('#header .music').flash(
        { src: 'musicplayer.swf',
          width: 100,
          height: 30 }
    );
    
    Cufon.replace('#navigation > ul > li > a', { fontFamily: 'Futura Heavy' });
    
});
