function detect()
{
 framesetpage="http://www.elysion.nl/correct.php";

 thispage=window.location.href;
 if (thispage.indexOf('://')<0) {thispage="://"+thispage;};
 prefix=thispage.substring(0,thispage.lastIndexOf('://'));
 suffix=thispage.substring(thispage.lastIndexOf('://')+3,thispage.length);

 if (suffix.indexOf('/')>=0)
  temp = suffix.substring(suffix.indexOf('/')+1,suffix.length);
 if (temp.lastIndexOf('/')>=0) {
  subpage = temp.substring(temp.lastIndexOf('/')+1,temp.length);
  subdir = temp.substring(0,temp.lastIndexOf('/'));
 }
 else {
  subpage = temp;
  subdir = '';
 }
 //alert('the subpage is:['+prefix+']['+suffix+']['+subdir+']['+subpage+']');

 if (parent.location.href==window.location.href) 
 {
  parent.location.href=framesetpage+"?subdir="+subdir+"&subpage="+subpage;
 } //passes string to url
}

detect();

