function setEnable(field, ifenable) {
		if (!ifenable) color="#F6F4E7";
		else color="#FFFFFF";

		field.disabled=!ifenable;
		field.style.backgroundColor=color;
}

function changeVisibility(pole) {
  setVisible(pole, pole.style.display == 'none');  
}
function setVisible(pole, ifvisible) {
  if (ifvisible)
    pole.style.display = 'block';
  else
    pole.style.display = 'none';

}
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}
function isVisible(pole) {
  return pole.style.display != 'none';
}
function getSelectedTab(tabContainerId) {
	var tabContainer,tabWrap,tabs,selectedIndex;
	with (org.ditchnet) {
		tabContainer = document.getElementById(tabContainerId);
		tabWrap 	 = dom.DomUtils.getFirstChildByClassName(
											tabContainer,
											jsp.TabUtils.TAB_WRAP_CLASS_NAME );
		tabs		 = dom.DomUtils.getChildrenByClassName(
											tabWrap,
											jsp.TabUtils.TAB_CLASS_NAME );
											
		for (var i = 0; i < tabs.length; i++) {
			if (dom.DomUtils.hasClassName(tabs[i],dom.DomUtils.FOCUSED_CLASS_NAME)) {
				selectedIndex = i;
				break;
			}
		}
    tabPaneWrap		= dom.DomUtils.getFirstChildByClassName(
										tabContainer,
										jsp.TabUtils.TAB_PANE_WRAP_CLASS_NAME );
		tabPanes		= dom.DomUtils.getChildrenByClassName(
										tabPaneWrap,
										jsp.TabUtils.TAB_PANE_CLASS_NAME );
		return tabPanes[selectedIndex].id;
	}
};


