// JavaScript Document
$(document).ready(function(){

// FANCYBOX

$(".fBox").fancybox({
        'frameWidth'        : '60%',
        'frameHeight'       : '80%',
        'autoScale'         : false,
        'transitionIn'      : 'elastic',
        'transitionOut'     : 'elastic',
		'opacity'			: true,
		'overlayShow'		: true,
		'overlayOpacity'	: 0.3,
		'overlayColor'		: '#000',
		'centerOnScroll'	: 'true',
        'type'              : 'iframe',
		'titleShow'			: 'true'
	});


// EINDE FANCYBOX

//TOOLTIP

	$('[title]').qtip({   
	   show: 'mouseover',
	   hide: 'mouseout',
	   style: {name: 'light',tip: 'bottomLeft'},
	   position: {
		  target: 'mouse',
		  corner: {
			 target: 'topRight',
			 tooltip: 'bottomLeft'
		  }
	   },
	   show: {
		   delay: '0',			
		   effect: {
			   type: 'fade',
			   length: '500'
		   }
	   },
	   hide: {
		   delay: '0',			
		   effect: {
			   type: 'fade',
			   length: '500'
		   }
	   }
	})

});



//DROPDOWN MENU

        $(document).ready(function() {
            $(".dropdown img.flag").addClass("flagvisibility");

            $(".dropdown dt a").click(function() {
                $(".dropdown dd ul").toggle();
            });
                        
            $(".dropdown dd ul li a").click(function() {
                var text = $(this).html();
                $(".dropdown dt a span").html(text);
                $(".dropdown dd ul").hide();
                $("#result").html("Selected value is: " + getSelectedValue("sample"));
            });
                        
            function getSelectedValue(id) {
                return $("#" + id).find("dt a span.value").html();
            }

            $(document).bind('click', function(e) {
                var $clicked = $(e.target);
                if (! $clicked.parents().hasClass("dropdown"))
                    $(".dropdown dd ul").hide();
            });


            $("#flagSwitcher").click(function() {
                $(".dropdown img.flag").toggleClass("flagvisibility");
            });
        });

