var isHelpOpened = false;

function setHelpHeight (state) {
	var helpFrame = document.getElementById ('helpFrame');
	var mainFrame = document.getElementById ('mainFrame');
	var mainFrameTD = document.getElementById ('mainFrameTD');
	var helpHandleHide = frames['helpFrame'].document.getElementById ('helpHandleHide');
	var helpHandleShow = frames['helpFrame'].document.getElementById ('helpHandleShow');
	var helpContent = frames['helpFrame'].document.getElementById ('helpContent');
	var helpArea = frames['helpFrame'].document.getElementById ('helpArea');
	if (self.innerHeight) {// all except Explorer
		y = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		y = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		y = document.body.clientHeight;
	}

	if (state == false) {
		helpHeight = 20;
		helpHandleHide.style.display = 'none';
		helpHandleShow.style.display = 'block';
		helpContent.style.display = 'none';
		if (parent.isIEdoctype) {
			frames['helpFrame'].document.body.scroll = 'no';
		}
		isHelpOpened = false;
	} else {
		helpHeight = 84;
		helpHandleShow.style.display = 'none';
		helpHandleHide.style.display = 'block';
		helpContent.style.display = 'block';
		if (parent.isIEdoctype) {
			var maxHeight = 65;
			if (helpContent.clientHeight > maxHeight) {
			window.status = helpContent.clientHeight;
				frames['helpFrame'].document.body.scroll = 'yes';
			} else {
				frames['helpFrame'].document.body.scroll = 'no';
			}
		}
		isHelpOpened = true;
	}
	mainFrameHeight = y - helpHeight;
	helpFrame.style.height = helpHeight + 'px';
	helpArea.style.height = (helpHeight - 4) + 'px';
	mainFrame.style.height = mainFrameHeight + 'px';
	mainFrameTD.style.height = mainFrameHeight + 'px';
	return false;
}

function setFramesSizes() {
	var x,y;
	if (self.innerHeight) {// all except Explorer
		x = self.innerWidth;
		y = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	mainFrameHeight = y - helpHeight;
	mainFrameWidth = x;
	var mainFrame = document.getElementById ('mainFrame');
	var mainFrameTD = document.getElementById ('mainFrameTD');
	var helpFrame = document.getElementById ('helpFrame');
	mainFrame.style.height = mainFrameHeight + 'px';
	mainFrame.style.width = mainFrameWidth + 'px';
	helpFrame.style.width = mainFrameWidth + 'px';
	mainFrameTD.style.height = mainFrameHeight + 'px';
	mainFrameTD.style.width = mainFrameWidth + 'px';
	if (parent.isIEdoctype) {
		var maxHeight = 65;
		var helpContent = frames['helpFrame'].document.getElementById('helpContent');
		if (helpContent.clientHeight > maxHeight) {
		window.status = helpContent.clientHeight;
			frames['helpFrame'].document.body.scroll = 'yes';
		} else {
			frames['helpFrame'].document.body.scroll = 'no';
		}
	}
}
