// remap jQuery to $
(function($){

    $('ul#mnav').superfish({
        speed: 400
    });   

	$('#show,#industry').sSelect({ddMaxHeight: '200px'});  

	$('.gallery_list a, .article_gallery a').colorbox({
		onComplete: function(){
			if($('#flowPlayer').length > 0){
				flowplayer('flowPlayer', 'http://euroart.euroart93.net/includes/flowplayer-3.2.4.swf');
			}
		},
		maxWidth: '1024px',
		maxHeight: '768px',
		scrolling: false
	});

    $("a[href^=http]").each(function() {
        if(this.href.indexOf(location.hostname) == -1) {
        $(this).click(function(){window.open(this.href);return false;});
        }
    });
    
	// if the function argument is given to overlay,
	// it is assumed to be the onBeforeLoad event listener
	$("a[rel='#overlay']").overlay({
		left: null,
		top: null,
		mask: {
			color: '#000',
			loadSpeed: 200,
			opacity: 0.8
		},
		onBeforeLoad: function() {
			// grab wrapper element inside content
			var wrap = this.getOverlay().find(".contentWrap");
			// load the page specified in the trigger
			wrap.load(this.getTrigger().attr("href"));
		}
	});

	$("#contact a[title]").tooltip({
        // tweak the position
       offset: [30, 1],
       // use the "slide" effect
       effect: 'slide'
    }).dynamic({ bottom: { direction: 'down', bounce: true } });

})(window.jQuery);

$(window).load(function() {

    $('#slider').nivoSlider({
        effect:'fade',
        slices:15,
        animSpeed:500,
        pauseTime:7000,
        directionNav:false,
        captionOpacity:0.9
    });

});
