/* Constructor for Subsitution Array */ function substspec(urltype,oldstem,newstem) { this.urltype = urltype; this.oldstem = oldstem; this.oldstemlen = oldstem.length; this.newstem = newstem; this.numtesturl =0; this.testurl = new Array(10); this.testurllen = new Array(10); } // End Constructor for substspec /* Substitute URL from Tables */ function substurl(oldurl) { var cururl = oldurl; var inputlen = cururl.length; for(var m=0; m< numurllist; m++) { var pointer = substurllist[m]; var curtype = pointer.urltype; var num = pointer.numtesturl; for(var n=0; n < num; n++) { var testsize = pointer.testurllen[n]; if( testsize > inputlen ) continue; var grabbit = cururl.substring(0,testsize); if( grabbit != pointer.testurl[n] ) continue; if( pointer.urltype == 'not' ) break; cururl = dosubsturl(cururl,pointer.oldstem,pointer.newstem); inputlen = cururl.length; } if( pointer.urltype == 'not' ) { cururl = dosubsturl(cururl,pointer.oldstem,pointer.newstem); inputlen = cururl.length; } } return cururl; } // End substurl(oldurl) function dosubsturl(cururl,oldstem,newstem) { var extractlen = oldstem.length; var junk = cururl.substring(0,oldstem.length); if( junk != oldstem ) return(cururl); return(newstem + cururl.substring(oldstem.length) ); } // End dosubsturl(cururl,oldstem,newstem) function addonurlsubst(callingframe,opt) { if(opt==1) numurllist=0; var numforms = callingframe.document.forms.length; for( var m=0; m