// 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:110%;height:1000%;position:absolute; z-index:500; background-color:#000000; display:none;",
				id: "divscreen"
			
			},
	defaultDialog:{
				top: "25%",
				left: "30%",
				bgColor: "#FFFFFF",
				color: "#000",
				width: 500,
				height: 400,
				id: "divdialog"
				
			},
	createdFlag: false,
	 show:function(dialogContent,options) {
		
		
			//var defaultDialog=;
			var options = $.extend(this.defaultDialog, options);
			//do actual code
			var dialogCss="width:"+options.width+"px;height:"+options.height+"px; top:"+options.top+"; left:"+options.left+"; position:absolute; z-index:600; display:none; background-color:"+ options.bgColor +"; color:"+ options.color;
			if(!this.createdFlag){
				var screenCode="<div id='"+this.screenSettings.id+"' style='"+ this.screenSettings.css +"'></div>";
				var dialogCode="<div id='"+options.id+"' style='"+ dialogCss +"'>"+dialogContent+"</div>";
				$("body").append(screenCode + dialogCode);
			}else{
				$("#"+ options.id).attr('style',dialogCss).html(dialogContent);	
			}
			$("#"+ this.screenSettings.id).show();
			$("#"+ options.id).show();
			
			this.createdFlag=true;
			//return this;
	 },//end showModelDialog
	hide:function(options){
			var options = $.extend(this.defaultDialog, options);
			$("#"+ this.screenSettings.id).hide();
			$("#"+ options.id).hide();
			//return this;
		},
	heightRefresh:function(){
		$("#" + this.screenSettings.id).css('height',$("body").css('height') + '%');
	}
	 
 }//end dialog object
})(jQuery);


