function scramblemail(tri_fix)
{
   var idot = '.';
   var amper = '@';
   var double_dot = ':';
   var domainy = 'co';
   var el = 'l';
   var sub= /_/gi;
   var sub2= /z/gi;

   tri_fix = tri_fix.replace(sub,'');
   tri_fix = tri_fix.replace(sub2,'');

   document.write("<A HREF=\"mai"+el+"to");
   document.write(double_dot + tri_fix + amper);
   document.write("de"+"fimp"+"act"+idot+domainy+"m\">");
}

function scramblemailus(tri_fix)
{
   var idot = '.';
   var amper = '@';
   var double_dot = ':';
   var domainy = 'co';
   var el = 'l';
   var sub= /_/gi;
   var sub2= /z/gi;

   tri_fix = tri_fix.replace(sub,'');
   tri_fix = tri_fix.replace(sub2,'');

   document.write("<A HREF=\"mai"+el+"to");
   document.write(double_dot + tri_fix + amper);
   document.write("de"+"fimp"+"act"+idot+domainy+"m\"");
   document.write(" class=\"style1\">");
}

function scrambletext(tri_fix)
{
   	var sub= /z/gi;
   	tri_fix = tri_fix.replace(sub,'');
   	document.write(tri_fix);
}

function scramblenumber(line)
{
var countrycodeFR ='+33';
var countrycodeUK ='+44';
var areacode = ' (0)1423';
var mobcode = ' (0)7949';
var barrowcode = ' (0)1469';
var skiptoncode = ' (0)1756';
var biotcode = ' 93 65';
var osem = '8';
var devet = '9';
var pet = '5';
var tri = '3';

	switch (line)
	{
  	case "home" : 
     	document.write(countrycodeUK + areacode + " 70" + devet + "275");
     	break;
  	case "homeoffice" : 
     	document.write(countrycodeUK + areacode + " 521 9" + pet + "5");
     	break;
  	case "fax" : 
	document.write(countrycodeUK + areacode + " 740" + tri + "00");
     	break;
  	case "pmobile" : 
	document.write(countrycodeUK + mobcode + " 29" + devet + " 600");
     	break;
  	case "tmobile" : 
	document.write(countrycodeFR + mobcode + " 86 11 54 " + osem + "3");
     	break;
  	case "barrowhaven" : 
	document.write(countrycodeUK + barrowcode + " 531 4" + tri + "2");
     	break;
  	case "skipton" : 
	document.write(countrycodeUK + skiptoncode + " 6" + tri + "1276");
     	break;
  	default : 
     	document.write("sorry, this number is not listed");
     	break;
	}
} 



function scramblehomeaddress()
{
line1 ='Villa Mir';
line2 ='Les Hauts de Biot';
line3 ='1301 Chemin de St. Julien';
line4 ='06410 Biot';
line5 ='France';

document.writeln(line2+"<BR>");
document.writeln(line3+"<BR>");
document.writeln(line4+"<BR>");
document.writeln(line5+"<BR>");
}

function scrambleregaddress()
{
line1 ='3 Beechwood Crescent';
line2 ='Harrogate';
line3 ='North Yorkshire';
line4 ='HG2 0PA';
line5 ='England';

document.writeln(line1+"<BR>");
document.writeln(line2+"<BR>");
document.writeln(line3+"<BR>");
document.writeln(line4+"<BR>");
document.writeln(line5+"<BR>");
}

function getIEVersionNumber() {
  var ua = navigator.userAgent;
  var MSIEOffset = us.indexOf("MSIE ");
  if (MSIEOffset == -1) {
    return 0;
  } else {
    return parseFloat(ua.substring(MSIEOffset + 5, ua.Indexof(";", MSIEOffset)));
  }
}

function setmenubar() {
document.write("<TR>");
document.write("<TD WIDTH=780 HEIGHT=28 ALT=\"\" valign=\"top\""); 
document.write("background=\"images/top_px.jpg\">");
document.write("<div><TABLE WIDTH=412 BORDER=0 CELLPADDING=0 CELLSPACING=0>");
document.write("<TR>");
document.write("<TD>");
document.write("<IMG SRC=\"images\/spacer.gif\" WIDTH=11 HEIGHT=28 ALT=\"spacer\"><\/TD>");

document.write("<TD><a href=\"overview.html\"><img src=\"images\/mCO125.gif\" ");
document.write("alt=\"\" width=\"125\" height=\"28\" border=\"0\" ");
document.write("onMouseOver=\"this.src='images\/mCO125r.gif'\" ");
document.write("onMouseOut=\"this.src='images\/mCO125.gif'\"><\/a><\/TD>");

document.write("<TD><a href=\"investors.html\"><img src=\"images\/mDue98.gif\" ");
document.write("alt=\"\" width=\"98\" height=\"28\" border=\"0\" ");
document.write("onMouseOver=\"this.src='images\/mDue98r.gif'\" ");
document.write("onMouseOut=\"this.src='images\/mDue98.gif'\"><\/a><\/TD>");

document.write("<TD><a href=\"security.html\"><img src=\"images\/mSec125.gif\" ");
document.write("alt=\"\" width=\"125\" height=\"28\" border=\"0\" ");
document.write("onMouseOver=\"this.src='images\/mSec125r.gif'\" ");
document.write("onMouseOut=\"this.src='images\/mSec125.gif'\"><\/a><\/TD>");

document.write("<TD><a href=\"strategic.html\"><img src=\"images\/mStr152.gif\" ");
document.write("alt=\"\" width=\"152\" height=\"28\" border=\"0\" ");
document.write("onMouseOver=\"this.src='images\/mStr152r.gif'\" ");
document.write("onMouseOut=\"this.src='images\/mStr152.gif'\"><\/a><\/TD>");

document.write("<TD><a href=\"contact.html\"><img src=\"images\/mCon86.gif\" ");
document.write("alt=\"\" width=\"86\" height=\"28\" border=\"0\" ");
document.write("onMouseOver=\"this.src='images\/mCon86r.gif'\" ");
document.write("onMouseOut=\"this.src='images\/mCon86.gif'\"><\/a><\/TD>");

document.write("<\/TR>");
document.write("<\/TABLE><\/div>");
document.write("<\/TD>");
document.write("<\/TR>");
}

function setbanner() {
document.write("<TD>");
document.write("<IMG SRC=\"images\/logoGB.jpg\"");
document.write("WIDTH=592 HEIGHT=89 ALT=\"Defimpact Logo\"><\/TD>");
document.write("<TD background=\"images\/addons.jpg\"");
document.write("WIDTH=188 HEIGHT=89 ALT=\"Top Menu Items\" valign=\"top\">");
document.write("<div style=\"padding-top:40px\">");
document.write("<a href=\"index.html\" class=\"style1\">");
document.write("<img src=\"images\/home.gif\" alt=\"home pic\" width=\"9\"  height=\"9\"");
document.write(" border=\"0\" style=\"margin-left:10px; margin-right:4px\">Home<\/a>");
document.write("<a href=\"sitemap.html\" class=\"style1\">");
document.write("<img src=\"images\/sitemap.gif\" alt=\"site pic\" width=\"9\" height=\"9\"");
document.write(" border=\"0\" style=\"margin-left:10px; margin-right:4px\">Site Map<\/a>");
document.write("<script type=\"text\/javascript\">scramblemailus(\"zeznzq_uzizrz_zyz\");<\/script>");
document.write("<img src=\"images\/mail_us.gif\" alt=\"mail pic\" width=\"9\" height=\"9\"");
document.write(" border=\"0\" style=\"margin-left:10px; margin-right:4px\">Mail Us<\/a><\/div>");
document.write("<\/TD>");
}

function emailvalid(maddress){
  var checkad = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/;
  return checkad.test(maddress);
}

function checkform(field) {
var c1='#FFFFFF';
var c2='#FFCCCC';

if (!emailvalid(field.EmailInitial.value))
{field.EmailInitial.style.backgroundColor=c2;field.EmailInitial.focus();alert('Please verify your email address as it seems to be invalid.');return false;} 
else {field.EmailInitial.style.backgroundColor=c1;}

if (field.EmailConfirmed.value!=field.EmailInitial.value)
{field.EmailConfirmed.style.backgroundColor=c2;field.EmailConfirmed.focus();alert('Your two email entries do not match - please correct.');return false;} 
else {field.EmailConfirmed.style.backgroundColor=c1;}

return true;
}
