//----------------------------------------------------------------------------------------------------------------------

function getLayer(strLayer) {
	var i;
	var colLayers;

	if (document.layers) {
		
		colLayers = layParent.document.layers;
			
		if (colLayers[strLayer])
			return colLayers[strLayer];
				
		for (i = 0; i < colLayers;)
			return(getLayer(strLayer, colLayers[i++]));
				
	} else if (document.all) {
		
		return document.all[strLayer];
			
	} else if (document.getElementById) {
		
		return document.getElementById(strLayer);
			
	}
}
function btnOver(imgName)
{
	if (document.images) {
		if (document.images[imgName].src != eval(imgName + "_in.src")) {
			document.images[imgName].src = eval(imgName + "_on.src");
		}
	}
}
function btnOut(imgName, blnForce)
{
	if (document.images) {
		if ((document.images[imgName].src != eval(imgName + "_in.src")) || (blnForce)) {
			document.images[imgName].src = eval(imgName + "_off.src");
		}
	}
}
function btnIn(imgName)
{
	if (document.images) {
		if (document.images[imgName].src != eval(imgName + "_in.src")) {
			document.images[imgName].src = eval(imgName + "_in.src");
		}
	}
}
function btnEditHideOver(strFrame)
{
	if (document.images) {
		if (isVisible('iframe_' + strFrame) == false) {
			document.images['btn_edit_hide_' + strFrame].src = edit_on.src;
		} else {
			document.images['btn_edit_hide_' + strFrame].src = hide_on.src;
		}
	}
}
function btnEditHideOut(strFrame)
{
	if (document.images) {
		if (isVisible('iframe_' + strFrame) == false) {
			document.images['btn_edit_hide_' + strFrame].src = edit_off.src;
		} else {
			document.images['btn_edit_hide_' + strFrame].src = hide_off.src;
		}
	}
}


function showFrame(strFrame, blnEditHideClick, intProductType)
{
	if (isVisible('iframe_' + strFrame) == false) {
		if (intProductType == 228) {
			hideAll();
		}
		btnIn('btn_' + strFrame);
		if ((document.frmParms[strFrame + '_update'].value == 'true') || (navigator.appName != 'Microsoft Internet Explorer')) {
			reloadFrame(strFrame);
		}
		makeVisible('iframe_' + strFrame);
		makeVisible('line_top_' + strFrame);
		makeVisible('line_bottom_' + strFrame);
		if (strFrame == 'matting') {
			makeVisible('toolbar_matting');
		}
		if (document.images) {
			if (blnEditHideClick) {
				document.images['btn_edit_hide_' + strFrame].src = hide_on.src;
			} else {
				document.images['btn_edit_hide_' + strFrame].src = hide_off.src;
			}
		}
	} else {
		btnOut('btn_' + strFrame, true);
		makeInvisible('iframe_' + strFrame);
		makeInvisible('line_top_' + strFrame);
		makeInvisible('line_bottom_' + strFrame);
		if (strFrame == 'matting') {
			makeInvisible('toolbar_matting');
		}
		if (document.images) {
			if (blnEditHideClick) {
				document.images['btn_edit_hide_' + strFrame].src = edit_on.src;
			} else {
				document.images['btn_edit_hide_' + strFrame].src = edit_off.src;
			}
		}
	}
}

function showDiv(strFrame){
	if (isVisible('div_' + strFrame) == false) {
		makeVisible('div_' + strFrame);
		if (document.images) {
			document.images[strFrame + '_arrow'].src = arrow_up.src;
		}
	} else {
		makeInvisible('div_' + strFrame);
		if (document.images) {
			document.images[strFrame + '_arrow'].src = arrow_down.src;
		}
	}
}

function isVisible(strItem)
{
	if (document.layers) {
		return (getLayer(strItem).visibility == 'visible') ? true : false;
	} else {
		return (getLayer(strItem).style.visibility == 'visible') ? true : false;
	}
}
function makeVisible(strItem)
{
	if (document.layers) {
		getLayer(strItem).visibility = 'show';
		getLayer(strItem).display = 'block';
	} else {
		getLayer(strItem).style.visibility = 'visible';
		getLayer(strItem).style.display = 'block';
	}
}
function makeInvisible(strItem)
{
	if (document.layers) {
		getLayer(strItem).visibility = 'hide';
		getLayer(strItem).display = 'none';
	} else {
		getLayer(strItem).style.visibility = 'hidden';
		getLayer(strItem).style.display = 'none';
	}
}
