function invisibleById(id)
{var obj=getElementByIdOrName(id);if(obj)
{obj.style.visibility='hidden';}}
function visibleById(id)
{var obj=getElementByIdOrName(id);if(obj)
{obj.style.visibility='visible';}}
function setStyle(id,style)
{var obj=getElementByIdOrName(id);if(obj)
{obj.className=style;}}
function setStyleByRef(obj,style)
{obj.className=style;}
function hideById(id)
{getElementByIdOrName(id).style.display='none';}
function showById(id)
{getElementByIdOrName(id).style.display='block';}
function showInlineById(id)
{getElementByIdOrName(id).style.display='inline';}
function showTRById(id)
{if(document.all)
{showById(id);}
else
{getElementByIdOrName(id).style.display='table-row';}}
function showTBodyById(id)
{if(document.all)
{showById(id);}
else
{getElementByIdOrName(id).style.display='table-row-group';}}
function showTDById(id)
{if(document.all)
{showById(id);}
else
{getElementByIdOrName(id).style.display='table-cell';}}
function xParseInt(str)
{var res=parseInt(str,10);if(isNaN(res))res=0;return res;}
function xParseFloat(str)
{var res=parseFloat(str);if(isNaN(res))res=0;return res;}
function getCheckBox(id)
{return getElementByIdOrName(id).checked;}
function setCheckBox(id,checked)
{getElementByIdOrName(id).checked=checked;}
function getElementInnerHTML(id)
{if(getElementByIdOrName(id))
{return getElementByIdOrName(id).innerHTML;}
return false;}
function setElementInnerHTML(id,value)
{if(getElementByIdOrName(id))
{getElementByIdOrName(id).innerHTML=value;return true;}
return false;}
function getElementByIdOrName(id){if(document.getElementById(id))
{return document.getElementById(id);}
else if(window.getElementValueForm!=null&&window.getElementValueForm.elements[id])
return window.getElementValueForm.elements[id];}
function setElementValue(id,value)
{var o=getElementByIdOrName(id);if(o)
{o.value=value;return true;}
return false;}
function getElementValue(id)
{var o=getElementByIdOrName(id);if(o)
{return o.value;}
return false;}
function formatMySQLDate(mysqlDate)
{datebits=mysqlDate.split('-');if(datebits[0]!=0)
{return datebits[2]+'/'+datebits[1]+'/'+datebits[0];}
else
{return'';}}
function trim(s)
{return s.replace(/^\s\s*/,'').replace(/\s\s*$/,'');}
function formatCurrency(value)
{return xParseFloat(value).toFixed(2);}
function getSelectedValue(id)
{var select=getElementByIdOrName(id);if(select&&(select.selectedIndex>=0))
{value=select.options[select.selectedIndex].value;}
else
{value=false;}
return value;}
function setSelectedIndexByValue(id,value)
{var i;var select=getElementByIdOrName(id);if(select)
{for(i=0;i<select.options.length;i++)
{if(value==select.options[i].value)
{select.selectedIndex=i;return i;}}}
return false;}
function setFocus(id)
{var o=getElementByIdOrName(id);if(o)
o.focus();return false;}
