var _fe_ns4 = (document.layers)? true:false;
var _fe_ie4 = (document.all)? true:false;
var _fe_layer = new String();
var _fe_style = new String();

if (_fe_ns4){
  _fe_layer = ".layers";
  _fe_style = "";
}else{
  _fe_layer = ".all";
  _fe_style = ".style";
}

function showLayer(layerID) {
	eval("document" + _fe_layer + "['" + layerID + "']" + _fe_style +".visibility = 'visible'");
}

function hideLayer(layerID) {
	eval("document" + _fe_layer + "['" + layerID + "']" + _fe_style +".visibility = 'hidden'");
}

function fixImageCaption(){
	if ( typeof Techline_ImageCell == "undefined") return;
	var tmpStr = new String();
	var imgStr = new String();
	var imgCaption = new String();
	var imgWidth = new String();;
	var pos = 0;
	imgStr = Techline_ImageCell.innerHTML;

	// Extract image caption
	pos = imgStr.indexOf("alt=");
	if (pos != -1) {
		tmpStr = imgStr.substr(pos+5);
		pos = tmpStr.indexOf("\"");
		if (pos != -1) imgCaption = tmpStr.substr(0, pos);
	}
	// Find image width
	pos = imgStr.indexOf("width=");
	if (pos != -1) {
		tmpStr = imgStr.substr(pos+6);
		pos = tmpStr.indexOf(" ");
		if (pos != -1) {
			imgWidth = tmpStr.substr(0, pos);
		}
		else {
			pos = tmpStr.indexOf(">"); // i.e. width is tha last image object property in the tag
			if (pos != -1) imgWidth = tmpStr.substr(0, pos);
		}
	}
	//alert("imgStr: " + imgStr + "\n imgCaption: " + imgCaption + "\n imgWidth: " + imgWidth);
	Techline_ImageCaption.width = imgWidth;
	Techline_ImageCaption.innerHTML = "<span class=\"Caption\">"+imgCaption+"</span>";
	//alert("<span class=\"Caption\">"+imgCaption+"</span>");
}


