function showhide(whichelement, showtrue) {	trxxx = document.getElementById(whichelement)	if (showtrue ==undefined) {		trxxx.style.display = (trxxx.style.display =="none" ? "block" : "none")	}	else	{		trxxx.style.display = (showtrue ? "block" : "none")	}}function DoStdBrokerSearch( ) {	 w=550	 h=700	e = window.open("/fencing/athletesearch.nsf.nsf/Search?openagent&postcode="+ document.forms['BrokerSearch'].BrokerSearchPostCode.value + "&Town=" + document.forms['BrokerSearch'].BrokerSearchTown.value   ,'_new','menubar=no, scrollbars=yes, titlebar=no, toolbar=no, status=yes,width=' + w + ',height=' + h + ',top=20,left=50', false);	var x = (screen.width-w)/2;	var y = (screen.height-h)/2;	e.moveTo(x,y);}function popup(loc, w, h) {	if (w==undefined) w=750	if (h==undefined) h=550	e = window.open(loc,'_new','menubar=no, scrollbars=yes, titlebar=no, toolbar=no, status=yes,width=' + w + ',height=' + h + ',top=20,left=50', false);	var x = (screen.width-w)/2;	var y = (screen.height-h)/2;	e.moveTo(x,y);	}function replaceSubstring(inputString, fromString, toString) {   // Goes through the inputString and replaces every occurrence of fromString with toString   var temp = inputString;   if (fromString == "") {      return inputString;   }   if (toString.indexOf(fromString) == -1) { // If the string being replaced is not a part of the replacement string (normal situation)      while (temp.indexOf(fromString) != -1) {         var toTheLeft = temp.substring(0, temp.indexOf(fromString));         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);         temp = toTheLeft + toString + toTheRight;      }   } else { // String being replaced is part of replacement string (like "+" being replaced with "++") - prevent an infinite loop      var midStrings = new Array("~", "`", "_", "^", "#");      var midStringLen = 1;      var midString = "";      // Find a string that doesn't exist in the inputString to be used      // as an "inbetween" string      while (midString == "") {         for (var i=0; i < midStrings.length; i++) {            var tempMidString = "";            for (var j=0; j < midStringLen; j++) { tempMidString += midStrings[i]; }            if (fromString.indexOf(tempMidString) == -1) {               midString = tempMidString;               i = midStrings.length + 1;            }         }      } // Keep on going until we build an "inbetween" string that doesn't exist      // Now go through and do two replaces - first, replace the "fromString" with the "inbetween" string      while (temp.indexOf(fromString) != -1) {         var toTheLeft = temp.substring(0, temp.indexOf(fromString));         var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);         temp = toTheLeft + midString + toTheRight;      }      // Next, replace the "inbetween" string with the "toString"      while (temp.indexOf(midString) != -1) {         var toTheLeft = temp.substring(0, temp.indexOf(midString));         var toTheRight = temp.substring(temp.indexOf(midString)+midString.length, temp.length);         temp = toTheLeft + toString + toTheRight;      }   } // Ends the check to see if the string being replaced is part of the replacement string or not   return temp; // Send the updated string back to the user} // Ends the "replaceSubstring" function/** * Sets a Cookie with the given name and value. * * name       Name of the cookie * value      Value of the cookie * [expires]  Expiration date of the cookie (default: end of current session) * [path]     Path where the cookie is valid (default: path of calling document) * [domain]   Domain where the cookie is valid *              (default: domain of calling document) * [secure]   Boolean value indicating if the cookie transmission requires a *              secure transmission */function setCookie(name, value, expires, path, domain, secure) {    document.cookie= name + "=" + escape(value) +     	"; expires=Thu, 01-Jan-70 00:00:01 GMT" + "; path=/" +        ((domain) ? "; domain=" + domain : "") +        ((secure) ? "; secure" : "");//        ((expires) ? "; expires=" + expires.toGMTString() : "") +//        ((path) ? "; path=" + path : "") +}/** * Gets the value of the specified cookie. * * name  Name of the desired cookie. * * Returns a string containing value of specified cookie, *   or null if cookie does not exist. */function getCookie(name){	var dc = document.cookie;	var prefix = name + "=";	var begin = dc.indexOf("; " + prefix);	if (begin == -1) {		begin = dc.indexOf(prefix);		if (begin != 0) return null;	} else {		begin += 2;	}	var end = document.cookie.indexOf(";", begin);	if (end == -1) {		end = dc.length;	}	return unescape(dc.substring(begin + prefix.length, end));}/** * Deletes the specified cookie. * * name      name of the cookie * [path]    path of the cookie (must be same as path used to create cookie) * [domain]  domain of the cookie (must be same as domain used to create cookie) */function deleteCookie(name, path, domain) {	if (getCookie(name)) {		document.cookie = name + "=" + 			((path) ? "; path=" + path : "") +			((domain) ? "; domain=" + domain : "") +			"; expires=Thu, 01-Jan-70 00:00:01 GMT";	}}/* ------------------------------------------------------------------------------     ALLOWS LANGUAGE SWITCHING/* ------------------------------------------------------------------------------*/function setlanguage(lang) {	setCookie("language", lang)	document.location.href = document.location.href	window.location.reload(false)}/* ------------------------------------------------------------------------------     USED WITH SHOWSUB ON HEADER/* ------------------------------------------------------------------------------*/function MM_showHideLayers() { //v6.0  var i,p,v,obj,args=MM_showHideLayers.arguments;  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }    obj.visibility=v; }}function MM_findObj(n, d) { //v4.01  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {    d=parent.frames[n_substring(p+1)].document; n=n_substring(0,p);}  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);  if(!x && d.getElementById) x=d.getElementById(n); return x;}