
$.parseQuery = function(qs, options) {
    var q = (typeof qs === 'string' ? qs : window.location.search), o = { 'f': function(v) { return unescape(v).replace(/\+/g, ' '); } }, options = (typeof qs === 'object' && typeof options === 'undefined') ? qs : options, o = jQuery.extend({}, o, options), params = {};
    jQuery.each(q.match(/^\??(.*)$/)[1].split('&'), function(i, p) {
        p = p.split('=');
        p[1] = o.f(p[1]);
        params[p[0]] = params[p[0]] ? ((params[p[0]] instanceof Array) ? (params[p[0]].push(p[1]), params[p[0]]) : [params[p[0]], p[1]]) : p[1];
    });
    return params;
}


function showDagdelenVoorLocatieOnLoad()
{
	if (document.aanmelden.Voorkeur_Locaties.selectedIndex > 0) {
		showDagdelenVoorLocatie(document.aanmelden.Voorkeur_Locaties);
	}
}

function showDagdelenVoorLocatie(objSelect) 
{
	var selectedOption = objSelect.options[objSelect.selectedIndex];
	var locationId = selectedOption.id;
	
	// hide all 
	$(".dagdelencombinatie").hide();
	
	if (selectedOption.value != "") {
		$("div.dagdelencombinatie_voor_locatie_"+ locationId).slideDown();
		$("#selecteer-een-locatie").hide();
	} else {
		$("#selecteer-een-locatie").show();
	}
		
}


function insertMediaIdSetPreviewAndCloseFancyBox(MediaGuid, MediaId)
{
	// set input value
	objForm = parent.document.getElementById('CMS_SAV_Employees');
	objForm.ID0ECCA_EmployeeMediaId.value = MediaId;
	
	//show preview 
	parent.$("#mediaPreviewBox").slideDown();
	
	//set image
	imagePath = "/_generated/media/250/"+ MediaGuid + ".jpg";
	objImage = parent.document.getElementById('mediaPreviewImage');
	objImage.src = imagePath;
	
	//close
	parent.$.fn.fancybox.close();

}
