if (this.tohash) {
                if (this.previousvalue != this.value) {  //change only if it differs from previous value
                  this.previousvalue = this.value;
                  if (this.value.length>0 && this.value[0] === '#') window.location.hash = this.value;
                  else window.location.hash = '#'+this.value; //add hash if it is missing in the string value