<div id="module_<?php echo($module_instance_id); ?>" class="module announcement-module <?php echo($module_class); ?>">
	<div class="announcement-message"><?php echo($message); ?></div>

	<div class="text-center">
		<?php
		if($ok_url)
		{
			?><button type="button" class="btn btn-primary" onclick="window.location = '<?php echo($ok_url); ?>';"><?php echo($ok_text); ?></button><?php
		}
		else
		{
			?><button type="button" class="btn btn-primary" onclick="$('#module_<?php echo($module_instance_id); ?>').dialog('close');"><?php echo($ok_text); ?></button><?php
		}

		if($cancel_text)
		{
			?> <button type="button" class="btn btn-secondary" onclick="$('#module_<?php echo($module_instance_id); ?>').dialog('close');"><?php echo($cancel_text); ?></button><?php
		}
		?>
	</div>

	<script>
		jQuery(window).on("load", function()
		{
			if(getCookie("announcement_<?php echo($module_instance_id); ?>") != 1)
			{
				setTimeout(function()
				{
					var d = new Date();
					d.setTime(d.getTime()+(24*60*60*1000));
					var expires = "expires="+d.toGMTString();
					document.cookie = "announcement_<?php echo($module_instance_id); ?>=1; " + expires + "; path=/;";

					jQuery("#module_<?php echo($module_instance_id); ?>").dialog(
					{
						<?php
						if($title && $title_heading_level)
						{
							?>title: "<?php echo($title); ?>",
							<?php
						}
						?>
						width: "<?php echo($width); ?>",
						height: "<?php echo($height); ?>",
						maxWidth: jQuery(window).width() * 0.95,
						maxHeight: jQuery(window).height() * 0.95,
						modal: true,
						show:
						{
				        	effect: "fade",
				        	duration: 300
				      	},
				      	hide:
				      	{
				        	effect: "fade",
				        	duration: 300
				      	}
					});
				}, <?php echo($delay * 1000); ?>);
			}
		});
	</script>
</div>
