/********************************************************************* === Graphical Button === * VividButton [ VividButton.js ] * updated 2001/05/28 mail : peace@skipup.com home : http://www.skipup.com/~peace/ *********************************************************************/ function VividButton( path0 , path1 , width , height , listener ){ var D = document ; this.images = new Array(2); this.images[0] = new Image( width , height ); this.images[0].src = path0 ; this.images[1] = new Image( width , height ); this.images[1].src = path1 ; this.listener = listener ; this.index = D.images.length ; D.write( "" ); D.write( "" ); D.write( "<\/a>" ); D.images[ this.index ].$VB = this ; } function setBasicMember__VividButton__(){ var VP = VividButton.prototype ; /****************************** SET_MEMBER - BEGIN ******************************/ VP.over = function(){ document.images[ this.index ].src = this.images[1].src ; }; VP.click = function(){ if( this.listener ) this.listener( this.index ); }; VP.out = function(){ document.images[ this.index ].src = this.images[0].src ; }; VP.toString = function(){ var s0 = unescape( this.images[0].src ); var s1 = unescape( this.images[1].src ); var name0 = s0.substring( s0.lastIndexOf("\/")+1 , s0.length ); var name1 = s1.substring( s1.lastIndexOf("\/")+1 , s1.length ); return "VividButton : "+name0+" , "+name1+" @ "+this.index ; }; /****************************** SET_MEMBER - E N D ******************************/ } setBasicMember__VividButton__();