function getStyleObject(objectId) {
	if(document.getElementById && document.getElementById(objectId)) {
		return document.getElementById(objectId).style;
	} else if (document.all && document.all(objectId)) {
		return document.all(objectId).style;
	} else if (document.layers && document.layers[objectId]) {
		return document.layers[objectId];
	} else {
		return false;
	}
}

function changeObjectVisibility(objectId, newVisibility) {
	var styleObject = getStyleObject(objectId);
	if (styleObject) {
		styleObject.visibility = newVisibility;
		styleObject.display = ((styleObject.visibility == 'hidden') ? "none" : "");
		return true;
	} else {
		return false;
	}
}

function changeTextVisibility(objectId) {
	var styleObject = getStyleObject(objectId);
	if (styleObject) {
		styleObject.visibility = ((styleObject.visibility == 'hidden') ? "visible" : "hidden");
		document.images[objectId + "a"].src = ((styleObject.visibility == 'hidden') ? "../collapse.gif" : "../expand.gif");
		styleObject.display = ((styleObject.visibility == 'hidden') ? "none" : "");
		return true;
	} else {
		return false;
	}
}

function hideAll() {
	for(var i = 1; i < compMax; i++) {
		changeObjectVisibility("compField" + i,"hidden");
	}
}

function showCurrent(objectNum) {
	for(i = 0; i < compMax; i++) {
		if(objectNum == i) {
			changeObjectVisibility("compField" + i,"visible");
			currentObj=i;
		} else
			changeObjectVisibility("compField" + i,"hidden");
	}
}

function showCurrentNew(objectNum) {
	if(currentObj==objectNum) return;
	document.getElementById("i"+currentObj.toString()).style.backgroundColor='';
	document.getElementById("compField").innerHTML = "<br /><b style='color:#050'>Loading. Please Wait...</b><p />";
	window.frames[0].document.location.href = "comps/" + compList[objectNum] + ".shtml";
	currentObj=objectNum;
	document.getElementById("i"+currentObj.toString()).style.backgroundColor="#dd8";
}

function printView() {
	var compShow = "comps/" + compList[currentObj] + ".shtml" ;
	compwindow(compShow);
}

function shrinkComps() {
	compDiv = document.getElementById("collapseComps");
	compDiv.style.overflow = (compDiv.style.overflow=="auto"?"visible":"auto");
	compDiv.style.height = (compDiv.style.overflow=="auto"?"46px":"");
	document.images["colComps"].src = (compDiv.style.overflow=="auto"?"../collapse.gif" : "../expand.gif");
}


