//
// Copyright 2000 QSS Ltd., All rights reserved.
// $Id: yearupdown.js, v. 0.1 2002/01/29 2:31:00 PM aselimovic Exp $
//

function yearUpDown(value) {
   this.value = value || (new Date()).getFullYear();
   this.min = 1970;
   this.max = 2079;
   this.decrement = decrement;
   this.increment = increment;
   this.validate = validate;
}

function decrement() {
   if (this.validate() && checkRange(this.value - 1, this.min, this.max)) { return --this.value }
   return this.value;
}

function increment() {
   if (this.validate() && checkRange(Number(this.value) + 1, this.min, this.max)) { return ++this.value }
   return this.value;
}

function validate() {
   if (!/^\d{4}$/.test(this.value)) { return false }
   return true;
}

function checkRange(value, min, max) {
   if ((value < min) || (value > max)) { return false }
   return true;
}

var year = new yearUpDown((param("yr")[0]));






