var cGlassButton = function()
{
	var width;
	var height;
	var backgroundColor;
	var selectColor;
	var textColor;
	var selecttextColor;
	this.borderwidth = 1;
	var ID;
	
	this.Over = function()
	{
		document.getElementById(this.ID).style.backgroundColor = this.selectColor;
		document.getElementById(this.ID+'text').style.color = this.selectTextColor;
	}
	
	this.Out = function()
	{
		document.getElementById(this.ID).style.backgroundColor = this.backgroundColor;
		document.getElementById(this.ID+'text').style.color = this.textColor;
		document.getElementById(this.ID).style.width = this.width+'px';
		document.getElementById(this.ID).style.height = this.height+'px';
		document.getElementById(this.ID).style.borderWidth = this.borderwidth+'px';
	}
	
	this.Down = function()
	{
		document.getElementById(this.ID).style.width = this.width-this.borderwidth-1+'px';
		document.getElementById(this.ID).style.height = this.height-2+'px';
		document.getElementById(this.ID).style.borderWidth = this.borderwidth+1+'px';
	}
	
	this.Up = function()
	{
		document.getElementById(this.ID).style.width = this.width+'px';
		document.getElementById(this.ID).style.height = this.height+'px';
		document.getElementById(this.ID).style.borderWidth = this.borderwidth+'px';
	}
}

function print_r(theObj)
{
	alert(theObj);
	if(theObj.constructor == Array || theObj.constructor == Object)
	{
		document.write("<ul>");
		for(var p in theObj)
		{
			if(theObj[p].constructor == Array || theObj[p].constructor == Object)
			{
				document.write("<li>["+p+"] => "+typeof(theObj)+"</li>");
				document.write("<ul>");
				print_r(theObj[p]);
				document.write("</ul>");
			} 
			else 
			{
				document.write("<li>["+p+"] => "+theObj[p]+"</li>");
			}
		}
		document.write("</ul>");
	}
}

function Button_Over(Button_ID)
{
	document.getElementById(Button_ID+'_l').style.backgroundImage = 'url(/public/images/buttons/glass_button_left_corner_mOver.png)';
	document.getElementById(Button_ID+'_c').style.backgroundImage = 'url(/public/images/buttons/glass_button_mOver.png)';
	document.getElementById(Button_ID+'_label').style.paddingTop = "5px";
	document.getElementById(Button_ID+'_r').style.backgroundImage = 'url(/public/images/buttons/glass_button_right_corner_mOver.png)';
	//window.alert(paddingTop);
}


function Button_Out(Button_ID)
{
	document.getElementById(Button_ID+'_l').style.backgroundImage = 'url(/public/images/buttons/glass_button_left_corner.png)';
	document.getElementById(Button_ID+'_c').style.backgroundImage = 'url(/public/images/buttons/glass_button.png)';
	document.getElementById(Button_ID+'_label').style.paddingTop = "6px";
	document.getElementById(Button_ID+'_r').style.backgroundImage = 'url(/public/images/buttons/glass_button_right_corner.png)';
}

function Button_Down(Button_ID, Url)
{
	document.getElementById(Button_ID+'_l').style.backgroundImage = 'url(/public/images/buttons/glass_button_left_corner_mDown.png)';
	document.getElementById(Button_ID+'_c').style.backgroundImage = 'url(/public/images/buttons/glass_button_mDown.png)';
	document.getElementById(Button_ID+'_r').style.backgroundImage = 'url(/public/images/buttons/glass_button_right_corner_mDown.png)';
}
function Button_Up(Button_ID)
{
	document.getElementById(Button_ID+'_l').style.backgroundImage = 'url(/public/images/buttons/l_no_shadow.png)';
	document.getElementById(Button_ID+'_c').style.backgroundImage = 'url(/public/images/buttons/c_no_shadow.png)';
	document.getElementById(Button_ID+'_r').style.backgroundImage = 'url(/public/images/buttons/r_no_shadow.png)';
}
function ToolTipShow(TT_ID)
{
	setTimeout('ToolTipShowPrepare("'+TT_ID+'")', 300);
}
function ToolTipShowPrepare(TT_ID)
{
	document.getElementById(TT_ID).style.display = 'inline-block';
}
function ToolTipHide(TT_ID)
{
	setTimeout('ToolTipHidePrepare("'+TT_ID+'")', 300);
}
function ToolTipHidePrepare(TT_ID)
{
	//document.getElementById(TT_ID).hide();
	document.getElementById(TT_ID).style.display = 'none';
}
function setBarWidth(ID, Width, Minimum, Maximum, Current)
{
	Current_Width = ((Width-2)/(Maximum-Minimum))*Current;
	//window.alert(Current_Width);
	document.getElementById(ID).style.width = Current_Width+'px';
} 

