<!--

// These scripts developed by Ben Jones for use at
// http://www.japanesetranslations.co.uk/
// Please let me know if you find them useful!

function inframe()
{
var search = "japanesetranslations.co.uk/";
	// live "japanesetranslations.co.uk/";
	// test "FreeNetName/";
var sl = search.length;

if (top.location.href.indexOf(search+"index.htm") == -1)
// i.e. if not shown within normal frame
{
  var gengostart = top.location.href.indexOf(search);
  if (gengostart != -1)
  // i.e. provided within normal domain
  {
  var gengofile = top.location.href.substring(gengostart + sl, top.location.href.length);
  top.location.href = "../index.htm?"+gengofile;
  }
  else 
  {
//  alert("Please access this site using the URL http://www.japanesetranslations.co.uk");
//  top.location.href = "http://www.japanesetranslations.co.uk";
  }
}
}


function isvga()
{
if(screen.colorDepth<8)
 // i.e. less than 256 colours, probably vga, so change colours
 {document.write('<link href="../styles/vga.css" rel="stylesheet" type="text/css">');
 }
}



// Clock Script Generated By Maxx Blade's Clock v2.0
// http://www.maxxblade.co.uk/clock
function tS(){ x=new Date(tN().getUTCFullYear(),tN().getUTCMonth(),tN().getUTCDate(),tN().getUTCHours(),tN().getUTCMinutes(),tN().getUTCSeconds()); x.setTime(x.getTime()+dS()+0); return x; } 
function tN(){ return new Date(); } 
function dS(){ return ((tN().getTime()>fD(0,2,2,-1).getTime())&&(tN().getTime()<fD(0,9,2,-1).getTime()))?3600000:0; } 
function fD(d,m,h,p){ var week=(p<0)?7*(p+1):7*(p-1),nm=(p<0)?m+1:m,x=new Date(tN().getUTCFullYear(),nm,1,h,0,0),dOff=0; if(p<0){ x.setTime(x.getTime()-86400000); } if(x.getDay()!=d){ dOff=(x.getDay()<d)?(d-x.getDay()):0-(x.getDay()-d); if(p<0&&dOff>0){ week-=7; } if(p>0&&dOff<0){ week+=7; } x.setTime(x.getTime()+((dOff+week)*86400000)); } return x; } 
function lZ(x){ return (x>9)?x:'0'+x; } 
function dT(){ if(fr==0){ fr=1; document.write('<span id="tP">'+eval(oT)+'</span>'); } tP.innerText=eval(oT); setTimeout('dT()',1000); } 
var fr=0,oT="lZ(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())";


function inindex()
{
// alert("Top "+top.location.href);
// alert("Windows "+window.location.href);
// confirm("Entered detached inindex");

// google.com/cache:www.japanesetranslations.co.uk/xxxxx
// ... etc. (last one problems when breaking out of frameset!)
// ***>> if in cache, offer to load current site in separate window

// alert("[query1] "+location.search.substring(1));
// always about WINDOW like 3 -- this is the problem?
// window.??? always changes as each FRAME is loaded...
// e.g. yahoo.com/xyz/top.htm -> yahoo.com/xyz/base.htm
// loading DIR/AAA.xxx frame goes to yahoo.com/xyz/DIR/AAA.xxx
// CURRENT DIRECTORY could be problem????
// 
// alert("[query2] "+top.location.search.substring(1));
// alert("[query3] "+window.location.search.substring(1));
query = (top.location.search.substring(1))? top.location.search.substring(1):"english/main.htm";
// sets it either to whole stuff after "?" or to "english/main.htm"

queryary=query.toLowerCase().split("/");
// alert("[q0] "+queryary[0]);	// jpn, english, etc. even if no "/"
// alert("[q1] "+queryary[1]);	// main.htm, etc.; blank if no "/"
// alert("[q2] "+queryary[2]);
// alert("[q3] "+queryary[3]);


// !!!!! goes to eng/english/contents.htm etc. by mistake... !!!!
// TOP still has eng/cont but WINDOWS has eng/english/cont

if (queryary[0].substr(0,1) == "j") gengo="japanese";
else gengo="english";
// was if ((queryary[0].substr(0,3) == "jap") || (queryary[0].substr(0,3) == "jpn"))

if (queryary[1] == null) file="main.htm";
else if (queryary[1].length == 0) file="main.htm";
// else if (queryary[1] == "english") alert("Javascript error: please notify website_error@ozaru.freeserve.co.uk");
else file=queryary[1];

// alert("Gengo "+gengo+"\nFile "+file);
// return("Hi there");
// confirm("Exiting detached inindex");
}




// -->

