function doOver()
{
	var toEl=getReal(window.event.toElement,"className","coolButton");
	var fromEl=getReal(window.event.fromElement,"className","coolButton");
	if(toEl==fromEl)return;var el=toEl;
		var cDisabled=el.cDisabled;
	cDisabled=(cDisabled!=null);
	if(el.className=="coolButton")
		el.onselectstart=new Function("return false");
	if((el.className=="coolButton")&&!cDisabled)
	{
		makeRaised(el);
	}
}

function doOut()
{
	var toEl=getReal(window.event.toElement,"className","coolButton");
	var fromEl=getReal(window.event.fromElement,"className","coolButton");
	if(toEl==fromEl)
		return;
	var el=fromEl;
	var cDisabled=el.cDisabled;
	cDisabled=(cDisabled!=null);
	var cToggle=el.cToggle;
	toggle_disabled=(cToggle!=null);
	if(cToggle&&el.value)
	{
		makePressed(el);
	}
	else if ((el.className=="coolButton")&&!cDisabled)
	{
		makeFlat(el);
	}
}

function doDown()
{
	el=getReal(window.event.srcElement,"className","coolButton");
	var cDisabled=el.cDisabled;cDisabled=(cDisabled!=null);
	if((el.className=="coolButton")&&!cDisabled)
	{
		makePressed(el);
	}
}

function doUp()
{
	el=getReal(window.event.srcElement,"className","coolButton");
	var cDisabled=el.cDisabled;
	cDisabled=(cDisabled!=null);
	if((el.className=="coolButton")&&!cDisabled)
	{
		makeRaised(el);
	}
}


function makeFlat(el)
{
	with(el.style)
	{
		background="";
		border="1px solid rgb(223,223,223)";
		padding="1px";
	}
}

function makeRaised(el)
{
	with(el.style)
	{
		borderLeft="1px solid buttonhighlight";
		borderRight="1px solid buttonshadow";
		borderTop="1px solid buttonhighlight";
		borderBottom="1px solid buttonshadow";
		padding="1px";
	}
}

function makePressed(el)
{
	with(el.style)
	{
		borderLeft="1px solid buttonshadow";
		borderRight="1px solid buttonhighlight";
		borderTop="1px solid buttonshadow";
		borderBottom="1px solid buttonhighlight";
		paddingTop="2px";
		paddingLeft="2px";
		paddingBottom="0px";
		paddingRight="0px";
	}
}

function initCoolButtons()
{
	document.onmouseover=doOver;
	document.onmouseout=doOut;
	document.onmousedown=doDown;
	document.onmouseup=doUp;
}
initCoolButtons();

