<?php
defined('WikyBlog') or die('Not an entry point...');

	function ShowAsOverlay($url){
		global $page, $jsNum;
		
		
		$url = wbLinks::getUrl($url);
		$page->styles[] = '/include/js/overlay.css?'.$jsNum;
		$page->scripts[] = '/include/js/overlay.js?'.$jsNum;
		ob_start();
		
		echo '<div id="WBGalleryContainer">';
		echo '<div id="WBGalleryDivShade">';
		echo '</div>';
		
		echo '<div id="WBGalleryDiv">';
			echo '<div id="WBGalleryLinks">';
				echo '<a href="'.$url.'" target="_blank">Open In New Window</a> ';
				echo ' - ';
				echo '<a href="javascript:wbg.close()" >Close</a>';
			echo '</div>';
		
		echo '<iframe id="WBGalleryIframe" style="width:100%;height:500px;border:0;" frameBorder="0" src="'.$url.'" ></iframe>';
		echo '</div>';
		echo '</div>';
		
		
		$addContent = new content();
		$addContent->aa = 'addcontent';
		$addContent->bb = 'WBextras';
		$addContent->cc = 'WBOverlay';
		$addContent->dd = wb::get_clean();
		$page->contentClasses[] = $addContent;
		
		//call init in case the javascript file has already been loaded.
		$addContent = new content();
		$addContent->aa = 'eval';
		$addContent->bb = 'if(typeof(wbg) != "undefined" ){wbg.init();};';
		$page->contentClasses[] = $addContent;			
		return true;
		
	}