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() { 
		
	// Galleries added with fck editor
	$(".gallerytable a[rel^='prettyPhoto']").prettyPhoto({
		animation_speed: 'normal',
		show_title: false,
		theme: 'dark_rounded',
		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			
	var oInput = $('input:text.toggle, textarea.toggle');
	oInput.click(function() {
		if (empty($(this).attr('rel')) || $(this).attr('rel') == $(this).val()) {
			$(this).attr('rel', $(this).val());
			$(this).val('');
		}
	});
	oInput.blur(function() {
		if ($(this).val() == '') {
			$(this).val($(this).attr('rel'));
		}
	});

	if ($.browser.msie && $.browser.version <= 7) {
		$("#mainMenu li:not(:last-child)").after("&nbsp;|&nbsp;");
	}
	
//	#mainMenu li:after {
//		content: '\00a0|\00a0'
//	}
//
//	#mainMenu li:last-child:after {
//		content: ''
//	}
	  
	// 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');
		});
		*/	
	//}
		
});
