scrptTags = document.getElementsByTagName('SCRIPT');

if(scrptTags){
	framesfile = scrptTags[0].getAttribute("framesfile");
}else{
	framesfile = document.scripts[0].getAttribute("framesfile");	
}

docLoc = document.location.toString();
//pagefile = docLoc.substring(docLoc.lastIndexOf("/")+1,docLoc.lastIndexOf(".html"));

pagefile = docLoc.substring(docLoc.lastIndexOf("/")+1);

if(docLoc.indexOf(".php") != -1){
	//pagefile = docLoc.substring(docLoc.lastIndexOf("/")+1,docLoc.lastIndexOf(".php"));
	pagefile = docLoc.substring(docLoc.lastIndexOf("/")+1);
}

topDocLoc = top.document.location.toString();

topDocRoot = topDocLoc.substring(0,docLoc.lastIndexOf("/")+1);
docRoot = docLoc.substring(0,docLoc.lastIndexOf("/")+1);

//topFramesFile = topDocLoc.substring(docLoc.lastIndexOf("/")+1,docLoc.lastIndexOf(".html")+5);
topFramesFile = topDocLoc.substring(docLoc.lastIndexOf("/")+1);
try {
	if(top.frames.length == 0){
		window.name = pagefile;
		document.location.href = framesfile;
	}else{
		if(framesfile != topFramesFile || topDocRoot != docRoot){
			top.window.name = pagefile;
			top.document.location.href = framesfile;
		}	
	}	
}catch(exception){
}