//I.v.m. gebruik van prototype.js dient $ vervangen te worden door jQuery
jQuery(window).ready(function() {
	setIconen();
	jQuery(window).bind('resize', function() { setIconen(); });
	jQuery(window).bind('scroll', function() { setIconen(); });
});

function setIconen() {
	if (jQuery('#divIconen').length > 0) {
	    heightMenu = (jQuery('#divMenu').position().top + jQuery('#divMenu').height() + 50);
	    iconenTop = ((jQuery(window).height() - jQuery('#divIconen').height()) + jQuery(window).scrollTop());

		if (iconenTop < heightMenu) {
			iconenTop = heightMenu;
		}

		jQuery('#divIconen').css('top', iconenTop);
	}
}

function TopObjects(sVisibility)
{
	switch (sVisibility)
	{
		case "visible":
			$('select').show();
			$('object').show();
			break;

		case "hidden":
			$('select').hide();
			$('object').hide();
			break;
	}
}

function showInschrijfUitleg(Stap, Titel)
{
	style = "height=400, width=500, status=yes, toolbar=no, menubar=no, location=no, scrollbars=yes, resizable=no";
	open("/inschrijvingen/Help.aspx?Stap=" + Stap, "HelpPopup", style );
}

function aHover(aTag, style)
{
	aTag.className = style
}

function aNormal(aTag)
{
	aTag.className = ''
}

function getBase() {
    var baseTag = document.getElementsByTagName("base");
    if (baseTag[0] == undefined)
        return "";
    else
        return baseHref = baseTag[0].href;
}

function social(area) {
	switch (area) {
		case "news":
			alert('hoi');
			break;
	}
}

// URL parameters ophalen
var urlParams = {};
(function() {
    var e,
        a = /\+/g,  // Regex for replacing addition symbol with a space
        r = /([^&=]+)=?([^&]*)/g,
        d = function(s) { return decodeURIComponent(s.replace(a, " ")); },
        q = window.location.search.substring(1);

    while (e = r.exec(q))
        urlParams[d(e[1])] = d(e[2]);
})();
