if (typeof wdk.control == "undefined")
{
wdk.control = new Object();
wdk.control.Button = function (btnId)
{
this.m_button = document.getElementById(btnId);
}
wdk.control.Button.prototype.setDisabled = function (isDisabled)
{
if (this.m_button == null)
return;
this.m_button.disabled = isDisabled;
if (wdk.dom.hasClass(this.m_button, "image"))
{
var imgs = this.m_button.getElementsByTagName("IMG");
if (imgs.length == 2)
{
imgs[0].style.display = (isDisabled) ? "none" : "inline";
imgs[1].style.display = (!isDisabled) ? "none" : "inline";
}
}
}
wdk.control.Panel = new function()
{
this.setVisible = function (panelName, isVisible)
{
if (typeof panelName == undefined || panelName == null)
return;
var elems = wdk.dom.getElementsByClassName(null, panelName, null);
for (var i=0; i<elems.length; i++)
{
var elem = elems[i];
elem.style.display = (isVisible) ? '' : 'none';
}
}
}
wdk.control.get = function (id)
{
var elem = document.getElementById(id);
if (elem == null)
return null;
if (elem.m_ctrl == null)
{
if (wdk.dom.hasClass(elem, "button"))
elem.m_ctrl = new wdk.control.Button(id);
}
return elem.m_ctrl;
}
} // end if (typeof wdk.control == "undefined")

