	if(!smart_minicalendar.name || jQuery('#' + smart_minicalendar.name).length > 0)
		smart_minicalendar.name = 'minicalendar' + Math.floor(Math.random()*101); //minicalendar and random number between 1 and 100
	smart_minicalendar.uri = "/intranet/calendar/show_minicalendar.php?name=" + smart_minicalendar.name;


	if(smart_minicalendar.width)
		smart_minicalendar.uri += "&width=" + smart_minicalendar.width;

	if(smart_minicalendar.cln_ids)
		smart_minicalendar.uri += "&cln_ids=" + smart_minicalendar.cln_ids;

	if(smart_minicalendar.date)
		smart_minicalendar.uri += "&date=" + smart_minicalendar.date;

	document.write('<div id="'+smart_minicalendar.name+'"></div>');
	jQuery('#' + smart_minicalendar.name).data('so', smart_minicalendar);

	//jQuery event occurs afterwards
	function smart_minicalendar_load(bl_renew) {
		smart_minicalendar = jQuery('#' + smart_minicalendar.name).data('so');
		if(bl_renew)
			smart_minicalendar.uri += "&cln_mini=renew";

		jQuery('#' + smart_minicalendar.name).load(smart_minicalendar.uri, function() {
			jQuery('#' + smart_minicalendar.name + " a[name='minicln_refresh']" ).click(function() {
				jQuery('<div>&nbsp;</div>').appendTo(jQuery(this));
				jQuery(this).remove();
				smart_minicalendar_load(true);
				return false;
			});

			jQuery('.popup_window').each(function(i) {
				popup_wrap_window(jQuery(this));
			});
		});
	}
	smart_minicalendar_load();
