<!--
/*============================================================================================================*/
var isIE=(navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin=(navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera=(navigator.userAgent.indexOf("Opera") != -1) ? true : false;
/*============================================================================================================*/
function clearme(FormField) {
	if (FormField.defaultValue==FormField.value) {
		FormField.value=""
	}//end if (FormField.defaultValue==FormField.value)
}//end function
/*============================================================================================================*/
function burst() {
	if (top.location!=self.location) {
		top.location=self.location;
	}//end if (top.location!=self.location)
}//end function
/*============================================================================================================*/
function ControlVersion() {
	var version;
	var axo;
	var e;
	try {
		axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version=axo.GetVariable("$version");
	} catch (e) {
	}//end try
	if (!version) {
		try {
			axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			version="WIN 6,0,21,0";
			axo.AllowScriptAccess="always";
			version=axo.GetVariable("$version");
		} catch (e) {
		}//end try
	}//end if (!version)
	if (!version) {
		try {
			axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version=axo.GetVariable("$version");
		} catch (e) {
		}//end try
	}//end if (!version)
	if (!version) {
		try {
			axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version="WIN 3,0,18,0";
		} catch (e) {
		}//end try
	}//end if (!version)
	if (!version) {
		try {
			axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version="WIN 2,0,0,11";
		} catch (e) {
			version=-1;
		}//end try
	}//end if (!version)
	return version;
}//end function
/*============================================================================================================*/
function GetSwfVer(){
	var flashVer=-1;
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2=navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription=navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray=flashDescription.split(" ");
			var tempArrayMajor=descArray[2].split(".");			
			var versionMajor=tempArrayMajor[0];
			var versionMinor=tempArrayMajor[1];
			var versionRevision=descArray[3];
			if (versionRevision == "") {
				versionRevision=descArray[4];
			}//end if (versionRevision == "")
			if (versionRevision[0] == "d") {
				versionRevision=versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision=versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision=versionRevision.substring(0, versionRevision.indexOf("d"));
				}//end if (versionRevision.indexOf("d") > 0)
			}//end if (versionRevision[0] == "d")
			var flashVer=versionMajor + "." + versionMinor + "." + versionRevision;
		}//end if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"])
	}
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer=4;
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer=3;
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer=2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer=ControlVersion();
	}//end if (navigator.plugins != null && navigator.plugins.length > 0)
	return flashVer;
}//end function
/*============================================================================================================*/
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) {
	versionStr=GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray=versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString=tempArray[1];			// "2,0,0,11"
			versionArray=tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray=versionStr.split(".");
		}//end if(isIE && isWin && !isOpera)
		var versionMajor=versionArray[0];
		var versionMinor=versionArray[1];
		var versionRevision=versionArray[2];
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}//end if (versionMajor == parseFloat(reqMajorVer))
		}//end if (versionMajor > parseFloat(reqMajorVer))
		return false;
	}//end if (versionStr == -1 )
}//end function
/*============================================================================================================*/
function AC_AddExtension(src, ext) {
	if (src.indexOf('?') != -1) {
		return src.replace(/\?/, ext+'?'); 
	} else {
		return src + ext;
	}//end if (src.indexOf('?') != -1)
}//end function
/*============================================================================================================*/
function AC_Generateobj(objAttrs, params, embedAttrs) { 
	var str='';
	if (isIE && isWin && !isOpera) {
		str += '<object ';
		for (var i in objAttrs) {
			str += i + '="' + objAttrs[i] + '" ';
		}//next i in objAttrs
		str += '>';
		for (var i in params) {
			str += '<param name="' + i + '" value="' + params[i] + '" /> ';
		}//next i in params
		str += '</object>';
	} else {
		str += '<embed ';
		for (var i in embedAttrs) {
			str += i + '="' + embedAttrs[i] + '" ';
		}//next i in embedAttrs
		str += '> </embed>';
	}//end if (isIE && isWin && !isOpera)
	document.write(str);
}//end function
/*============================================================================================================*/
function AC_FL_RunContent(){
	var ret=AC_GetArgs( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000", "application/x-shockwave-flash");
	AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}//end function
/*============================================================================================================*/
function AC_SW_RunContent(){
	var ret=AC_GetArgs( arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000", null);
	AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}//end function
/*============================================================================================================*/
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
	var ret=new Object();
	ret.embedAttrs=new Object();
	ret.params=new Object();
	ret.objAttrs=new Object();
	for (var i=0; i < args.length; i=i+2){
		var currArg=args[i].toLowerCase(); 
		switch (currArg){	
			case "classid":
				break;
			case "pluginspage":
				ret.embedAttrs[args[i]]=args[i+1];
			break;
			case "src":
			case "movie":	
				args[i+1]=AC_AddExtension(args[i+1], ext);
				ret.embedAttrs["src"]=args[i+1];
				ret.params[srcParamName]=args[i+1];
			break;
			case "onafterupdate":
			case "onbeforeupdate":
			case "onblur":
			case "oncellchange":
			case "onclick":
			case "ondblClick":
			case "ondrag":
			case "ondragend":
			case "ondragenter":
			case "ondragleave":
			case "ondragover":
			case "ondrop":
			case "onfinish":
			case "onfocus":
			case "onhelp":
			case "onmousedown":
			case "onmouseup":
			case "onmouseover":
			case "onmousemove":
			case "onmouseout":
			case "onkeypress":
			case "onkeydown":
			case "onkeyup":
			case "onload":
			case "onlosecapture":
			case "onpropertychange":
			case "onreadystatechange":
			case "onrowsdelete":
			case "onrowenter":
			case "onrowexit":
			case "onrowsinserted":
			case "onstart":
			case "onscroll":
			case "onbeforeeditfocus":
			case "onactivate":
			case "onbeforedeactivate":
			case "ondeactivate":
			case "type":
			case "codebase":
			case "id":
				ret.objAttrs[args[i]]=args[i+1];
			break;
			case "width":
			case "height":
			case "align":
			case "vspace": 
			case "hspace":
			case "class":
			case "title":
			case "accesskey":
			case "name":
			case "tabindex":
				ret.embedAttrs[args[i]]=ret.objAttrs[args[i]]=args[i+1];
			break;
			default:
			ret.embedAttrs[args[i]]=ret.params[args[i]]=args[i+1];
		}//end switch (currArg)
	}//next i < args.length
	ret.objAttrs["classid"]=classid;
	if (mimeType) ret.embedAttrs["type"]=mimeType;
	return ret;
}//end function
/*============================================================================================================*/
//window.onload=burst;
/*============================================================================================================*/
<!--
//=======================================================================================
//05/11/2009=============================================================================
//=======================================================================================
xHTTProot="http://www.theonlines.co.uk";
xADMINroot=xHTTProot+"/admin";
xIMAGEroot=xHTTProot+"/images/admin";
xSITEcss="";//xHTTProot+"/components/site_styles.css";
//=======================================================================================
function BrowserIs(xCheck) {
	xBrowser=navigator.appName;
	if (xBrowser.indexOf(xCheck)>0) {
		return "yes";
	} else {
		return "no";
	}//end if (xBrowser.indexOf(xCheck)>0)
}//end function
//=======================================================================================
function FixTextForXHTML(theHTML) {
	theXHTML="";
	xStringLength=theHTML.length;
	for (char=0;char<xStringLength;char++) {
		MyChar=theHTML.substring(char, char+1);
		if (MyChar=="<") {
			var xSwitch="lowercase";
		}//end if (MyChar=="<")
		if (MyChar==">") {
			var xSwitch="normalcase";
		}//end if (MyChar==">")
		if (xSwitch=="lowercase") {
			theXHTML+=MyChar.toLowerCase();
		} else {
			theXHTML+=MyChar;
		}//end if (xSwitch="lowercase")
	}//next char
	theXHTML=theXHTML.replace(/<area([^>]*)\s*>/gi,'<area$1 />');
	theXHTML=theXHTML.replace(/<base([^>]*)\s*>/gi,'<base$1 />');
	theXHTML=theXHTML.replace(/<basefont([^>]*)\s*>/gi,'<basefont$1 />');
	theXHTML=theXHTML.replace(/<bgsound([^>]*)\s*>/gi,'<bgsound$1 />');
	theXHTML=theXHTML.replace(/<br([^>]*)\s*>/gi,'<br$1 />');
	theXHTML=theXHTML.replace(/<col([^>]*)\s*>/gi,'<col$1 />');
	theXHTML=theXHTML.replace(/<frame([^>]*)\s*>/gi,'<frame$1 />');
	theXHTML=theXHTML.replace(/<hr([^>]*)\s*>/gi,'<hr$1 />');
	theXHTML=theXHTML.replace(/<img([^>]*)\s*>/gi,'<img$1 />');
	theXHTML=theXHTML.replace(/<input([^>]*)\s*>/gi,'<input$1 />');
	theXHTML=theXHTML.replace(/<link([^>]*)\s*>/gi,'<link$1 />');
	theXHTML=theXHTML.replace(/<meta([^>]*)\s*>/gi,'<meta$1 />');
	theXHTML=theXHTML.replace(/<param([^>]*)\s*>/gi,'<param$1 />');
	theXHTML=theXHTML.replace(/ name=([^>]*)\s*>/gi, ">");
	theXHTML=theXHTML.replace(/ id=([^>]*)\s*>/gi, ">");
	//fiddles for firefox
	theXHTML=theXHTML.replace(/<b>([^*]*)\s*<\/b>/gi,'<strong>$1</strong>');
	theXHTML=theXHTML.replace(/<i>([^*]*)\s*<\/i>/gi,'<em>$1</em>');
	//fiddles for safari
	theXHTML=theXHTML.replace(/ class="apple-style-span"/gi, "");
	theXHTML=theXHTML.replace(/<br \/><\/blockquote>/gi,"</blockquote>");
	theXHTML=theXHTML.replace(/<br \/><\/li>/gi,"</li>");
	theXHTML=theXHTML.replace(/ class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"/gi, "");
	theXHTML=theXHTML.replace(/<span style="font-weight: bold;">([^*]*)\s*<\/span>/gi, "<strong>$1</strong>");
	theXHTML=theXHTML.replace(/<span style="font-style: italic;">([^*]*)\s*<\/span>/gi, "<em>$1</em>");
	theXHTML=theXHTML.replace(/<span style="text-decoration: underline;">([^*]*)\s*<\/span>/gi, "<u>$1</u>");
	theXHTML=theXHTML.replace(/<span style="vertical-align: sub;">([^*]*)\s*<\/span>/gi, "<sub>$1</sub>");
	theXHTML=theXHTML.replace(/<span style="vertical-align: super;">([^*]*)\s*<\/span>/gi, "<super>$1</super>");
	//fiddles for IE
	theXHTML=theXHTML.replace(/align=justify/gi, "align=\"justify\"");
	theXHTML=theXHTML.replace(/align=left/gi, "align=\"left\"");
	theXHTML=theXHTML.replace(/align=right/gi, "align=\"right\"");
	theXHTML=theXHTML.replace(/align=center/gi, "align=\"center\"");
	theXHTML=theXHTML.replace(/target=_blank/gi, "target=\"_blank\"");
	theXHTML=theXHTML.replace(/target=_self/gi, "target=\"_self\"");
	theXHTML=theXHTML.replace(/<strike>([^*]*)\s*<\/strike>/gi, "<span style=\"text-decoration: line-through;\">$1</span>");
	theXHTML=theXHTML.replace(/<sup><sub>([^*]*)\s*<\/sub><\/sup>/gi, "<sub>$1</sub>");
	theXHTML=theXHTML.replace(/<sub><sup>([^*]*)\s*<\/sup><\/sub>/gi, "<sup>$1</sup>");
	return theXHTML;
}//end function
//=======================================================================================
function DrawSpacer() {
	strSpacer="";
	strSpacer+="<img";
	strSpacer+=" src=\""+xIMAGEroot+"/spacer.png\"";
	strSpacer+=" width=\"1\"";
	strSpacer+=" height=\"20\"";
	strSpacer+=" hspace=\"2\"";
	strSpacer+=" alt=\" \"";
	strSpacer+=" />";
	return strSpacer;
}//end function
//=======================================================================================
function ButtonExecute(xBUTTONaction, xGWYSareaId) {
	document.getElementById(xGWYSareaId).contentWindow.document.execCommand(xBUTTONaction, '', xGWYSareaId);
	UpdateHTML();
}//end function
//=======================================================================================
function DrawButton(xGWYSareaId, xBUTTONaction) {
	strButton="";
	strButton+="<button";
	strButton+=" onclick=\"ButtonExecute('"+xBUTTONaction+"','"+xGWYSareaId+"');return false;\"";
	strButton+=" title=\""+xBUTTONaction+"\"";
	strButton+=" id=\""+xGWYSareaId+xBUTTONaction+"\"";
	strButton+=" >";
	strButton+="<img";
	strButton+=" src=\""+xIMAGEroot+"/"+xBUTTONaction+".png\"";
	strButton+=" width=\"20\"";
	strButton+=" height=\"20\"";
	strButton+=" alt=\""+xBUTTONaction+"\"";
	strButton+=" />";
	strButton+="</button>";
	return strButton;
}//end function
//=======================================================================================
function SetFontName(xGWYSareaId) {
	xDropDownID="fontnamedrop"+xGWYSareaId;
	xDropDownElem=document.getElementById(xDropDownID);
	xDropDownIndex=xDropDownElem.selectedIndex;
	xDropDownValue=xDropDownElem.options[xDropDownIndex].value;
	document.getElementById(xGWYSareaId).contentWindow.document.execCommand("FontName",0,xDropDownValue);
	UpdateHTML();
}//end function
//=======================================================================================
function DrawFontName(xGWYSareaId) {
	xDropDownID="fontnamedrop"+xGWYSareaId;
	strDropdown="";
	strDropdown+="<select";
	strDropdown+=" name=\""+xDropDownID+"\"";
	strDropdown+=" id=\""+xDropDownID+"\"";
	strDropdown+=" onchange=\"SetFontName('"+xGWYSareaId+"');return false;\"";
	strDropdown+=">";
	strDropdown+="<option value=\"\">Font</option>";
	strDropdown+="<option value=\"arial\">Arial</option>";
	strDropdown+="<option value=\"tahoma\">Tahoma</option>";
	strDropdown+="<option value=\"verdana\">Verdana</option>";
	strDropdown+="<option value=\"times new roman\">Times</option>";
	strDropdown+="</select>";
	return strDropdown;
}//end function
//=======================================================================================
function SetFontSize(xGWYSareaId) {
	xDropDownID="fontsizedrop"+xGWYSareaId;
	xDropDownElem=document.getElementById(xDropDownID);
	xDropDownIndex=xDropDownElem.selectedIndex;
	xDropDownValue=xDropDownElem.options[xDropDownIndex].value;
	document.getElementById(xGWYSareaId).contentWindow.document.execCommand("FontSize",0,xDropDownValue);
	UpdateHTML();
}//end function
//=======================================================================================
function DrawFontSize(xGWYSareaId) {
	xDropDownID="fontsizedrop"+xGWYSareaId;
	strDropdown="";
	strDropdown+="<select";
	strDropdown+=" name=\""+xDropDownID+"\"";
	strDropdown+=" id=\""+xDropDownID+"\"";
	strDropdown+=" onchange=\"SetFontSize('"+xGWYSareaId+"');return false;\"";
	strDropdown+=">";
	strDropdown+="<option value=\"\">Size</option>";
	for (s=1;s<8;s++) {
		strDropdown+="<option value=\""+s+"\">"+s+"</option>";
	}//next s<8
	strDropdown+="</select>";
	return strDropdown;
}//end function
//=======================================================================================
function ToggleView(xTEXTareaId, xGWYSareaId) {
	xGWYStextarea=document.getElementById(xTEXTareaId);
	xGWYSarea=document.getElementById(xGWYSareaId);
	xGWYSstatus=document.getElementById("status"+xTEXTareaId);
	if (xGWYStextarea.style.display!="none") {
		xGWYStextarea.style.display="none";
		xGWYSarea.style.display="";
		xGWYSstatus.innerHTML="WYSIWYG mode";
		UpdateGWYS(xTEXTareaId, xGWYSareaId);
		xGWYSarea.focus();
		ToggleButtons(xTEXTareaId);
	} else {
		UpdateHTML();
		ToggleButtons(xTEXTareaId);
		xGWYStextarea.style.display="";
		xGWYSarea.style.display="none";
		xGWYSstatus.innerHTML="HTML mode";
		xGWYStextarea.focus();
	}//end if (xGWYStextarea.style.display!="none")
}//end function
//=======================================================================================
function ToggleButtons(xTEXTareaId) {
	ARRxTOOLbar=new Array(2);
	ARRxELEMtype=new Array(2);
	ARRxTOOLbar[0]="standard"+xTEXTareaId;
	ARRxTOOLbar[1]="advanced"+xTEXTareaId;
	ARRxELEMtype[0]="button";
	ARRxELEMtype[1]="select";
	for (t=0;t<ARRxTOOLbar.length;t++) {
		xTOOLbarId=ARRxTOOLbar[t];
		for (e=0;e<ARRxELEMtype.length;e++) {
			xTOOLbar=document.getElementById(xTOOLbarId);
			if (xTOOLbar) {
				xElements=xTOOLbar.getElementsByTagName(ARRxELEMtype[e]);
				for (i=0;i<xElements.length;i++) {
					xElementId=xElements[i].id;
					if (xElementId) {
						xElementObject=document.getElementById(xElementId);
						xElementStatus=xElementObject.disabled;
						if (xElementStatus) {
							xElementObject.removeAttribute("disabled");
							xElementObject.className="";
							xElementObject.removeAttribute("class");
						} else {
							xElementObject.setAttribute("disabled", "disabled");
//							xElementObject.setAttribute("class", "disabled");
							xElementObject.className="disabled";
						}//end if (xElementStatus)
					}//end if (xElementId!="")
				}//next i<xElements.length
			}//end if (xTOOLbar)
		}//next	e<ARRxELEMtype.length
	}//next	t<ARRxTOOLbar.length
}//end function
//=======================================================================================
function DrawToggle(xTEXTareaId, xGWYSareaId) {
	strButton="";
	strButton+="<button";
	strButton+=" onclick=\"ToggleView('"+xTEXTareaId+"','"+xGWYSareaId+"');return false;\"";
	strButton+=" title=\"code view\"";
	strButton+=" >";
	strButton+="<img";
	strButton+=" src=\""+xIMAGEroot+"/toggle.png\"";
	strButton+=" width=\"20\"";
	strButton+=" height=\"20\"";
	strButton+=" alt=\"code view\"";
	strButton+=" />";
	strButton+="</button>";
	return strButton;
}//end function
//=======================================================================================
function DrawColourButton(xGWYSareaId, xCOLOURarea) {
	strButton="";
	strButton+="<button";
	strButton+=" onclick=\"ShowColourDialog('"+xGWYSareaId+"','"+xCOLOURarea+"');return false;\"";
	strButton+=" title=\""+xCOLOURarea+"\"";
	strButton+=" id=\""+xGWYSareaId+xCOLOURarea+"\"";
	strButton+=" >";
	strButton+="<img";
	strButton+=" src=\""+xIMAGEroot+"/"+xCOLOURarea+".png\"";
	strButton+=" width=\"20\"";
	strButton+=" height=\"20\"";
	strButton+=" alt=\""+xCOLOURarea+"\"";
	strButton+=" />";
	strButton+="</button>";
	return strButton;
}//end function
//=======================================================================================
function ShowColourDialog(xGWYSareaId, xCOLOURarea) {
	xCOLOURcode=showModalDialog(xHTTProot+"/components/gwys/gwys_colour_picker.htm",null,"dialogHeight:205px;dialogWidth:179px;resizable:no;scroll:no;status:no;unadorned:yes;");
	if (xCOLOURarea=="ForeColor") {
		document.getElementById(xGWYSareaId).contentWindow.document.execCommand("ForeColor",false,xCOLOURcode);
	} else {
		document.getElementById(xGWYSareaId).contentWindow.document.execCommand("BackColor",false,xCOLOURcode);
	}//end if (xCOLOURarea=="BackColor")
}//end function
//=======================================================================================
function DrawLinkButton(xGWYSareaId) {
	strButton="";
	strButton+="<button";
	strButton+=" onclick=\"ShowLinkDialog('"+xGWYSareaId+"');return false;\"";
	strButton+=" id=\""+xGWYSareaId+"link\"";
	strButton+=" title=\"Insert Link\"";
	strButton+=" >";
	strButton+="<img";
	strButton+=" src=\""+xIMAGEroot+"/CreateLink.png\"";
	strButton+=" width=\"20\"";
	strButton+=" height=\"20\"";
	strButton+=" alt=\"Insert Link\"";
	strButton+=" />";
	strButton+="</button>";
	return strButton;
}//end function
//=======================================================================================
function ShowLinkDialog(xGWYSareaId) {
	xLINKvars=showModalDialog(xHTTProot+"/components/gwys/gwys_link.htm",null,"dialogHeight:110px;dialogWidth:400px;resizable:no;scroll:no;status:no;unadorned:yes;");
	if (xLINKvars!=null) {
		xLINKvars=xLINKvars.split("||");
		xLINKhref=xLINKvars[0];
		xLINKtarget=xLINKvars[1];
		xGWYSframe=document.getElementById(xGWYSareaId).contentWindow;
		if (xGWYSframe.document.getSelection) {//firefox
			xGWYSselection=xGWYSframe.getSelection().getRangeAt(0);
			xGWYScontent=xGWYSselection.toString();
			xLINKhtml="<a";
			xLINKhtml+=" href=\""+xLINKhref+"\"";
			xLINKhtml+=" target=\""+xLINKtarget+"\"";
			xLINKhtml+=">";
			xLINKhtml+=xGWYScontent;
			xLINKhtml+="</a>";
			xGWYSframe.document.execCommand("insertHTML",false,xLINKhtml);
		} else if (xGWYSframe.getSelection) {//safari
			xGWYSselection=xGWYSframe.getSelection().getRangeAt(0);
			xGWYScontent=xGWYSselection.toString();
			xLINKhtml="<a";
			xLINKhtml+=" href=\""+xLINKhref+"\"";
			xLINKhtml+=" target=\""+xLINKtarget+"\"";
			xLINKhtml+=">";
			xLINKhtml+=xGWYScontent;
			xLINKhtml+="</a>";
			xGWYSframe.document.execCommand("insertHTML",false,xLINKhtml);
		} else if (xGWYSframe.document.selection) {//ie
			xGWYSframe.focus();
			xGWYSselection=xGWYSframe.document.selection.createRange();
			xGWYScontent=xGWYSselection.htmlText;
			xLINKhtml="<a";
			xLINKhtml+=" href=\""+xLINKhref+"\"";
			xLINKhtml+=" target=\""+xLINKtarget+"\"";
			xLINKhtml+=">";
			xLINKhtml+=xGWYScontent;
			xLINKhtml+="</a>";
			xGWYSselection.pasteHTML(xLINKhtml);
		}//end if (xGWYSframe.getSelection)
	}//end if (xLINKvars!=null)
}//end function
//=======================================================================================
function DrawCleanWord(xTEXTareaId, xGWYSareaId) {
	strButton="";
	strButton+="<button";
	strButton+=" onclick=\"CleanWord('"+xTEXTareaId+"','"+xGWYSareaId+"');return false;\"";
	strButton+=" id=\""+xGWYSareaId+"cleanword\"";
	strButton+=" title=\"Clean Word HTML\"";
	strButton+=" >";
	strButton+="<img";
	strButton+=" src=\""+xIMAGEroot+"/CleanWord.png\"";
	strButton+=" width=\"20\"";
	strButton+=" height=\"20\"";
	strButton+=" alt=\"Clean Word HTML\"";
	strButton+=" />";
	strButton+="</button>";
	return strButton;
}//end function
//=======================================================================================
function CleanWord(xTEXTareaId, xGWYSareaId) {
	if (confirm("This will clean up MS Word HTML to produce better code for use in web browsers.\n\nIf the Word code is really bad to start with, the result may be unpredictable.")) {
		xHTMLtoStartWith=document.getElementById(xGWYSareaId).contentWindow.document.body.innerHTML;
		xHTMLtoEndWith=xHTMLtoStartWith;
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<?xml[^>]*>/gi, "");
		xHTMLtoEndWith=xHTMLtoEndWith.replace("<?", "");
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<p[^>]*>/gi, "<p>");
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<div[^>]*>/gi, "<div>");
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<span[^>]*>/gi, "<span>");
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<strong[^>]*>/gi, "<strong>");
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<em[^>]*>/gi, "<em>");
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<b[^>]*>/gi, "<strong>");
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<i[^>]*>/gi, "<em>");
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<\/b[^>]*>/gi, "</strong>");
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<\/i[^>]*>/gi, "</em>");
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<u[^>]*>/gi, "<u>");
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<o:p[^>]*>/gi, "");
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<\/o:p[^>]*>/gi, "");
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/&nbsp;/gi, "");
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<span>/gi, "");
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<\/span>/gi, "");
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<[^>]*><\/[^>]*>/gi, "");
		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<[^>]*><\/[^>]*>/gi, "");
//		xHTMLtoEndWith=xHTMLtoEndWith.replace(/<p>([^*]*)\s*<\/p>/gi,'[p]$1[/p]');	//replace all complete tags with placeholder
		xHTMLtoEndWith=FixTextForXHTML(xHTMLtoEndWith);
		document.getElementById(xTEXTareaId).value=xHTMLtoEndWith;
		UpdateGWYS(xTEXTareaId, xGWYSareaId);
	}//end if (confirm("This will clean up MS Word HTML to produce better code for use in web browsers.\n\nIf the Word code is really bad to start with, the result may be unpredictable."))
}//end function
//=======================================================================================
function DrawImageButton(xGWYSareaId) {
	strButton="";
	strButton+="<button";
	strButton+=" onclick=\"ShowImageDialog('"+xGWYSareaId+"');return false;\"";
	strButton+=" id=\""+xGWYSareaId+"Image\"";
	strButton+=" title=\"Insert Image\"";
	strButton+=" >";
	strButton+="<img";
	strButton+=" src=\""+xIMAGEroot+"/InsertImage.png\"";
	strButton+=" width=\"20\"";
	strButton+=" height=\"20\"";
	strButton+=" alt=\"Insert Image\"";
	strButton+=" />";
	strButton+="</button>";
	return strButton;
}//end function
//=======================================================================================
function ShowImageDialog(xGWYSareaId) {
	xIMGvars=showModalDialog(xHTTProot+"/components/gwys/gwys_image.asp",null,"dialogHeight:545px;dialogWidth:600px;resizable:no;scroll:no;status:no;unadorned:yes;");
	if (xIMGvars!=null) {
		xIMGvars=xIMGvars.split("||");
		xIMGsrc=xIMGvars[0];
		xIMGwidth=xIMGvars[1];
		xIMGheight=xIMGvars[2];
		xIMGalt=xIMGvars[3];
		xIMGalign=xIMGvars[4];
		xIMGmargin=xIMGvars[5];
		xIMGframe=xIMGvars[6];
		xIMGborder="0";
		xIMGhtml="<img";
		xIMGhtml+=" src=\""+xIMGsrc+"\"";
		xIMGhtml+=" width=\""+xIMGwidth+"\"";
		xIMGhtml+=" height=\""+xIMGheight+"\"";
		xIMGhtml+=" alt=\""+xIMGalt+"\"";
		if (xIMGframe=="no") {
			xIMGhtml+=" align=\""+xIMGalign+"\"";
		}//end if (xIMGframe=="no")
		xIMGhtml+=" hspace=\""+xIMGmargin+"\"";
		xIMGhtml+=" vspace=\""+xIMGmargin+"\"";
		xIMGhtml+=" border=\""+xIMGborder+"\"";
		xIMGhtml+=" />";
		if (xIMGframe=="yes") {
			if (xIMGalign=="left") {
				xIMGhtml="<div style=\"padding: 5px; border: 5px solid #f6f6f6; text-align: center; float: left; margin-right: 5px;\">"+xIMGhtml+"<br />"+xIMGalt+"</div>"
			}//end if (xIMGalign=="left")
			if (xIMGalign=="right") {
				xIMGhtml="<div style=\"padding: 5px; border: 5px solid #f6f6f6; text-align: center; float: right; margin-left: 5px;\">"+xIMGhtml+"<br />"+xIMGalt+"</div>"
			}//end if (xIMGalign=="right")
			if (xIMGalign=="") {
				xDIVwidth=(xIMGwidth*1)+20;
				xIMGhtml="<div style=\"padding: 5px; border: 5px solid #f6f6f6; text-align: center; width: "+xDIVwidth+"px; \">"+xIMGhtml+"<br />"+xIMGalt+"</div>"
			}//end if (xIMGalign=="")
		}//end if (xIMGframe=="yes")
		xGWYSframe=document.getElementById(xGWYSareaId).contentWindow;
		if (xGWYSframe.document.getSelection) {//firefox
			xGWYSselection=xGWYSframe.getSelection().getRangeAt(0);
			xGWYScontent=xGWYSselection.toString();
			xGWYSframe.document.execCommand("insertHTML",false,xIMGhtml);
		} else if (xGWYSframe.getSelection) {//safari
			xGWYSselection=xGWYSframe.getSelection().getRangeAt(0);
			xGWYScontent=xGWYSselection.toString();
			xGWYSframe.document.execCommand("insertHTML",false,xIMGhtml);
		} else if (xGWYSframe.document.selection) {//ie
			xGWYSframe.focus();
			xGWYSselection=xGWYSframe.document.selection.createRange();
			xGWYScontent=xGWYSselection.htmlText;
			xGWYSselection.pasteHTML(xIMGhtml);
		}//end if (xGWYSframe.getSelection)
	}//end if (xIMGvars!=null)
}//end function
//=======================================================================================
function DrawToolBarButtons(xTEXTareaId, xGWYSareaId, xTOOLbarType) {
	strOutput="";
	xTOOLbarId=xTOOLbarType+xTEXTareaId;
	xTOOLbar=document.getElementById(xTOOLbarId);
	if (xTOOLbarType=="advanced") {
//		strOutput+=DrawButton(xGWYSareaId, "Copy");
//		strOutput+=DrawButton(xGWYSareaId, "Cut");
//		strOutput+=DrawButton(xGWYSareaId, "Paste");
//		strOutput+=DrawButton(xGWYSareaId, "Delete");
//		strOutput+=DrawButton(xGWYSareaId, "Print");
//		strOutput+=DrawSpacer();
//		strOutput+=DrawButton(xGWYSareaId, "SelectAll"); //weird - selects everything in the page, not the editor
//		strOutput+=DrawButton(xGWYSareaId, "Unselect");
//		strOutput+=DrawButton(xGWYSareaId, "InsertMarquee");
//		strOutput+=DrawButton(xGWYSareaId, "CreateBookmark");
//		strOutput+=DrawButton(xGWYSareaId, "UnBookmark");
//		strOutput+=DrawButton(xGWYSareaId, "InsertHorizontalRule");
//		strOutput+=DrawButton(xGWYSareaId, "InsertIFrame");
//		strOutput+=DrawButton(xGWYSareaId, "InsertParagraph");
//		strOutput+=DrawSpacer();
//		strOutput+=DrawButton(xGWYSareaId, "CreateLink");
//		strOutput+=DrawButton(xGWYSareaId, "Unlink");
//		strOutput+=DrawButton(xGWYSareaId, "InsertImage");
//		strOutput+=DrawSpacer();
//		strOutput+=DrawImageButton(xGWYSareaId);
//		strOutput+=DrawSpacer();
//		strOutput+=DrawButton(xGWYSareaId, "RemoveFormat");
//		strOutput+=DrawToggle(xTEXTareaId, xGWYSareaId);
//		strOutput+=DrawCleanWord(xTEXTareaId, xGWYSareaId);
	}//end if (xTOOLbarType=="advanced")
	if (xTOOLbarType=="standard") {
//		strOutput+=DrawFontName(xGWYSareaId);
//		strOutput+=DrawFontSize(xGWYSareaId);
//		strOutput+=DrawSpacer();
		strOutput+=DrawButton(xGWYSareaId, "bold");
		strOutput+=DrawButton(xGWYSareaId, "Italic");
		strOutput+=DrawButton(xGWYSareaId, "Underline");
		strOutput+=DrawSpacer();
		strOutput+=DrawButton(xGWYSareaId, "JustifyLeft");
		strOutput+=DrawButton(xGWYSareaId, "JustifyFull");
		strOutput+=DrawButton(xGWYSareaId, "JustifyCenter");
		strOutput+=DrawButton(xGWYSareaId, "JustifyRight");
		strOutput+=DrawSpacer();
		strOutput+=DrawButton(xGWYSareaId, "Indent");
		strOutput+=DrawButton(xGWYSareaId, "Outdent");
		strOutput+=DrawButton(xGWYSareaId, "InsertOrderedList");
		strOutput+=DrawButton(xGWYSareaId, "InsertUnorderedList");
		strOutput+=DrawSpacer();
		strOutput+=DrawButton(xGWYSareaId, "StrikeThrough");
		strOutput+=DrawButton(xGWYSareaId, "Subscript");
		strOutput+=DrawButton(xGWYSareaId, "Superscript");
		strOutput+=DrawSpacer();
		strOutput+=DrawColourButton(xGWYSareaId, "BackColor");
		strOutput+=DrawColourButton(xGWYSareaId, "ForeColor");
		strOutput+=DrawSpacer();
		strOutput+=DrawLinkButton(xGWYSareaId);
		strOutput+=DrawButton(xGWYSareaId, "Unlink");
	}//end if (xTOOLbarType=="standard")
	xTOOLbar.innerHTML=strOutput;
}//end function
//=======================================================================================
function DrawToolBar(xTEXTareaId, xGWYSareaId, xTOOLbarType) {
	xTOOLbar=document.createElement("div");
	xTOOLbar.setAttribute("id", xTOOLbarType+xTEXTareaId);
//	xTOOLbar.setAttribute("class", "gwysToolBar");
	xTOOLbar.className="gwysToolBar";
	xTEXTarea=document.getElementById(xTEXTareaId);
	xPARENTnode=xTEXTarea.parentNode;
	xPARENTnode.insertBefore(xTOOLbar, xTEXTarea);
	DrawToolBarButtons(xTEXTareaId, xGWYSareaId, xTOOLbarType);
}//end function
//=======================================================================================
function UpdateHTML() {
	arrTextAreas=document.getElementsByTagName("textarea");
	for(var i=0;i<arrTextAreas.length;i++) {
		xTEXTareaId=arrTextAreas[i].id;
		xGWYSareaId="gwys"+xTEXTareaId;
		if (arrTextAreas[i].className=="gwysTextArea") {
			xXHTML=document.getElementById(xGWYSareaId).contentWindow.document.body.innerHTML;
			xXHTML=FixTextForXHTML(xXHTML);
			document.getElementById(xTEXTareaId).value=xXHTML;
		}//end if (arrTextAreas[i].className=="gwys")
	}//next i<=arrTextAreas.length
}//end function
//=======================================================================================
function UpdateGWYS(xTEXTareaId, xGWYSareaId) {
	xGWYScontent=document.getElementById(xGWYSareaId).contentWindow.document;
	xGWYScontent.open();
	xGWYScontent.write("<head></head>"+document.getElementById(xTEXTareaId).value);
	xGWYScontent.close();
	SetStyleSheet(xGWYSareaId);
}//end function
//=======================================================================================
function SetStyleSheet(xGWYSareaId) {
	xGWYScss=document.createElement("link");
	if (xSITEcss) {
		xGWYScss.setAttribute("href",xSITEcss);
	} else {
		xGWYScss.setAttribute("href",xHTTProot+"/components/gwys/gwys_styles.css");
	}//end if (xSITEcss)
	xGWYScss.setAttribute("rel","stylesheet");
	xGWYScss.setAttribute("type","text/css");
	xGWYSarea=document.getElementById(xGWYSareaId).contentWindow.document;
	if (BrowserIs("Internet Explorer")=="yes") {
		document.getElementById(xGWYSareaId).contentWindow.document.createStyleSheet(xGWYScss.href);
	} else {
		if (xGWYSarea.getElementsByTagName("head")[0]) {
			xGWYSarea.getElementsByTagName("head")[0].appendChild(xGWYScss);
		} else {
			document.getElementById(xGWYSareaId).contentWindow.document.createStyleSheet(xGWYScss.href);
		}//end if (xGWYSarea.getElementsByTagName("head")[0])
	}//end if (BrowserIs("Internet Explorer")=="yes")
}//end function
//=======================================================================================
function ConvertToWYSIWYG(xTEXTareaId, xGWYSareaId, xSTATUSbarId) {
	xGWYSarea=document.createElement("iframe");
	xGWYSarea.setAttribute("id", xGWYSareaId);
//	xGWYSarea.setAttribute("frameborder", "0");
	xGWYSarea.frameBorder="0";
//	xGWYSarea.setAttribute("class", "gwysEditArea");
	xGWYSarea.className="gwysEditArea";
	xTEXTarea=document.getElementById(xTEXTareaId);
	xTEXTarea.setAttribute("onkeyup", "UpdateGWYS(\""+xTEXTareaId+"\", \""+xGWYSareaId+"\");");
	xTEXTarea.setAttribute("onblur", "UpdateGWYS(\""+xTEXTareaId+"\", \""+xGWYSareaId+"\");");
	xTEXTarea.style.display="none";
	xPARENTnode=xTEXTarea.parentNode;
	xPARENTnode.insertBefore(xGWYSarea, xTEXTarea);
	xSTATUSbar=document.createElement("div");
	xSTATUSbar.setAttribute("id", xSTATUSbarId);
//	xSTATUSbar.setAttribute("class", "gwysStatusBar");
	xSTATUSbar.className="gwysStatusBar";
	xPARENTnode.insertBefore(xSTATUSbar, xTEXTarea.nextSibling);
	xSTATUSbar.innerHTML="WYSIWYG mode";
	xGWYScontent=xGWYSarea.contentWindow.document;
	xGWYScontent.designMode="on";
	if (BrowserIs("Internet Explorer")=="no") {
		xGWYScontent.execCommand("styleWithCSS", false, false);
	}//end if (BrowserIs("Internet Explorer")=="no")
	UpdateGWYS(xTEXTareaId, xGWYSareaId);
}//end function
//=======================================================================================
function ShowProgress() {
	//this function does not do anything
	//it is just here to avoid an error
	//if the progress bar script is not included later in the page
	return true;
}//end function
//=======================================================================================
function GenGWYSelements() {
	arrTextAreas=document.getElementsByTagName("textarea");
	for(var i=0;i<arrTextAreas.length;i++) {
		xTEXTareaId=arrTextAreas[i].id;
		xFORMid=document.getElementById(xTEXTareaId).form.id;
		xGWYSareaId="gwys"+xTEXTareaId;
//		document.getElementById(xFORMid).onsubmit=function(){alert('foo');return false;}; //stops form subitting - good for testing
//		document.getElementById(xFORMid).onsubmit=function(){UpdateHTML();ToggleView('"+xTEXTareaId+"', '"+xGWYSareaId+"');return ShowProgress();}; //stops form subitting - good for testing
		document.getElementById(xFORMid).onsubmit=function(){UpdateHTML();return ShowProgress();}; //stops form subitting - good for testing
//		document.getElementById(xFORMid).onsubmit=function(){UpdateHTML();}; //stops form subitting - good for testing
//		document.getElementById(xFORMid).setAttribute("onsubmit", "alert('foo');event.returnValue=false;return false;"); //stops form subitting - good for testing
//		document.getElementById(xFORMid).setAttribute("onsubmit", "UpdateHTML();ToggleView('"+xTEXTareaId+"', '"+xGWYSareaId+"');return false;"); //stops form subitting - good for testing
//		document.getElementById(xFORMid).setAttribute("onsubmit", "UpdateHTML();return ShowProgress();");
		xSTATUSbarId="status"+xTEXTareaId;
		if (arrTextAreas[i].className=="gwysTextArea") {
			DrawToolBar(xTEXTareaId, xGWYSareaId, "standard");
//			DrawToolBar(xTEXTareaId, xGWYSareaId, "advanced"); //pointless
			ConvertToWYSIWYG(xTEXTareaId, xGWYSareaId, xSTATUSbarId);
			SetStyleSheet(xGWYSareaId);
		}//end if (arrTextAreas[i].className=="gwys")
	}//next i<=arrTextAreas.length
}//end function
//=======================================================================================
function AskForConfirmation(xMessage) {
	xResponse=confirm(xMessage);
	if (xResponse) {
		event.returnValue=true;
	} else {
		event.returnValue=false;
	}//end if (xResponse)
}//end function
//=======================================================================================
window.onload=function() {
	GenGWYSelements();
	burst();
}//end function
//=======================================================================================
-->-->