function SwitchNav(sButton,sElement,sPlus,sMinus) {
// SwitchNav
//	sButton:    ID of navigation image (icon), that was clicked
//	sElement:	ID of element (<DIV>,<TABLE> etc.), which is to show or hide
//	sPlus:      URL of image file for collapsed-icon
//	sMinus:     URL of image file for expanded-icon
	if (document.getElementById(sElement).style.display=="none") {
		document.getElementById(sElement).style.display="block";
        document.getElementById(sButton).src=sMinus;
    }
    else {
		document.getElementById(sElement).style.display="none";
        document.getElementById(sButton).src=sPlus;
    }
}


function dosearch(wpid,ico,stxt) {

	var i=0;
	var j=0;
	var oRow, oCell;
	var s = document.getElementById(wpid+"txtSearchBox").value.toUpperCase();
	var t;

	if (s != "") {
		var oSearchResults = document.getElementById(wpid+"SearchResults");
		oSearchResults.innerHTML = "";
		document.getElementById(wpid+"Body").style.visibility="hidden";

		var oTable = document.createElement("table");
		oTable.border="0";
		oTable.width="100%";
		var oTBody = oTable.appendChild(document.createElement("tbody"));
		oRow = oTBody.insertRow();
		oCell = oRow.insertCell();
		oCell.colSpan="3";
		oCell.innerHTML = stxt;
		while (document.getElementById(wpid+i)) {
			//t = document.getElementById(wpid+i).cells.item(2).innerHTML.toUpperCase();
			t = document.getElementById(wpid+"_title_"+i).innerHTML.toUpperCase();
			if (t.match(s)) {
				oRow = oTBody.insertRow();
				oCell = oRow.insertCell();
				oCell.noWrap="true";
				oCell.width="1%";
				oCell.innerHTML = '<img border="0" align="absmiddle" src="'+ico+'">';
				oCell = oRow.insertCell();
				oCell.noWrap="true";
				oCell.width="1%";
				oCell.innerHTML = document.getElementById(wpid+i).cells.item(1).innerHTML;
				oCell = oRow.insertCell();
				oCell.width="99%";
				oCell.innerHTML = document.getElementById(wpid+i).cells.item(2).innerHTML;
				j++;
			}
			i++;
		}
		oSearchResults.appendChild(oTable);
		oSearchResults.style.visibility = "visible";
		document.getElementById(wpid+"btnStopSearch").style.visibility="visible";
	}
	else {
		resetsearch(wpid);
	}
}


function resetsearch(wpid) {
	document.getElementById(wpid+"btnStopSearch").style.visibility="hidden";
	document.getElementById(wpid+"SearchResults").innerHTML="";
	document.getElementById(wpid+"SearchResults").height="0";
	document.getElementById(wpid+"SearchResults").style.visibility="hidden";
	document.getElementById(wpid+"Body").style.visibility="visible";
	document.getElementById(wpid+"txtSearchBox").focus();
}
