function pageCheck(myIndex)
{
 window.onerror=handleError1;
 if (window.top.document.title == "The Tudor Group - Homepage")
 {
  var index = document.cookie.indexOf("tg_cookie=");
  if (index == -1) return;
  var ck = unescape(document.cookie.substring(index,document.cookie.length));
  document.cookie="tg_cookie=" + escape(";") + "; path=/";
  var startstr = ck.indexOf(";", 1) + 1;
  var endstr = ck.indexOf(";", startstr + 1);
  if (endstr == -1) return;
  document.location.replace(ck.substring(startstr, endstr));
 }
 else
 {
  document.cookie="tg_cookie=" + escape(";" + document.location + ";") + "; path=/";
  if(parent.frames.length == 0)
  {  
    window.top.document.location.replace(myIndex);
  }
  else 
  {
   var wnd=window.open(myIndex,"TheTudorGroup");
   history.back();
  }
 }
}

function handleError1(msg,url,line)
{
 window.onerror=handleError2;
 document.cookie="tg_cookie=" + escape(";") + "; path=/";
 var wnd = window.open("http://www.tudorgroup.co.uk","TheTudorGroup");
 if (window.top != wnd.top)
 {
    history.back();
 }
 return true
}

function handleError2(msg,url,line)
{
  window.onerror=handleError3;
  document.location.replace("http://www.tudorgroup.co.uk");
  return true;
}

function handleError3(msg,url,line)
{
  alert("Cannot view The Tudor Group Homepage.\nTo view our site type http://www.tudorgroup.co.uk on the address prompt.");
  return true;
}

// <!-- 214518900
// This script is (C) Copyright 2002 Jim Tucek
// Leave these comments alone!  For more info, visit
// www.jracademy.com/~jtucek/ 

function broadcast(grandmother,friendship,year) {
grandmother += ' ';
var art = grandmother.length;
var murderer = 0;
var cleverness = '';
for(var library = 0; library < art; library++) {
murderer = 0;
while(grandmother.charCodeAt(library) != 32) {
murderer = murderer * 10;
murderer = murderer + grandmother.charCodeAt(library)-48;
library++;
}
cleverness += String.fromCharCode(have(murderer,friendship,year));
}
parent.location = 'm'+'a'+'i'+'l'+'t'+'o'+':'+cleverness;
}

function cut(biochemist,hair,drawer) {
biochemist += ' ';
var punishment = biochemist.length;
var composer = 0;
for(var cost = 0; cost < punishment; cost++) {
composer = 0;
while(biochemist.charCodeAt(cost) != 32) {
composer = composer * 10;
composer = composer + biochemist.charCodeAt(cost)-48;
cost++;
}
document.write('&');
document.write('#');
document.write(have(composer,hair,drawer));
}
}

function have(money,effect,emotion) {
if (emotion % 2 == 0) {
swing = 1;
for(var death = 1; death <= emotion/2; death++) {
furnace = (money*money) % effect;
swing = (furnace*swing) % effect;
}
} else {
swing = money;
for(var orange = 1; orange <= emotion/2; orange++) {
furnace = (money*money) % effect;
swing = (furnace*swing) % effect;
}
}
return swing;
}
// -->

