<!--
var INSASS=false;
var nqmsg="On-line shopping is not supported for this browser.\n\nPlease enjoy looking around our site\nand contact us by phone, fax or e-mail\nwith your requirements."

function start_shop(){
var INSASS=false;
if(!pages_browser_test()){alert(nqmsg);}
else
{
if (!top.INSASS)
{
document.cookie = "LOADTHISPAGENOW" + "=" + escape(window.location.href)+"; path=/"
top.location.href = "../system/index.html";
}
}
}

function addItem(pitem){
var iitem = pitem;
if (iitem == "SOHO"){
var sf=document.SOHO.shost;
var shosting = sf.options[sf.selectedIndex].value;
}
else{
shosting = "";
}
if (iitem == "Business"){
sf=document.Business.stime;
var stime = sf.options[sf.selectedIndex].value;
}
else{
stime = "";
}

// **** Start of Web Mail coding 26 June 2006


if (iitem == "WebMail"){
sf=document.Business.swebmail;
var swebmail = sf.options[sf.selectedIndex].value;
}
else{
swebmail = "";
}

// **** End of Web Mail coding 26 June 2006


if (!top.INSASS){
//If shop not loaded, try and save info in cookie and start shop
var expdate = new Date ();
FixCookieDate (expdate);
expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000));
SetCookie("zitem", iitem, expdate);
	if (GetCookie("zitem")){
		if (iitem == "SOHO"){
		 SetCookie("zhost",shosting, expdate);
		 }
		 if (iitem == "Business"){
		 SetCookie("ztime",stime, expdate);
		 }
		 if (iitem == "WebMail"){
		 SetCookie("zwebmail",swebmail, expdate);
		 }		 
	start_shop();}
	else{
	//If it is not possible to use cookies, put out a message and start the shop
	alert ("The shopping system has not been loaded. It will be loaded now and you will be returned to this page. It may be necessary to enter your selected domain name again before it can be added to the basket");
	start_shop();}
	}
else{
//If the shop is loaded, add items to basket as normal
addToBasket(iitem,shosting,stime,swebmail);
}
}

function addToBasket(pitem,phosting,ptime,pwebmail){
var sitem = pitem;
var shosting = phosting;
var stime = ptime;
var swebmail = pwebmail;
var bitem;
//var Qty = 1;
var Wgt = 1;
var Tax = 1;
var bl1 = "";
var bl2 = "";
var bl3 = "";
var x="www.";
var sprice;
var OK = true;
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
var validChars="\[^\\s" + specialChars + "\]"
var atom=validChars + '+'
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
var atomPat=new RegExp(atom,"g")


if (sitem=="SOHO"){
	if (shosting=="10mb"){bitem="SOHO 10mb Annual fee";sprice=25.00;bl1="Z/10:100";}
	if (shosting=="20mb"){bitem="SOHO 20mb Annual fee";sprice=35.00;bl1="Z/20:100";}
	if (shosting=="30mb"){bitem="SOHO 30mb Annual fee";sprice=45.00;bl1="Z/30:100";}
	if (shosting=="40mb"){bitem="SOHO 40mb Annual fee";sprice=55.00;bl1="Z/40:100";}
	if (shosting=="50mb"){bitem="SOHO 50mb Annual fee";sprice=65.00;bl1="Z/50:100";}
}
if (sitem=="Business"){
	bl1="Z/100:1000";
	if (stime=="qtr"){bitem="Business 100mb Quarterly";sprice=70.00;}
	if (stime=="year"){bitem="Business 100mb Annual";sprice=260.00;}
}
if (sitem=="FP"){
	bitem="Front Page Extensions";
	sprice=15.00;
}


// **** Start of Web Mail coding 26 June 2006

if (sitem == "WebMail"){
	if (swebmail=="StdWebMail"){bitem="Std WebMail 100mb Option";sprice=5.00;bl1="WM/100:200";}
	if (swebmail=="WebMail+"){bitem="WebMail+ 200mb Option";sprice=15.00;bl1="WM/200:500";}
}
else{
swebmail = "";
}

// **** End of Web Mail coding 26 June 2006

//Enter domain name 
if (sitem=="SOHO"||sitem=="Business"||sitem=="FP"){
	if (sitem=="FP"){
	var sdomain =  prompt (bitem+ ". Please enter the domain name linked to your web space.", "" );
	}
	else{
	var sdomain =  prompt (bitem+ ". Please enter the domain name to be linked to your web space." + '\n' + "NOTE: Do not use this option to renew your web hosting as you will need to upload your website again.  Web Hosting can be renewed through the Admin Panel.", "Your domain name" );
	}
  	if (sdomain!=null&&sdomain>"  "){
  		for(i=0;i<sdomain.length;i++){
			if(sdomain.substr(i,4)==x){
			alert ("Domain name is invalid - do not enter 'www.'");
			OK = false;
			break;
			return false;
			}
    		}

    	var fdomain = sdomain;
    	
		// Domain is symbolic name
		var domainArray= fdomain.match(domainPat);
		if (domainArray==null) {
			alert("The domain name is invalid.");
			OK = false;
		    return false;
		}

		var domArr= fdomain.match(atomPat);
		var len=domArr.length;
		if (domArr[domArr.length-1].length<2 || 
		    domArr[domArr.length-1].length>4) {
		   // the address must end in a two, three or four letter word.
		   alert("The address must end in a three- or four- letter domain, or two letter country.");
		   OK = false;
		   return false;
		}

		// Make sure there's a host name preceding the domain.
		if (len<2) {
		   var errStr="This address is missing a hostname";
		   alert(errStr);
		   OK = false;
		   return false;
		}

    	}
    	else{
       		if (sdomain!=null){
    		alert ("Sorry, you must supply a domain name.");
    		OK = false;
    		return false;
    		}
    		else{
    		OK = false;
    		return false;
    		}
    	}
}

// **** Start of Web Mail coding 26 June 2006

if (sitem=="WebMail"){
	do {
		if (sdomain==undefined){
			var sdomain =  prompt (bitem+ ". Please enter the mailbox name in the form, name@domain.xxx you wish to use for Web Mail.", "" );
		}
		else{
			var sdomain =  prompt (bitem+ ". Please enter the mailbox name in the form, name@domain.xxx you wish to use for Web Mail.", sdomain );
		}
		// test the email address entered looks like a valid address
		if (sdomain!=null&&sdomain>"  "){
		var OK=emailCheck(sdomain);
		}
		    	else{
		       		if (sdomain!=null){
		    		alert ("Sorry, you must supply an email address.");
		    		OK = false;
		    		return false;
		    		}
		    		else{
		    		OK = false;
		    		return false;
		    		}
    	}

	} while (OK==false) 
}

// **** End of Web Mail coding 26 June 2006


if (OK==true){
	if (sitem=="FP"){
	bl1 = "FP/Annual fee";
	bl2 = sdomain;

	}
	else{
	bl2 = sdomain;
	}
//Qty = eval('top.qlock(' + Qty + ')');
top.newchoice(bitem, bl1, bl2, bl3, sprice, top.qlock(1), Wgt, Tax);
}
}

function reviewbasket() {
if (!top.INSASS){
	alert ("The shopping system has not been loaded. It will be loaded now and you will be returned to this page.");
start_shop();}
else{
top.reviewbasket(true);
}
}

function testcookie() {
if (GetCookie("zitem")) {
var sitem = GetCookie("zitem");
	if (sitem != ""){
	DeleteCookie("zitem");
	var shosting = GetCookie("zhost");
		if (shosting != ""){
		DeleteCookie("zhost");
		}
	var stime = GetCookie("ztime");
		if (stime != ""){
		DeleteCookie("ztime");
		}
	var swebmail = GetCookie("zwebmail");
			if (swebmail != ""){
			DeleteCookie("zwebmail");
		}
	addToBasket(sitem,shosting,stime,swebmail);
	}
}
}

// **** Email checking added by copying from ..\library\User2Form.js

// Validate email
function emailCheck(emailStr){
var emailPat=/^(.+)@(.+)$/
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
var validChars="\[^\\s" + specialChars + "\]"
var quotedUser="(\"[^\"]*\")"
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
var atom=validChars + '+'
var word="(" + atom + "|" + quotedUser + ")"
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")

var matchArray=emailStr.match(emailPat)

if (matchArray==null) {
	alert("Email address is incorrect (check @ and .'s) \n or is missing")
	return false
}
var user=matchArray[1]
var domain=matchArray[2]

if (user.match(userPat)==null) {
    // user is not valid
    alert("The username is incorrect.")
    return false
}

var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
    // this is an IP address
	  for (var i=1;i<=4;i++) {
	    if (IPArray[i]>255) {
	        alert("Destination IP address is invalid")
		return false
	    }
    }
    return true
}

var domainArray=domain.match(domainPat)
if (domainArray==null) {
	alert("The domain name is invalid.")
    return false
}

var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
// 27-08-2009	if (domArr[domArr.length-1].length<2 || 
// 27-08-2009	    domArr[domArr.length-1].length>3) {
// 27-08-2009	   alert("The address must end in a three-letter domain, or two letter country.")
// 27-08-2009	  return false
// 27-08-2009	}

if (len<2) {
   var errStr="This address is missing a hostname."
   alert(errStr)
   return false
}

return true;
}
////////////////////////////// End of email checking

//-->