<!--
//=======================================================================================
function clearme(FormField) {
	if (FormField.defaultValue==FormField.value) FormField.value=""
}//end function
//=======================================================================================
var xmlhttp;
var xmlResponse;
var strPredictions;
var xs;
//=======================================================================================
function LoadFile(url) {
	xmlhttp=null;
	if (window.XMLHttpRequest) {// Firefox, Opera, IE7
		xmlhttp=new XMLHttpRequest();
	} else if (window.ActiveXObject) {// IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}//end if (window.XMLHttpRequest)
	if (xmlhttp!=null) {
		xmlhttp.open("GET",url,true);
		xmlhttp.send(null);
	}//end if (xmlhttp!=null)
	return xmlResponse;
}//end function
//=======================================================================================
function ProcessSignup() {
	xERRORcount=0;
	xERRORstring="Sign up failed, please check your details";
	FormSignup=document.getElementById("signup");
	if (FormSignup) {
		xSIGNUPname=document.getElementById("xSIGNUPname");
		xSIGNUPsurname=document.getElementById("xSIGNUPsurname");
		xSIGNUPemail=document.getElementById("xSIGNUPemail");
		xSIGNUPname.className="";
		xSIGNUPsurname.className="";
		xSIGNUPemail.className="";
		if (xSIGNUPname.defaultValue==xSIGNUPname.value||xSIGNUPname.value=="") {
			xSIGNUPname.className="error";
			xERRORcount=xERRORcount+1;
		}//end if (xSIGNUPname.defaultValue==xSIGNUPname.value||xSIGNUPname.value=="")
		if (xSIGNUPsurname.defaultValue==xSIGNUPsurname.value||xSIGNUPsurname.value=="") {
			xSIGNUPsurname.className="error";
			xERRORcount=xERRORcount+1;
		}//end if (xSIGNUPsurname.defaultValue==xSIGNUPsurname.value||xSIGNUPsurname.value=="")
		if (xSIGNUPemail.defaultValue==xSIGNUPemail.value||xSIGNUPemail.value=="") {
			xSIGNUPemail.className="error";
			xERRORcount=xERRORcount+1;
		}//end if (xSIGNUPemail.defaultValue==xSIGNUPemail.value||xSIGNUPemail.value=="")
		if (xERRORcount==0) {
			vxSIGNUPname=xSIGNUPname.value;
			vxSIGNUPsurname=xSIGNUPsurname.value;
			vxSIGNUPemail=xSIGNUPemail.value;
			xQueryString="xSIGNUPname="+vxSIGNUPname+"&xSIGNUPsurname="+vxSIGNUPsurname+"&xSIGNUPemail="+vxSIGNUPemail;
			LoadFile("http://domain2460869.sites.thomascole.net/components/site_signup.asp?"+xQueryString);
			xmlhttp.onreadystatechange=function() {
				if (xmlhttp.readyState==4) {// 4 = "loaded"
					if (xmlhttp.status==200) {// 200 = "OK"
						xmlResponse=xmlhttp.responseText;
						if (xmlResponse.indexOf("success")>-1) {
							FormSignup.innerHTML="<h1>Sign up successful</h1><p>Thank You</p>";
						} else {
							FormSignup.getElementsByTagName("p")[0].innerHTML=xERRORstring;
							FormSignup.getElementsByTagName("p")[0].className="error";
						} //end if (xmlResponse.indexOf("success")>-1)
					}//end if (xmlhttp.status==200)
				}//end if (xmlhttp.readyState==4)
			}//end function
		} else {
			FormSignup.getElementsByTagName("p")[0].innerHTML=xERRORstring;
			FormSignup.getElementsByTagName("p")[0].className="error";
		}//end if (xERRORcount==0)
	}//end if (FormSignup)
	return false;
}//end function
//=======================================================================================
function SetBlobs() {
	xBlobDiv=document.getElementById("blobs");
	if (xBlobDiv) {
		xWinW=document.documentElement.clientWidth;
		xDivW=573;
		hxWinW=xWinW/2;
		hxDivW=xDivW/2;
		xBlobMargin=hxWinW-hxDivW+50;
		xBlobDiv.style.display="block";
		xBlobDiv.style.position="absolute";
		xBlobDiv.style.width=xDivW+"px";
		xBlobDiv.style.top="100px";
		xBlobDiv.style.left=xBlobMargin+"px";
		xBlobUL=xBlobDiv.getElementsByTagName("ul")[0];
		if (xBlobUL) {
			xBlobUL.style.listStyletype="none";
			xBlobUL.style.padding="0px";
			xBlobUL.style.margin="0px";
			xBlobLI=xBlobUL.getElementsByTagName("li");
			if (xBlobLI) {
				for (i=0;i<xBlobLI.length;i++) {
					xBlobLI[i].style.display="table-cell";
					xBlobLI[i].style.verticalAlign="top";
					xBlobLI[i].style.styleFloat="left"; //IE
					xBlobLI[i].style.cssFloat="left"; //FF SF
					xBlobLIA=xBlobLI[i].getElementsByTagName("a")[0];
					if (xBlobLIA) {
						xBlobLIA.style.textDecoration="none";
						xBlobLIA.style.color="#11357e";
						xBlobLIAstrong=xBlobLIA.getElementsByTagName("strong")[0];
						if (xBlobLIAstrong) {
							xBlobLIAstrong.style.display="block";
							xBlobLIAstrong.style.textIndent="10px";
							
						}//endif (xBlobLIAstrong)
					}//endif (xBlobLIA)
				}//next i<xBlobLI.length
				xBlobLI[0].style.paddingTop="16px";
				xBlobLI[1].style.paddingTop="5px";
				xBlobLI[3].style.paddingTop="7px";
				xBlobLI[1].style.marginLeft="-29px";
				xBlobLI[2].style.marginLeft="-29px";
				xBlobLI[3].style.marginLeft="-29px";
			}//end if (xBlobLI)
		}//end if (xBlobUL)
	}//end if (xBlobDiv)
}//end function
//=======================================================================================
function SetCatMatrix() {
	CatMatrix=document.getElementById("catmatrix");
	if (CatMatrix) {
		CatMatrix.style.width="100%";
		CatMatrix.style.display="table";
		CatMatrixTR=CatMatrix.getElementsByTagName("tr");
		if (CatMatrixTR.length>0) {
			CatMatrixTR[0].style.display="table-row";
			CatMatrixTH=CatMatrixTR[0].getElementsByTagName("th");
			if (CatMatrixTH.length>0) {
				for (th=0;th<CatMatrixTH.length;th++) {
					CatMatrixTH[th].style.width=(100/CatMatrixTH.length)+"%";
					CatMatrixTH[th].innerHTML="<a href=\"javascript:ShowRows('"+CatMatrixTH[th].className+"');ShowCourses('"+CatMatrixTH[th].className+"','')\">"+CatMatrixTH[th].innerHTML+"</a>";
					if (th==0) {CatMatrixTH[th].style.backgroundColor="#00aeef"};
					if (th==1) {CatMatrixTH[th].style.backgroundColor="#d71921"};
					if (th==2) {CatMatrixTH[th].style.backgroundColor="#0072bc"};
					if (th==3) {CatMatrixTH[th].style.backgroundColor="#4db848"};
					if (th==4) {CatMatrixTH[th].style.backgroundColor="#9765ab"};
					if (th==5) {CatMatrixTH[th].style.backgroundColor="#818285"};
					if (th==6) {CatMatrixTH[th].style.backgroundColor="#f58220"};
					if (th==0) {CatMatrixTH[th].style.backgroundImage="url(images/css/transtl.png)"};
					if (th==0) {CatMatrixTH[th].style.backgroundRepeat="no-repeat"};
					if (th==0) {CatMatrixTH[th].style.backgroundPosition="top left"};
					if (th+1==CatMatrixTH.length) {CatMatrixTH[th].style.backgroundImage="url(images/css/transtr.png)"};
					if (th+1==CatMatrixTH.length) {CatMatrixTH[th].style.backgroundRepeat="no-repeat"};
					if (th+1==CatMatrixTH.length) {CatMatrixTH[th].style.backgroundPosition="top right"};
				}//next th<=CatMatrixTH.length
			ShowRows(CatMatrixTH[0].className);
			}//end if (CatMatrixTH.length>0)
		}//end if (CatMatrixTR.length>0)
	}//end if (CatMatrix)
}//end function
//=======================================================================================
function ShowRows(theClass) {
	CatMatrix=document.getElementById("catmatrix");
	if (CatMatrix) {
		CatMatrixTR=CatMatrix.getElementsByTagName("tr");
		if (CatMatrixTR.length>1) {
			td=0;
			tds=0;
			for (tr=1;tr<CatMatrixTR.length;tr++) {
				if (CatMatrixTR[tr].className==theClass) {tds=tds+1};
			}//next tr<=CatMatrixTR.length
			for (tr=1;tr<CatMatrixTR.length;tr++) {
				if (CatMatrixTR[tr].className==theClass) {
					td=td+1
					CatMatrixTR[tr].style.display="table-row";
					CatMatrixTD=CatMatrixTR[tr].getElementsByTagName("td")[0];
					if (td==1) {ShowCourses(theClass, CatMatrixTD.className)};
					if (td==1) {CatMatrixTD.style.backgroundColor="#f58220"};
					if (td==2) {CatMatrixTD.style.backgroundColor="#818285"};
					if (td==3) {CatMatrixTD.style.backgroundColor="#9765ab"};
					if (td==4) {CatMatrixTD.style.backgroundColor="#00aeef"};
					if (td==5) {CatMatrixTD.style.backgroundColor="#d71921"};
					if (td==6) {CatMatrixTD.style.backgroundColor="#0072bc"};
					if (td==7) {CatMatrixTD.style.backgroundColor="#4db848"};
					if (td==tds) {CatMatrixTD.style.backgroundImage="url(images/css/transbottom.png)"};
					if (td==tds) {CatMatrixTD.style.backgroundRepeat="no-repeat"};
					if (td==tds) {CatMatrixTD.style.backgroundPosition="bottom"};
					CatMatrixTD.style.paddingTop="3px";
					CatMatrixTD.style.paddingBottom="3px";
					CatMatrixTD.style.paddingLeft="10px";
					CatMatrixTD.style.paddingRight="10px";
					CatMatrixTD.innerHTML="<a href=\"javascript:ShowCourses('"+theClass+"','"+CatMatrixTD.className+"')\">"+CatMatrixTD.innerHTML+"</a>";
				} else {
					CatMatrixTR[tr].style.display="none";
				}//end if (CatMatrixTR[tr].className==theClass)
			}//next tr<=CatMatrixTR.length
		}//end if (CatMatrixTR.length>1)
	}//end if (CatMatrix)
}//end function
//=======================================================================================
function ShowCourses(xt, xs) {
	HomeCourses=document.getElementById("homecourses");
	if (xt&&HomeCourses) {
		xt=xt.replace("xt", "");
		xs=xs.replace("xs", "");
		xQueryString="xt="+xt+"&xs="+xs;
		LoadFile("http://domain2460869.sites.thomascole.net/courses/ajax.asp?"+xQueryString);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4) {// 4 = "loaded"
				if (xmlhttp.status==200) {// 200 = "OK"
					HomeCourses.innerHTML=xmlhttp.responseText;
				}//end if (xmlhttp.status==200)
			}//end if (xmlhttp.readyState==4)
		}//end function
	}//end if (xt&&HomeCourses)
}//end function
//=======================================================================================
window.onload=function() {
	SetBlobs();
	SetCatMatrix();
}//end function
window.onresize=function() {
	SetBlobs();
}//end function
//=======================================================================================
-->
