function showDialog(p_sTitle, p_sHtml, p_iW, p_iH) {
	if (empty(p_sTitle)) {
		p_sTitle = '';
	}
	if (empty(p_sHtml)) {
		p_sHtml = '';
	}
	if (empty(p_iW)) {
		p_iW = 400;
	}
	if (empty(p_iH)) {
		p_iH = 240;
	}

	$("#dialog").attr('title', p_sTitle).html(p_sHtml).dialog({
		height: p_iH,
		width: p_iW,
		modal: true
	});
}

$(document).ready(function() { 
	var addthis_config = {
		pubid: "xa-4d302a3672b32ce1",
		ui_508_compliant: true,
		ui_language: "nl"
	};
	
	// start addthis app
	if($('#addThisBox').length){
		addthis.init();
	}	
	
	// Side banner
	if ($('#sideBanners').length) {
		$('#sideBanners').cycle({
			fx: 'fade',
			speed: 1500
		});
	}
	
	// Galleries added with fck editor
	$(".gallerytable:first a[rel^='prettyPhoto']").prettyPhoto({
		animation_speed: 'normal',
		theme: 'light_square',
		slideshow: 3000, 
		autoplay_slideshow: false,
		social_tools: ''
	});
	
	// Slider or Fader of banners
	if($('#mainBanner').length){
		$('#mainBanner').cycle({
			before: function() { $(window).resize(); }, 
			fx: 'fade',
			containerResize: false,
			slideResize: false,
			fit: true,
			speed:    2000, 
			timeout:  4000,
			next:   '.nextBg', 
			prev:   '.prevBg',
			pause: 0
		});		
	}
	
	// Input text field toggle
	// Set default text in attr value and add class to input
	// field with
	// classname: toggle
	$('input:text.toggle').each(function(idx, elem) {
		
		var oInput = $('#' + elem.id);
		oInput.click(function() {
			if (empty(oInput.attr('rel')) || oInput.attr('rel') == oInput.val()) {
				oInput.attr('rel', oInput.val());
				oInput.val('');
			}
		});
		oInput.blur(function() {
			if (oInput.val() == '') {
				oInput.val(oInput.attr('rel'));
			}
		});
	});	

	// Accordion
	if ($("#accordionContent").length) {
		$("#accordionContent").accordion();
	}
	
	// delay popup showing with 2 sec and fadein
	/**
	 * @todo convert to jquery version for popup module
	 */		
	if($('#popupMainContainer').length){
		$('#popupMainContainer').css('display', 'none');
		/*
		var hidePopup = new Fx.Tween('popupContainer');	
		(function(){ hidePopup.start('top', -800, 0); }).delay(1500);	
		$$('.popupClose').addEvent('click', function(){
			$('popupContainer').setStyle('visibility', 'hidden');
			$('popupMainContainer').setStyle('visibility', 'hidden');
		});
		*/	
	}
		
});
