// redirect bad url entries
function rdcheck(){
	var vloc = String(top.location);
	if( vloc.length > 28 ) {		
		var a = vloc.split("?",3); // split before case chg
		vloc.toLowerCase(); // now convert url to lowercase for conditioning
		
		//QUICKEST 1ST
		
		//CORRECT DOUBLE FRAMING
		//if ( parent.frames["main"].location.indexOf("klaw.com/index",15) != -1 ) {
			//alert("entering debug level - process entered ="+String(frames["main"].location));
			//parent.frames["header"].location = parent.frames["main"].location.href;
			//parent.frames["main"].location = parent.frames[2].location.href;			
		//}
		
		//BAD, NEEDS REDIRECTION TO NAV SUB-SEARCH				
		if ( vloc.indexOf("com/cwiki",20) != -1 ){
			top.location = ("http://centrelinklaw.com/index.html?"+a[1]);
			return;
		} else if ( vloc.indexOf("com/fm",20) != -1 ) {
			top.location = ("http://centrelinklaw.com/index.html?"+a[0].substring((a[0].lastIndexOf("/")+1))+"?"+a[1]);
			return;
		}			
				
		//INTENDED REDIRECT
		if ( a[0].indexOf("com/index",20) != -1 || a[0].length < 36) {
			if ( a[1].indexOf("title") != -1 && String(parent.frames["header"].location).indexOf(a[1],38) == -1 ) {
				parent.frames["header"].location = ("http://centrelinklaw.com/indexbody.html?"+a[1]);
				parent.frames["main"].location = ("http://centrelinklaw.com/cwiki/index.php5?"+a[1]);								
			} else if ( a[1].indexOf("view") != -1 && String(parent.frames["header"].location).indexOf(a[2],38) == -1 ) {
				parent.frames["header"].location = ("http://centrelinklaw.com/indexbody.html?"+a[1]+"?"+a[2]);
				parent.frames["main"].location = ("http://centrelinklaw.com/fm/"+a[1]+"?"+a[2]);
			}
						
		}		
	}
}

