1// Copyright 2001 Idocs.com 2// Distribute this script freely, but keep this notice in place 3 4// backlink object initializer 5function backlink() { 6 this.text = 'Go Back'; 7 this.type = 'link'; 8 this.write = backlink_write; 9 this.form = true; 10} 11 12 13// write method 14function backlink_write() { 15 if (! window.history) return; 16 if (window.history.length == 0)return; 17 18 this.type = this.type.toLowerCase(); 19 if (this.type == 'button') { 20 if (this.form) 21 document.write('<FORM>'); 22 document.write('<INPUT TYPE=BUTTON onClick="history.back(-1)" VALUE="', this.text, '"'); 23 if (this.otheratts) document.write(' ', this.otheratts); 24 document.write('>'); 25 if (this.form)document.write('<\/FORM>'); 26 } else { 27 document.write('<A HREF="javascript:history.back(-1)"'); 28 if (this.otheratts) 29 document.write(' ', this.otheratts); 30 document.write('>'); 31 if (this.type == 'image' || this.type == 'img') { 32 document.write('<IMG SRC="', this.src, '" ALT="', this.text, '"'); 33 if (this.width) document.write(' WIDTH=', this.width); 34 if (this.height) document.write(' HEIGHT=', this.height); 35 if (this.otherimgatts) document.write(' ', this.otherimgatts); 36 document.write(' BORDER=0>'); 37 } 38 else 39 document.write(this.text); 40 document.write('<\/A>'); 41 } 42} 43