// JavaScript Document
//NOTE: if you pass a custom id into the show method you mus pass the same option into the hide method or it will not find it.
//THESE METHODS DO NOT RETURN A JQUERY OBJECT
(function($){
 $.dialog ={
	 screenSettings:{
				css:"top:0px;left:0px;filter:alpha(opacity=60);opacity:0.6;width:100%;height:1500px;position:absolute; z-index:500; background-color:#000000; display:none;",
				id: "divscreen"
			
			},
	defaultDialog:{
				content:"",
				top: "25%",
				left: "30%",
				bgColor: "#FFFFFF",
				color: "#000",
				width: "500px",
				height: "400px",
				id: "divdialog",
				clear:false
			},
	 show:function(options) {
		
			//var defaultDialog=;
			var options = $.extend(this.defaultDialog, options);
			//do actual code
			var dialogCss="width:"+options.width+";height:"+options.height+";top:"+options.top+"; left:"+options.left+"; position:absolute; z-index:600; display:none; background-color:"+ options.bgColor +"; color:"+ options.color;
			
			var screenCode="<div id='"+this.screenSettings.id+"' style='"+ this.screenSettings.css +"'></div>";
			var dialogCode="<div id='"+options.id+"' style=''></div>";
			if(document.getElementById(options.id)==null){
				$("body").append(screenCode + dialogCode);
			}
			$("#"+ this.screenSettings.id).height($(document).height());
			//$("#"+ this.screenSettings.id).width($(document).width());
			$("#"+ this.screenSettings.id).show();
			$("#"+ options.id).attr('style',dialogCss);
			$("#"+ options.id).show();
			$("#"+ options.id).html(options.content);
			
			//return this;
	 },//end showModelDialog
	hide:function(options){
			var options = $.extend(this.defaultDialog, options);
			$("#"+ this.screenSettings.id).hide();
			$("#"+ options.id).hide();
			if(options.clear){
				$("#"+ options.id).html("");
			}
			//return this;
		} 
	 
 }//end dialog object
})(jQuery);

