
function AdminPane()
{
	
	var that = this;
	
	var paneName;
	var iframeName;
	
	var bgDiv;
	var contentDiv;
	var iframe;
	var closeDiv;
	var loadingDiv;
	
	this.CreatePane = function(url)
	{
		var top = $(window).scrollTop() + 40;
		
		// create the background div
		that.bgDiv = document.createElement('div');
		that.bgDiv.id = that.paneName;
		that.bgDiv.setAttribute('style', 'position:absolute;margin: 0 auto;overflow: auto;height:10000px;width:100%;top:0;left:0;background:black;filter:alpha(opacity=40);opacity:0.4;overflow: auto; text-align: center;');
		
		// create a content pane
		that.contentDiv = document.createElement('div');
		that.contentDiv.id = 'admin_main';
		that.contentDiv.setAttribute('style', 'position: absolute; top: ' + top + 'px; width: 40%; min-width: 750px; left: 20%; right: 30%; height: 500px; z-index: 1; text-align: center; padding: 40px 0 20px 0; background: #DCEEF8;');
		
		if(IsIE == false) {
			$(that.contentDiv).corner({tl: { radius: 8 }, tr: { radius: 8 }, bl: { radius: 8 }, br: { radius: 8 }, antiAlias: true});
		}
		
		// set the iframe
		that.iframe = document.createElement("iframe");
		$(that.iframe).attr('id', that.iframeName);
		$(that.iframe).attr('name', that.iframeName);
		$(that.iframe).attr('style', 'width: 650px; height: 400px; background: white; border: 2px solid #009BFF;');
		$(that.iframe).attr('src', url);
		
		$(that.iframe).load(function() {
			that.IFrameLoaded();
		});
		
		that.contentDiv.appendChild(that.iframe);
		
		// create a close div
		that.closeDiv = document.createElement('div');
		$(that.closeDiv).attr('style', 'width: 100px; height: 22px; margin: 60px auto 0 auto; border: 2px solid #009BFF; background: white; color: black; cursor: pointer; text-align: center;');
		$(that.closeDiv).html('close');
		
		that.closeDiv.onclick = function()
		{
			//location.reload(true);
			var top = $(window).scrollTop() + 40;
			var url = location.href;
			url = SetGetVar(url, 'top', top);
			window.location.href = url;
		};
		
		$(that.contentDiv).append(that.closeDiv);
		
		// create a loading div
		that.loadingDiv = document.createElement('div');
		$(that.loadingDiv).attr('style', 'display: none; margin: 60px auto 0 auto;');
		
		$(that.contentDiv).append(that.loadingDiv);
		
		document.body.appendChild(that.bgDiv);
		document.body.appendChild(that.contentDiv);
		
		return;
	};
	
	this.IFrameLoading = function()
	{
		if(that.closeDiv != undefined) {
			$(that.closeDiv).css('display', 'none');
			$(that.loadingDiv).css('display', 'block');
		}
	};
	
	this.IFrameLoaded = function()
	{
		if(that.closeDiv != undefined) {
			$(that.loadingDiv).css('display', 'none');
			$(that.closeDiv).css('display', 'block');
		}
	};
	
	this.DeletePane = function()
	{
		
	};
	
	
	
	this.init = function()
	{
		that.paneName = 'admin_pane';
		that.iframeName = 'admin_iframe';
	};
	this.init();
	
	
}
