function slider_panel (panel_id, tab_lable, bg_color, width, callback) {

	this.TAB_WIDTH  = 20;

	this.open		= 0;
	this.slideSpeed	= 10;
	this.object		= null;

	this.fX			= 0;
	this.cX			= 0;

	this.lastId     = 0;
	this.callback	= null;

/*
	this.openPanel = function (objectId) {

		this.object = document.getElementById(objectId);

		if(this.open) {
			this.fX = -80;
			this.cX = 0;
			this.open = 0;

		} else {

			this.fX = 0;
			this.cX = -80;
			this.open = 1;
		}

		this.slideMenu(this.cX, this.fX);
	}
*/
	this.showPanel = function (objectId) {

		//this.object.style.clip = 'rect(0px 10px 20px 30px)';
		
		if (this.lastId) {

			if (objectId != this.lastId)
			{
				this.object = document.getElementById(this.lastId);
				this.object.style.left = -width+'px';
				this.open = 0;
			}
		}
				
		this.lastId = objectId;

		this.object = document.getElementById(objectId);
		if(this.open) this.closePanel();
		else this.openPanel(objectId);
	}

	this.closePanel = function () {

		this.open = 0;

		this.fX = -width;
		this.cX = -10;

		this.slideMenu(this.cX, this.fX);
	}

	this.openPanel = function (objectId) {

		this.fX = -10;
		this.cX = -width+10;
		this.open = 1;

		this.slideMenu(this.cX, this.fX);
		slider_panel.callback(objectId);
	}

	this.slideMenu = function (cX, fX) {
		
		if (cX != fX) {

			if (cX > fX) {
				cX -= this.slideSpeed;
			
			} else {
				cX += this.slideSpeed;
			}

			this.object.style.left = cX + 'px';
			setTimeout('sliderPan.slideMenu(' + cX + ',' + fX + ')', 0);
			//setTimeout(this.slideMenu(cX, fX), 1000);

		}

		return;
	}

	this.load_content = function(voffset, callback) {

		slider_panel.callback = callback;
		var slidingPanWidth = width+this.TAB_WIDTH;

		var out_str = '';

		out_str += "<div style='left:-"+width+"px;width:"+slidingPanWidth+"px' class=sliding_pan ";
		
		//out_str += "onClick=\"javascript:setMenu2('"+panel_id+"')\" id='"+panel_id+"'> ";
		out_str += "onClick=\"javascript:sliderPan.showPanel('"+panel_id+"')\" ";
		out_str += "id='"+panel_id+"'> ";

		//out_str += "<div style='width:120px;height:200px;background:"+bg_color+";float:left;'></div>";
		
		//out_str += "<div style='vertical-align:top'>";
		//out_str += panel_id;
		//out_str += "</div>";


		switch(true) {
			
			case bg_color=="blue":
				bg_clr = "#aaaaff";
				bg_icon = "background-image:url(\"../graphics/tab_aaaaff.png\");";
				break;
			
			case bg_color=="purple":
				bg_clr = "#ffaaff";
				bg_icon = "background-image:url(\"../graphics/tab_ffaaff.png\");";
				break;
			
			
			case bg_color=="green":
				bg_clr = "#aaffaa";
				bg_icon = "background-image:url(\"../graphics/tab_aaffaa.png\");";
				break;
			
			default:
				bg_clr = "#aaaaaa";
				bg_icon = "background-image:url(\"../graphics/tab_aaffaa.png\");";
				break;
		}

		out_str += "<table id='a_t' style='width:100%;'><tr>";

		out_str += "	<td style='width:"+width+"px;vertical-align:top;'>";
		out_str += "		<div class=sliding_pan_core id='"+panel_id+"_core' style='width:"+width+"px;background:"+bg_clr+"'></div>";				
		out_str += "		</td>";

		out_str += "	<td style='width:"+this.TAB_WIDTH+"px;vertical-align:top;'>";
		out_str += "		<div class=sliding_pan_tab style='top:"+voffset+"px;"+bg_icon+"'>";
		//out_str += "		<img  border=0 style='margin-top:24px' src='gd_text.php?text="+tab_lable+"&font=4&size=11&color=black'>";
		out_str += "		<div class='vtab_label'>"+tab_lable+"</div>";
		out_str += "		</div>";
		out_str += "	</td>";
		out_str += "</tr></table>";

		out_str += "</div>";

		document.write(out_str);	


		//return out_str;
	}
}

function newWindow(url) {

	var content = "<html lang=\"en\">\
					<head>\
						<title>XeekU Photos</title>\
						<link rel=\"stylesheet\" type=\"text/css\" href=\"javascripts/style.css\"/>\
					</header>\
					<body>\
					";
	content += "<img src='"+url+"'>";
	content += "</body></html>";

	mywindow = window.open (url, "mywindow", "location=0,status=0,scrollbars=0,width=976,height=656");
	mywindow.moveTo(100,100);
}
