
$(function() {
	$('a[rel=external]').click(function(){
	  this.target = "_blank";
	});
	
	/**** dropdown menu **************/
    $("ul.dropdown li").hover(function(){
        $(this).addClass("hover");
        $('.submenu',this).css('visibility', 'visible');
    
    }, function(){
        $(this).removeClass("hover");
        $('.submenu',this).css('visibility', 'hidden');
    
    });
    
    $("ul.dropdown li ul li:has(ul)").find("a:first").append(" &raquo; ");
    
    if (!fancyStarted) {
	    $("a.fancybox").fancybox({
			'speedIn'		:	100, 
			'speedOut'		:	100,
			'centerOnScroll' : true
		});
	    
	    $("a.fancyboxGate").fancybox({
			'speedIn'		:	100, 
			'speedOut'		:	100,
			'centerOnScroll' : false,
			'hideOnOverlayClick': false,
			'hideOnContentClick': false,
			'enableEscapeButton': false,
			'showCloseButton'	: false
		});
	    
	    $("a.fancyboxGallery").fancybox({
			'speedIn'		:	100, 
			'speedOut'		:	100,
			'centerOnScroll' : true,
			'hideOnOverlayClick': true,
			'hideOnContentClick': false,
			'enableEscapeButton': true,
			'showCloseButton'	: true
		});
	    
	    $("a.fancyboxYoutube").click(function() {
	    	$.fancybox({
				'autoScale'		: false,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none',
				'title'			: this.title,
				'width'			: 640,
				'height'		: 390,
				'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
				'type'			: 'swf',
				'swf'			: {
				   	'wmode'		: 'transparent',
					'allowfullscreen'	: 'true'
				}
			});
	    	return false;
	    })
    }
});
