function navit(currentname,force){ // all vars var spacer=0;var i=1;var e=1;var gotoname;var gotodir;var gobackname;var gobackdir;var colored;var thedir;var thename;var prev;var next;var pos=0;var matchit;var total;var breakat; // all arrays and associated vars total=(names.length)-1; // determine total number of items in array // determine if list is broken in have or forced by the java code on article page if(force == 0){ if(total <= 4){ breakat = total;} else{ breakat=Math.floor(total*.5); } } else{ breakat=force; } // determine the position of the article while(i<=total){ matchit=names[i]; if(matchit == currentname){ pos=i; } i++; } // end while i=1 // select which item is associated with the previous button if(pos != 1){ prev=pos-1; gobackname=names[prev]; gobackdir=dirs[prev]; } else{ gobackname=prevcat; gobackdir=prevdir; } document.write('View This Magazines Previous Page - '+gobackname+''); document.write(''); // write each item to the line while(i <= total){ // determine which items get the pipe or break if(e != breakat){ if(i < total){ spacer=" | "; } else{ spacer=""; } } else{ spacer="
"; } e++; thedir=dirs[i]; thename=names[i]; // determine which iten gets colored red if(currentname == thename){ colored=" STYLE=\"color: red\;\""; } else{ colored=""; } document.write(''+thename+''+spacer+''); i++; } // end while document.write(''); // select which item is associated with the next button if(pos < total){ next=pos+1; gotoname=names[next]; gotodir=dirs[next]; } else{ gotoname=nextcat; gotodir=nextdir; } document.write('View This Magazines Next Page - '+gotoname+''); } // end navit