function Back() {
	history.back();
}

function changepic(img_name,img_obj) {
if (document.images) {
	document.images[img_name].src=img_obj.src}
}

function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
	this.obj = getObjNN4(document,name);
	this.style = this.obj;
  }
}

function getObjNN4(obj,name)
{
	var x = obj.layers;
	var thereturn;
	for (var i=0;i<x.length;i++)
	{
		if (x[i].id == name)
		 	thereturn = x[i];
		else if (x[i].layers.length)
			var tmp = getObjNN4(x[i],name);
		if (tmp) thereturn = tmp;
	}
	return thereturn;
}

function goquicklinks(quicklinks)
{
	//var linklist = document;
	
	if (quicklinks[quicklinks.selectedIndex].value != '')
	{
		var url=quicklinks[quicklinks.selectedIndex].value;
		top.CONTENTS.location.replace(url);
	}
}

function checkform(form) {
	var message = '';
	if(form.subject.value == '- Please Choose -'){message += 'Missing Subject \n';}
	if(form.name.value == ''){message += 'Missing Name \n';}
	if(form.email.value != '')
	{
		if(!isEmail(form.email.value)){message += 'Invalid Email Address \n';}
	}
	else {message += 'Missing Email \n';}
	if(form.message.value == ''){message += 'Missing Message \n';}
	if(!message){return true;}
	else{
		var msgtext = "The following problems occured during submission: \n\n"
		msgtext += message;
		alert(msgtext);
		return false;
	}
}

function isEmail(str) {
  // are regular expressions supported?
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported)
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
  return (!r1.test(str) && r2.test(str));
}

function OpenCertDetails()
{
thewindow = window.open('https://www.thawte.com/cgi/server/certdetails.exe?code=UKDIGI12', 'anew', config='height=400,width=450,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=yes');
}

function locate(page) { location=page; }

function selecttab(i, numberOfTabs){
	
	if (document.getElementById){
		for (f=1;f<numberOfTabs+1;f++)
		{
			//alert("document.getElementById('contentblock'" + f + ").style.display='none'");
			document.getElementById('contentblock'+f).style.display='none';
			//document.getElementById('link'+f).className ='taboff';
		}
		document.getElementById('contentblock'+i).style.display='block';
		//document.getElementById('link'+i).className ='tabon';
	}
}

function helpwindow(url, name)
{
	var w = window.open(url,
			    name,
			    "scrollbars,width=300,height=400,status");
}