var dspWindow = {
	parent:"body",
	windowId:null,
	content:null,
	width:null,
	height:null,



	close:function()
	{
		$(".dsp-window").fadeOut('2000',function()
		{  $(".dsp-window").remove(); })
		$(".dsp-overlay").fadeOut('2000',function()
		{  $(".dsp-overlay").remove(); })
	},
	open:function()
	{
		var dsp = "";
		dsp += "<div class=\"dsp-overlay\"></div>";
		dsp += "<div id=\"" + this.windowId + "\" class=\"dsp-window\" style=\"width:" + this.width + "px; height:" + this.height + "px; margin-top:-" + (this.height / 2) + "px; margin-left:-" + (this.width / 2) + "px;\">";
		dsp += this.content;
		dsp += "</div>";	

		$(this.parent).append(dsp);

		$(".dsp-window").append("<a class=\"dsp-close-window\"></a>");
		$(".dsp-window").append("<a class=\"dsp-header-window\"></a>");
		
		$(".dsp-close-window").click(function(){dspWindow.close();});
		$(".dsp-header-window").click(function(){dspWindow.close();});

		$(".dsp-overlay").click(function(){dspWindow.close();});
	}
};
var opendsp = function(source,in_width,in_height,in_scrol,in_border)
{
	if (in_scrol=='' || (in_scrol!='YES' && in_scrol!='NO' && in_scrol!='AUTO'))
	{ in_scrol='NO';}
	if (in_border=='' || (in_border!=1 && in_border!=0))
	{  in_border=='0';}
	if (in_width=='')
	{ in_width='540';}
	if (in_height=='')
	{ in_height='480';}

	dspWindow.windowId = "DispWindows";
	dspWindow.width = in_width;
	dspWindow.height = in_height;
	dspWindow.content = "<iframe width='"+in_width+"' height='"+in_height+"' frameborder='"+in_border+"' scrolling='"+in_scrol+"' allowtransparency='true' src='" + source + "'></iframe>";
	dspWindow.open();
};