function roundAvail() {
if ((!document.getElementById) || (!document.createElement)) { return(false); }
isXHTML=/html\:/.test(document.getElementsByTagName('body')[0].nodeName);
return(true);
}
function getRoundAttr(elem)
{
var col, style;
var res = new Object()
var e = CreateEl("b");
e.className = "corner";
elem.appendChild(e);
var s = getElementStyle(e)
var se = getElementStyle(elem);
if ((s) && (se)) {
res.tlSize = getPxAttrIntValue(getSpecIdxValue(s.paddingLeft, s.padding, 3));
res.trSize = getPxAttrIntValue(getSpecIdxValue(s.paddingTop, s.padding, 0));
res.brSize = getPxAttrIntValue(getSpecIdxValue(s.paddingRight, s.padding, 1));
res.blSize = getPxAttrIntValue(getSpecIdxValue(s.paddingBottom, s.padding, 2));
res.top = ((res.tlSize>0) || (res.trSize>0));
res.bottom = (res.blSize>0) || (res.brSize>0);
res.borderTopWidth = getPxAttrIntValue( (se.borderTopWidth!=""?se.borderTopWidth:se.borderWidth) );
res.borderBottomWidth = getPxAttrIntValue( (se.borderBottomWidth!=""?se.borderBottomWidth:se.borderWidth) );
res.borderLeftWidth =  getPxAttrIntValue( (se.borderLeftWidth!=""?se.borderLeftWidth:se.borderWidth) );
res.borderRightWidth =  getPxAttrIntValue( (se.borderRightWidth!=""?se.borderRightWidth:se.borderWidth) );
res.borderTopColor   = getSpecIdxValue( se.borderTopColor, se.borderColor,0);
res.borderRightColor   = getSpecIdxValue( se.borderRightColor, se.borderColor,1);
res.borderBottomColor   = getSpecIdxValue( se.borderBottomColor, se.borderColor,2);
res.borderLeftColor   = getSpecIdxValue( se.borderLeftColor, se.borderColor,3);
res.borderStyle = getSpecIdxValue( se.borderLeftStyle, se.borderStyle,0);
res.topColor = se.backgroundColor; 
res.bottomColor = se.backgroundColor; 
res.backgroundColor = getParentBkColor(elem); 
col = getSpecIdxValue( s.borderTopColor, s.borderColor, 0);
style = getSpecIdxValue( s.borderTopStyle, s.borderStyle, 0);
if (style != "none") {
if ((col) && (col != "")) { res.topColor = col; }
}
col = getSpecIdxValue( s.borderBottomColor, s.borderColor, 2);
style = getSpecIdxValue( s.borderBottomStyle, s.borderStyle, 0);
if (style != "none") {
if ((col) && (col != "") )  { res.bottomColor = col; }
}
res.borders = (((res.borderLeftWidth>0) || (res.borderRightWidth > 0)) && (res.borderStyle != "none"));
}
else {res = null;}
elem.removeChild(e);
return(res);
}
function addCorners( className, elem, prms) {
function _createE(idx, aml, amr, borderWidth, borderColor, color) 
{
var e = CreateEl("b");
e.style.display = "block";
e.style.height = "1px";
e.style.fontSize  = "1px";
e.style.overflow = "hidden";
e.style.marginLeft = Math.max(aml,0) + "px";
e.style.marginRight = Math.max(amr,0) + "px";
e.style.backgroundColor = color;
if (prms.borders) {
e.style.borderColor = borderColor;
e.style.borderWidth = "0";
e.style.borderLeftWidth= prms.borderLeftWidth+"px";
e.style.borderRightWidth= prms.borderRightWidth+"px";
e.style.borderStyle = "solid";
if (idx <= borderWidth) {
e.style.backgroundColor = borderColor;}
}
return e;
}
function _createC(lSize, rSize, borderWidth, borderColor, color, bBottom)
{
var ml, mr;
var d = CreateEl("b");
d.style.display = "block";
d.style.backgroundColor = prms.backgroundColor;
var nbl = Math.max( Math.max( lSize, rSize), borderWidth+1);
for (var i=1;i<nbl;i++) {
if (i<lSize) {
ml = Math.round( Math.sqrt( Math.pow(lSize,2) - Math.pow(lSize-i,2)));
ml = lSize - ml;
}
else {
ml = 0;} 
if (rSize == lSize) { 
mr = ml; }
else if (i < rSize) {
mr = Math.round( Math.sqrt( Math.pow(rSize,2) - Math.pow(rSize-i,2)));
mr = rSize - mr;
}
else {
mr = 0;}
e = _createE(i, ml,mr, borderWidth, borderColor, color);
if (bBottom) {
d.insertBefore(e, d.firstChild);}
else {
d.appendChild(e); }
}
return (d);
}
if ((!prms.top) && (!prms.bottom)) {return; }
var elemStyle = getElementStyle(elem);
elem.style.border = "none";
{
var ch,ch2;
var div = CreateEl("div");
div.style.display = "block";
div.className = className + "content"
div.style.border = "none";
div.style.borderLeftWidth = prms.borderLeftWidth+'px';
div.style.borderLeftColor = prms.borderLeftColor;
div.style.borderLeftStyle = prms.borderStyle;
div.style.borderRightWidth = prms.borderRightWidth+'px';
div.style.borderRightColor = prms.borderRightColor;
div.style.borderRightStyle = prms.borderStyle;
div.style.margin = elemStyle.margin;
div.style.marginTop = elemStyle.marginTop;
div.style.marginLeft = elemStyle.marginLeft;
div.style.marginRight = elemStyle.marginRight;
div.style.marginBottom = elemStyle.marginBottom;
elem.style.marginTop = "0px";
elem.style.marginLeft = "0px";
elem.style.marginRight = "0px";
elem.style.marginBottom = "0px";
div.style.padding = elemStyle.padding;
div.style.paddingTop = elemStyle.paddingTop;
div.style.paddingLeft = elemStyle.paddingLeft;
div.style.paddingRight = elemStyle.paddingRight;
div.style.paddingBottom = elemStyle.paddingBottom;
elem.style.paddingTop = "0px";
elem.style.paddingLeft = "0px";
elem.style.paddingRight = "0px";
elem.style.paddingBottom = "0px";
var rex = new RegExp("(?:^|\s|)("+className+"head)(?=\s|$)", "i");
var elemHead = null;
for (var i=0; i< elem.childNodes.length;i++)
{
ch = elem.childNodes[i];
if (ch.className) {
if (!ch.className.match(rex)) { }
else {
elemHead = ch;
with (elemHead.style) {
borderLeftStyle=div.style.borderLeftStyle;
borderLeftColor=div.style.borderLeftColor;
borderLeftWidth=div.style.borderLeftWidth;
borderRightStyle=div.style.borderRightStyle;
borderRightColor=div.style.borderRightColor;
borderRightWidth=div.style.borderRightWidth;
margin = "0px";
}
}
}
}
var nRemove=0;
while (elem.childNodes.length > nRemove) {
ch = elem.childNodes[nRemove];
if (ch == elemHead) {
nRemove++;
} else {
elem.removeChild(ch);
div.appendChild(ch);
}
}
elem.appendChild(div);
}
if ((prms.top) || (prms.borderTopWidth)) {
elem.insertBefore( _createC( prms.tlSize, prms.trSize, prms.borderTopWidth, prms.borderTopColor, prms.topColor, false), elem.firstChild) }
if ((prms.bottom) || (prms.borderBottomWidth)) {
elem.appendChild( _createC(prms.blSize, prms.brSize, prms.borderBottomWidth, prms.borderBottomColor, prms.bottomColor, true)) }
}
function addRoundedCorners( className)  {
function _checkElement(e){
var prms;
if (e) {
if ((e.className) && (e.tagName.match(/div/i))) {
if (!e.className.match(re)) {
} else {
prms = getRoundAttr(e);
if (prms) { addCorners(className, e, prms); }
}
}
for (var i=0;i<e.childNodes.length;i++) {
_checkElement( e.childNodes[i]);
}
}
}
var re = new RegExp("(?:^|\s|)("+className+")(?=\s|$)", "i");
_checkElement(document);
}
function FpToggleDisplay(blockId, titleId)
{
var block = document.getElementById(blockId);
var title = document.getElementById(titleId);
if (block.style.display != "none")
{
block.style.display = "none";
}
else
{
block.style.display = "block";
}
return false;
}