<!--  
/*Js-code Copyright 2001(C)PetriV@TheFORCEzone, Finland: */
var rt1="tila/";                                             //root in URL, give 4 last chars of rootfolder name + "/"
var pg1="frame.htm";                                //page to get frames
var wn1="vtmain";                                     //windowname this page should be in
function locate(str1){                                //constructor
this.loc=window.location.href;                 //URL to operate with
this.len=this.loc.length;                            //URL length, = indexOf(last char) +1  ! ! !
this.root=this.loc.indexOf(str1)+5;          //index of root folder slash+1, str1= last 4 chars of foldername and slash 
this.last=this.loc.lastIndexOf("/")+1;       //index of last folder slash+1
this.sub=0;                                                   //number of subfolders
for(i=this.root;i<=this.len;i++){                 //search char by char
if(this.loc.charAt(i)=="/")this.sub++;}       //any found "/" adds sub by one
}
var cord=new locate(rt1);                          //new instance
function throwTop(){ 
if(window.top==window.self||window.name!=wn1){               //no frame, wrong frame
if(cord.sub==0)window.top.location.href=pg1;                       //clear wrong frame, load your own
else if(cord.sub==1)window.top.location.href="../"+pg1;
else if(cord.sub==2)window.top.location.href="../../"+pg1;
else if(cord.sub==3)window.top.location.href="../../../"+pg1; }
}
throwTop(); //run now, not on onload-event
//onload=throwTop;// can't use if other onload-call in body-tag
//-->
