function showHide(id) 
{
	var targetElement, imageElement;
	var targetElement = document.getElementById("T" + id);
	//var imageElement = document["I" + id];

	if (targetElement.style.display == "none"){
		targetElement.style.display = "";
		//imageElement.src="images/window_minus.gif";
	}else{
		targetElement.style.display = "none";
		//imageElement.src="images/window_plus.gif";
	}
}


function showIterate(id,loop)
{
//alert("id=" + id + "loop=" + loop);
	// First collapse all iterates
	for(i=1;i<=loop;i++){
		if(document.getElementById("T"+i) && id!=i){
//			alert("hiding "+i);
			document.getElementById("T"+i).style.display = "none";
		}
	}
	// Now show the one we want
	if(document.getElementById("T"+id)){
		document.getElementById("T"+id).style.display = "";
	}
}

function hideIterates(loop) 
{
	for(i=1;i<=loop;i++){
		if(document.getElementById("T"+i)){
			document.getElementById("T"+i).style.display = "none";
		}
	}
}

function setPointer(theRow, thePointerColor)
{
    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        var theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        var theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    for (var c = 0; c < rowCellsCnt; c++) {
        theCells[c].style.backgroundColor = thePointerColor;
    }

    return true;
}
var preloadFlag = true;
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		document[changeImages.arguments[0]].src = changeImages.arguments[1];
	}
}

function preloadImages() {
	if (document.images) {
		silk_over = newImage("../images/silk/silk_jw_over.jpg");
		preloadFlag = true;
	}
}
