	function spiexpand (strIdText, strIdLink, strIframeID) {
	// expands (shows) the element with ID strIdText, and hides the element with ID strIdLink (if specified)
	// strIframe is optional, if set to an Iframe ID it will check for the URL parameter &wait=1 and will remove it (reloads the Iframe)
		if (document.getElementById) {
			var objTarget = document.getElementById (strIdText);
			if (objTarget) {
				objTarget.style.display="block";
			}
			if (strIdLink) {
				objTarget = document.getElementById (strIdLink);
				if (objTarget) {
					objTarget.style.display="none";
				}
			}
			if (spiexpand.arguments.length >= 3) {
				objIframe = document.getElementById (strIframeID);
				if (objIframe) {
					strSource = objIframe.src;
					if (strSource.indexOf("&wait=1") >= 0) {
						objIframe.src = strSource.replace(/\&wait\=1/,"");
					}
				}
			}
		}
	}
	function spicollapse (strIdText, strIdLink) {
	// collapses (hides) the element with ID strIdText, and shows element strIdLink if specified
		if (document.getElementById) {
			var objTarget = document.getElementById (strIdText);
			if (objTarget) {
				objTarget.style.display="none";
			}
			if (strIdLink) {
				objTarget = document.getElementById (strIdLink);
				if (objTarget) {
					objTarget.style.display="block";
				}
			}
		}
	}
	
	function spiExpandLink (strIdText, strIdLink, strLinktext, strIFrameID) {
	// computes an Expand link for section with Id strIdText, with the Id strIdLink, link text strLinktext
	// strIFrameID (optional) is the ID of the IFrame showing the external search results, whose URL should be changed if the &wait=1 parameter is present
		if (document.getElementById) {
			if (spiExpandLink.arguments.length < 4) {
				strIFrameIDParameter = "";
			} else {
				strIFrameIDParameter = strIFrameID;
			}
			return ('<a id="' + strIdLink +'" href="#" onclick="spiexpand(\'' + strIdText + '\',\'' + strIdLink + '\', \'' + strIFrameIDParameter + '\');return(false)" class="expandOpen">' + strLinktext + '</a>');
		} else {
			return("");
		}
	}
	function spiCollapseLink (strIdText, strIdLink, strLinktext) {
	// computes a Collapse  link for section with Id strIdText, with the Id strIdLink, link text strLinktext
		if (document.getElementById) {
			return ('<a id="' + strIdLink +'" href="#" onclick="spicollapse(\'' + strIdText + '\',\'' + strIdLink + '\');return(false)" class="expandClose">' + strLinktext + '</a>');
		} else {
			return("");
		}
	}
	
	// when Javascript is active and getElementById is present, write style to hide text elements
	if (document.getElementById) {
		document.writeln ('<style type="text/css">');
		document.writeln ('.collapsibleSection { display:none; }');
		document.writeln ('</style>');
	}
