
	// ----------------------------------------------------------------------------------------------------------------------------------------------------------------//
	
	function modMedia_loaded(id) {
		
		$("#" + id + "_div").css("background", "transparent url(/images/free.gif) no-repeat center center");
		$("#" + id + "_img").css("visibility", "visible");
		
	}
	
	// ----------------------------------------------------------------------------------------------------------------------------------------------------------------//
	
	function modMedia_resize() {
		
		var arr = {
			width:		"1px",
			height: 	"1px"
		}
		
		$("#modMedia_bg").css(arr);
		$("#modMedia_cont").css(arr);
		
		var arr = {
			width:		document.body.clientWidth + "px",
			height: 	document.body.clientHeight + "px",
			display:	"block"
		}
		
		$("#modMedia_bg").css(arr);
		$("#modMedia_cont").css(arr);
		
	}
	
	function modMedia_open(id) {
		
		cmsAjax(
			'/modules/media/includes/ajax_preview.php', // backend
			{
				'id': id
			},
			function(res) { // ONREADYSTATE
				
				$('#modMedia_name').html(res.name);
				$('#modMedia_preview').html(res.html);
				$('#modMedia_controls').html(res.controls);
				$('#modMedia_html_content').html(res.content);
				$('#modMedia_html_preview').html(res.preview);
				
				modMedia_resize();
				$(window).bind("resize", function(){ modMedia_resize(); });
				
			}
		);
		
	}
	
	function modMedia_hide() {
		
		$("#modMedia_bg").css("display", "none");
		$("#modMedia_cont").css("display", "none");
		$('#modMedia_preview').html("");
		$(window).unbind("resize", function(){ modMedia_resize(); });
		
	}
	
	// ----------------------------------------------------------------------------------------------------------------------------------------------------------------//

