function VideoModal(closeOnClick) {

	var is_showing = false;
	
	if (closeOnClick != null){
		var close_on_click = closeOnClick;
	} else {
		var close_on_click = false;
	}

	var divDialogId = 'modal_dialog';
	var divBackgroundId = 'modal_overcast';

	$('body').append('<div id = "' + divDialogId + '"></div>');
	$('body').append('<div id = "' + divBackgroundId + '"></div>');
	
	this.show_modal = function() {
		$('#' + divBackgroundId).css('display','block');
		$('#' + divDialogId).css('display','block');
		
		this.reposition_modal();
		if (close_on_click == true) $('#' + divBackgroundId).attr('onclick','vm.hide_modal();');
		
		$('body').css("overflow", "hidden");
		
		dialogActive = true;
		is_showing = true;
	}
	
	this.reposition_modal = function(){
		$('#' + divBackgroundId).css('width', screen.width*2);
		$('#' + divBackgroundId).css('height', screen.height*2);
		$('#' + divDialogId).center();
	}
	
	this.test = function(){
		alert('test');
	}
	
	this.load_content = function(url){
		this.show_modal();
		$('#' + divDialogId).html('<iframe src="' + url + '" style="width: 100%; height: 100%;" frameborder="0"></iframe>');
	}
	
	this.hide_modal = function() {
		$('#' + divBackgroundId).css('display','none');
		$('#' + divDialogId).css('display','none');
		$("body").css("overflow", "auto");
		$(window).focus();

		is_showing = false;
	}
	
	/** Add a function to center modal on screen */
	jQuery.fn.center = function() {
	    var container = $(window);
	    var top = -this.height() / 2;
	    var left = -this.width() / 2;
	    return this.css('position', 'absolute').css({ 'margin-left': left + 'px', 'margin-top': top + 'px', 'left': '50%', 'top': '50%' });
	}

}



