// JavaScript Document
$(window).load(function(){			
	function setBackgroundImage(){
		if($('#backgroundImage').height() < $(window).height()){
			$('#backgroundImage').css({'height':'100%', 'width':'auto'});
			$('#backgroundImage').css({'margin-left':'-'+($('#backgroundImage').width()/2)+'px'});
		}else{
			$('#backgroundImage').css({'margin-left':'-'+($('#backgroundImage').width()/2)+'px'});
		}
	};
	
	setBackgroundImage();	
	
	$(window).resize( function(){
		setBackgroundImage();
	});
	
	$('a.portalLink').hover(function(){
		$('#gaVerderBtn').attr('src', 'images/ga_verder_hover.png');
	}, function(){
		$('#gaVerderBtn').attr('src', 'images/ga_verder.png');
	});	
});

$(document).ready(function() { 
	$("a.overlay-flash").fancybox({ 
		'padding'                : 0, 
		'zoomOpacity'            : true, 
		'zoomSpeedIn'            : 500, 
		'zoomSpeedOut'            : 500, 
		'overlayOpacity'        : 0.75, 
		'overlayColor'			: "#000000",
		'width'            		: 640, 
		'height'            	: 410, 
		'hideOnContentClick'    : false
	}); 
	
	function getFlashVersion() {
		// ie
		try {
		    try {
		        // avoid fp6 minor version lookup issues
		        // see: http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		        var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
		        try { axo.AllowScriptAccess = 'always'; }
		        catch (e) { return '6,0,0'; }
		    } catch (e) { }
		    return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
		    // other browsers
		} catch (e) {
		    try {
		        if (navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
		            return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
		        }
		    } catch (e) { }
		}
		return '0,0,0';
	}

	var version = getFlashVersion().split(',').shift();

	if (version < 10) {
		$(function () {
		    $("<div id='browserWarning'>You have an older version of Flash Player installed. Please <a href='http://get.adobe.com/flashplayer/' target='_blank'>update to the latest Flash Player</a> for the best experience. &nbsp;&nbsp;&nbsp;[<a href='#' id='warningClose'>close</a>] </div> ")
		.css({
			'backgroundColor': '#feffd2',
			'width': '100%',
			'border-top': 'solid 1px #b8b990',
			'border-bottom': 'solid 1px #b8b990',
			'text-align': 'center',
			'padding': '5px 0px 5px 0px',
			'font-size': '12px',
			'color': '#2e2e2e',
			'position': 'fixed',
			'font-family': 'Verdana',
			"z-index": "20"
		})
		.prependTo("body").children("a").css({});

		    $('#warningClose').click(function () {

		        $('#browserWarning').slideUp('slow');
		        return false;
		    });
		});
	}
});

function callFancy(my_href) { 
	var j1 = document.getElementById("hiddenclicker"); 
	j1.href = my_href; 
	$('#hiddenclicker').trigger('click'); 
}
