<!--
/*Function to workaround w3c strict target attribute ban*/
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"; 
 } 
}

function showFAQ(id) {
	 identity=document.getElementById(id);
	 if (identity.className=='hide') {
		 identity.className = "visible";
	 } else {
		 identity.className = "hide";
	 }
}

//function to format links as footnotes when printed - http://www.easy-designs.net/code/footnoteLinks/index.php
function footnoteLinks(containerID,targetID) {
	if (!document.getElementById || !document.getElementsByTagName || !document.createElement) return false;
	if (!document.getElementById(containerID) || !document.getElementById(targetID)) return false;
	var container = document.getElementById(containerID);
	var target = document.getElementById(targetID);
	/*
	var h2 = document.createElement('h2');
	addClass.apply(h2,['footnotes']);
	var h2_txt = document.createTextNode('Links');
	h2.appendChild(h2_txt);
	*/
	var coll = container.getElementsByTagName('*');
	var ol = document.createElement('ol');
	addClass.apply(ol,['footnotes']);
	var myArr = [];
	var thisLink;
	var num = 1;
	for (var i=0; i<coll.length; i++) {
		var thisClass = coll[i].className;
		if ( (coll[i].getAttribute('href') || coll[i].getAttribute('cite')) && (thisClass == '' || thisClass.indexOf('ignore') == -1)) {
			thisLink = coll[i].getAttribute('href') ? coll[i].href : coll[i].cite;
			var note = document.createElement('sup');
			addClass.apply(note,['printOnly']);
			var note_txt;
			var j = inArray.apply(myArr,[thisLink]);
			if ( j || j===0 ) {
				note_txt = document.createTextNode(j+1);
			} else {
				var li = document.createElement('li');
				var li_txt = document.createTextNode(thisLink);
				li.appendChild(li_txt);
				ol.appendChild(li);
				myArr.push(thisLink);
				note_txt = document.createTextNode(num);
				num++;
			}
			note.appendChild(note_txt);
			if (coll[i].tagName.toLowerCase() == 'blockquote') {
				var lastChild = lastChildContainingText.apply(coll[i]);
				lastChild.appendChild(note);
			} else {
				coll[i].parentNode.insertBefore(note, coll[i].nextSibling);
			}
		}
	}
	/*
	target.appendChild(h2);
	*/
	target.appendChild(ol);
	addClass.apply(document.getElementsByTagName('html')[0],['noted']);
	return true;
}

function addClass(theClass) {
	if (this.className != '') {
		this.className += ' ' + theClass;
	} else {
		this.className = theClass;
	}
}
Object.prototype.addClass = addClass;

function inArray(needle) {
	for (var i=0; i < this.length; i++) {
		if (this[i] === needle) {
			return i;
		}
	}
return false;
}
Array.prototype.inArray = inArray;














/* ----------------------------------------------------------
* Scion Solutions JavaScript Shopping Basket Copyright 2000 *
* This code is the sole property of Ian Winstanley and      *
* copying and pasting without authorisation is strictly     *
* forbidden. Designed for use on websites where CGI is not  *
* available. Uses cookies and a .js database to store info. *
 ----------------------------------------------------------*/
// As the document loads, the cookie is read to
// be written to a table
var basketWrite = "", prodTotal = 0.00, newQuant = 0, tempPrice = 0.00, productTemp = "", descTemp = "", allDesc = "";

var productString = GetCookie('productDetails');

	if (productString != null) { // If the cookie exists
	basketWrite += "<table cellpadding='2' cellspacing='2' class='12verdblack' width='100%' border='0'>\n";
//	basketWrite += "<tr bgcolor='#DDDDDD' align='center'>\n<td><font face='Arial' size='2'>Description</font></td><!--ilshat<td><font face='Arial' size='2'>Options</font></td><td><font face='Arial' size='2'>Price</font></td><td><font face='Arial' size='2'>Quantity</font></td>--></tr>\n";
	var prodArray = productString.split('+++');
		for (var i = 0; i < prodArray.length-1; i++) {
		(i % 2 == 0 ? rowBgrnd = "#EEEEEE" : rowBgrnd = "#FFFFFF"); // If the remainder = 0 (to alternate rows)
		var productsIndi = prodArray[i].split('-->');
			for (var j = 0; j < productsIndi.length; j++) {
			(j == 0 ? basketWrite += "<tr bgcolor='" + rowBgrnd + "' align='center'>\n" : "");

			var productsFinal = productsIndi[j].split('::');

			(j == (productsIndi.length - 2) ? prodTotal += (productsFinal[1] - 0) : prodTotal += 0);

				switch(j) {
				case 1:
// write course name
				basketWrite += "<td nowrap><font face='Arial' size='3'><b>" + productsFinal[1] + "</b></font></td>\n";
				descTemp = productsFinal[1];
				break;

				}
			}
		allDesc += descTemp + "";
	}
	basketWrite += "</tr><tr align='left'><td colspan='4'>"

		if (navigator.appName=='Netscape') {
			basketWrite += "<input type='hidden' name='postage' value=''><input type='hidden' name='amount' value=''>\n";
		} else {
			basketWrite += "<div id='postage' align='left' style='';></div></td>\n";
		}

	basketWrite += "</tr></table>\n";

	} else {

		basketWrite ="<font face='Arial' color='#990000' size='+2'>Your shopping basket is empty</font><br>";

	}

function formCheck(form)  { //Checks the form for correctness and builds an alert string
	var Msg = ""
	var focused = 0;
	var focus_field = "";
    if (form.MC_FN.value == "") {
      Msg += "Please enter your first name.\n";
	if (focused != 1) {focused = 1; focus_field = "form.MC_FN";}
    }
    if (form.MC_LN.value == "") {
      Msg += "Please enter your last name.\n";
	if (focused != 1) {focused = 1; focus_field = "form.MC_LN";}
    }
    if (form.MC_DA.value == "") {
      Msg += "Please enter your address.\n";
	if (focused != 1) {focused = 1; focus_field = "form.MC_DA";}
    }
    if (form.MC_DC[form.MC_DC.selectedIndex].value == 00) {
      Msg += "Please specify your country.\n";
	if (focused != 1) {focused = 1; focus_field = "form.MC_DC";}
    }
    if (form.MC_DPC.value == "") {
      Msg += "Please enter your postcode.\n";
	if (focused != 1) {focused = 1; focus_field = "form.MC_DPC";}
    }
    if (form.MC_DE.value == "") {
	Msg += "Please enter your email address.\n";
	if (focused != 1) {focused = 1; focus_field = "form.MC_DE";}
    } else if (form.MC_DE.value.indexOf("@") == -1 || form.MC_DE.value.indexOf(".") == -1) {
	Msg += "Please enter a valid email address.\n";
	if (focused != 1) {focused = 1; focus_field = "form.MC_DE";}
    }
    if (form.MC_DCE.value == "") {
	Msg += "Please confirm your email address.\n";
	if (focused != 1) {focused = 1; focus_field = "form.MC_DCE";}
    } else if (form.MC_DCE.value.indexOf("@") == -1 || form.MC_DCE.value.indexOf(".") == -1) {
	Msg += "Please enter a valid confirm email address.\n";
	if (focused != 1) {focused = 1; focus_field = "form.MC_DCE";}
    }
    if ((form.MC_DE.value && form.MC_DCE.value) && (form.MC_DE.value != form.MC_DCE.value)) {
	Msg += "Your email and confirm email are not the same.\n";
	if (focused != 1) {focused = 1; focus_field = "form.MC_DCE";}
    }
    if (form.tel.value == "") {
      Msg += "Please enter your telephone number.\n";
	if (focused != 1) {focused = 1; focus_field = "form.tel";}
    }
    if (form.MC_AG.checked == false) {
      Msg += "Please check the Privacy, Terms and Conditions box before you continue.\n";
	if (focused != 1) {focused = 1; focus_field = "form.MC_AG";}
    }

    if (Msg != "") {
		alert(Msg);
		var ff = eval (focus_field);
		if (focus_field != "") {ff.focus();}
		return false
    }else{

form.MC_AG.value = "I, " + form.MC_FN.value + " " + form.MC_LN.value + ", have read, understand and agree	\
with the Home Study Courses Ltd terms and conditions \
published on its corporate website.";
return true;
}
}

// The function below writes either to a layer (IE) or to text filed (NS)
// It then extracts the values of the selected countries (from the data.js file)
// and then adds the postage value (also from the data.js file) if they aren't found

function divWrite(obj) {

var frm = document.basket.MC_DC;

	if (frm[frm.selectedIndex].value == "AU"){ postPack = 60 } else
	if (frm[frm.selectedIndex].value == "BS"){ postPack = 50 } else
	if (frm[frm.selectedIndex].value == "BD"){ postPack = 60 } else
	if (frm[frm.selectedIndex].value == "BH"){ postPack = 80 } else
	if (frm[frm.selectedIndex].value == "BN"){ postPack = 60 } else
	if (frm[frm.selectedIndex].value == "BR"){ postPack = 70 } else
	if (frm[frm.selectedIndex].value == "CA"){ postPack = 40 } else
	if (frm[frm.selectedIndex].value == "CN"){ postPack = 60 } else
	if (frm[frm.selectedIndex].value == "CY"){ postPack = 70 } else
	if (frm[frm.selectedIndex].value == "EG"){ postPack = 30 } else
	if (frm[frm.selectedIndex].value == "FJ"){ postPack = 75 } else
	if (frm[frm.selectedIndex].value == "HK"){ postPack = 60 } else
	if (frm[frm.selectedIndex].value == "IN"){ postPack = 50 } else
	if (frm[frm.selectedIndex].value == "ID"){ postPack = 60 } else
	if (frm[frm.selectedIndex].value == "IE"){ postPack = 35 } else
	if (frm[frm.selectedIndex].value == "IS"){ postPack = 50 } else
	if (frm[frm.selectedIndex].value == "JP"){ postPack = 60 } else
	if (frm[frm.selectedIndex].value == "KE"){ postPack = 65 } else
	if (frm[frm.selectedIndex].value == "MY"){ postPack = 60 } else
	if (frm[frm.selectedIndex].value == "MT"){ postPack = 82 } else
	if (frm[frm.selectedIndex].value == "MX"){ postPack = 40 } else
	if (frm[frm.selectedIndex].value == "NG"){ postPack = 60 } else
	if (frm[frm.selectedIndex].value == "NZ"){ postPack = 70 } else
	if (frm[frm.selectedIndex].value == "PH"){ postPack = 60 } else
	if (frm[frm.selectedIndex].value == "LC"){ postPack = 50 } else
	if (frm[frm.selectedIndex].value == "SA"){ postPack = 80 } else
	if (frm[frm.selectedIndex].value == "SE"){ postPack = 40 } else
	if (frm[frm.selectedIndex].value == "SG"){ postPack = 60 } else
	if (frm[frm.selectedIndex].value == "ZA"){ postPack = 40 } else
	if (frm[frm.selectedIndex].value == "KR"){ postPack = 60 } else
	if (frm[frm.selectedIndex].value == "CH"){ postPack = 40 } else
	if (frm[frm.selectedIndex].value == "TW"){ postPack = 60 } else
	if (frm[frm.selectedIndex].value == "TH"){ postPack = 60 } else
	if (frm[frm.selectedIndex].value == "TR"){ postPack = 60 } else
	if (frm[frm.selectedIndex].value == "US"){ postPack = 40 } else
	if (frm[frm.selectedIndex].value == "VN"){ postPack = 60 } else
	if (frm[frm.selectedIndex].value == "ZM"){ postPack = 65 } else
	{postPack = 30}

var frmAll = document.basket;
var PandP = 1;
	for (var k in countries) {
		if (frm[frm.selectedIndex].value == countries[k]) {
		PandP = 0; // free postage for the countries in the "countries"
			   // array (see data.js)
		}
	}

	if (PandP == 1) {

		frmAll.MC_P.value=postPack; // set the postage price here

	} else {

		frmAll.MC_P.value="";

	}

	if (navigator.appName == 'Netscape') {
		if (PandP == 0) {
			document.basket.postage.value = 0;
			document.basket.amount.value = prodTotal;
		} else {
			document.basket.postage.value = postPack;
			document.basket.amount.value = prodTotal + postPack;
		}
	} else { // IExplorer

		if (document.all.postage) {
			if (PandP == 0) {
				document.all.postage.innerHTML = "<input type='hidden' name='amount' value='" + prodTotal + "'>";
			} else {
				document.all.postage.innerHTML = "<input type='hidden' name='amount' value='" + (prodTotal + postPack) + "'>";
			}
		}
	}
}

function twoPlaces (amount){
return (amount == Math.floor(amount)) ? amount + '.00' :
((amount*10 == Math.floor(amount*10)) ? amount + '0' : amount);
}







var today = new Date();
var expiry = (365 * 24 * 60 * 60 * 1000);

function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1) { endstr = document.cookie.length; }
	return unescape(document.cookie.substring(offset, endstr));
	}

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg) {
			return getCookieVal (j);
			}
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break; 
		}
	return null;
	}

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";
		}
	}

function SetCookie (name,value,expires,path,domain,secure) {
expires = new Date(today.getTime() + expires);
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
	}


//-->
