var StyleFile = "css/style" + document.cookie.charAt(6) + ".css";
document.writeln('<link rel="stylesheet" type="text/css" href="' + StyleFile + '">');






function register()
{
	
	window.location  = "default.asp?page=s10_3_2";
	//newslettersignup.submit();
}






var thisForm, thisFormName;

var errors = '';

    function makeRequest(theFrm) {
        var httpRequest;
		url = '../lib/validate_captcha.asp?captchaValue=' + theFrm.strCAPTCHA.value;

        if (window.XMLHttpRequest) { // Mozilla, Safari, ...
            httpRequest = new XMLHttpRequest();
        } else if (window.ActiveXObject) { // IE
            try {
                httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!httpRequest) {
            alert('There was a problem submitting your form, this could be due to your browser.');
            return false;
        }
		
        httpRequest.onreadystatechange = function() { alertContents(httpRequest); };
		// set the asch value to false to wait for the response before carrying on
        httpRequest.open('GET', url, true);
        httpRequest.send(null);

        //function below deals with results...
    }



    function alertContents(httpRequest) {

		if (httpRequest.readyState == 4) {
            if (httpRequest.status == 200) {
				if (httpRequest.responseText != "true")
				{
					// wrong or some problem
					errors += "Please check the numbers you entered in the text box.";
				}
				
				//now, did we have errors from captcha or other fields?
				if (errors != "")
				{
				    alert('There was a problem with your details.\n\n' + errors);
				    errors = "";
				}
				else
				{
				    //ok!
					// change form value so we know that everythings ok
					document.newslettersignup.goodcaptcha.value = "1"
				    document.newslettersignup.submit(); 
				}
				
            } else {
                alert('There was a problem verifying your submission, please try again later.');
            }
		}

    }





	function validateForm(frmName)
		{
			makeRequest(frmName);
		
		}

function unChanged(strVal) {
	elmVal = eval('document.' + thisFormName + '.' + strVal +'.value');
	if (strVal == 'name' && elmVal == 'Name') {
		return false;
	} else if (strVal == 'email' && elmVal == 'Email') {
		return false;
	}
	return true;
}

function checkEmail(strVal) {
	elmVal = eval('document.' + thisFormName + '.' + strVal +'.value');
	testRe = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(elmVal);
	if (!testRe) {
		return false;
	}
	return true;
}

function isEmpty(strVal) {
	elmVal = eval('document.' + thisFormName + '.' + strVal +'.value');
	elmLen = elmVal.length;
	if (elmLen == null || elmLen == 0) {
		return false;
	}
	return true;
}

function checkTick(strVal) {
	elmVal = eval('document.' + thisFormName + '.' + strVal +'.checked');
	if (!elmVal) {
		return false;
	}
	return true;
}

function isSame(strVal,strVal2){
	if (eval('document.' + thisFormName + '.' + strVal +'.value') != eval('document.' + thisForm + '.' + strVal2 +'.value'))	{
		return false;
	}else{
		return true;
	}
}

function oneRadioTicked(radioName)	{
	for (i=0 ; i < eval('document.' + thisFormName + '.' + radioName +'.length') ; i++)		{	
		if (eval('document.' + thisForm + '.' + radioName +'['+i+'].checked'))	{
			return true;
		}
	}
	return false;
}






function popwin(page,wid,hght,winname)
{	window.open(page, winname, "width="+wid+",height="+hght+",scrollbars=no");	}

function popwins(page,wid,hght,winname)
{	window.open(page, winname, "width="+wid+",height="+hght+",scrollbars=yes");	}

function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors .length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
anchor.target = "_blank";
anchor.title = (anchor.title != "") ? anchor.title+" (opens in a new window)" : "opens in a new window";
anchor.className = (anchor.className != '') ? anchor.className+' external' : 'external';
}
}
}
window.onload = externalLinks;

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}