//All source code and design by Bowers Programming
//Source code copyright &copy; 1999, 2006 Randy Bowers, Bowers Programming.
//Source code is designated intellectual property of Bowers Programming.
//phn: 360.671.5280
//eml: randy@bowersprogramming.com
//web: www.bowersprogramming.com
//All rights of copyright holders are reserved.

//use: return isNumber(N)
//given a character returns the character if it was 0..9, otherwise it halts the event.
function isNumber(e) {
    var keynum;
    var keychar;
    var numcheck;
    if(window.event) { // IE
        keynum = e.keyCode;
    } else if(e.which) { // Netscape/Firefox/Opera
        keynum = e.which;
    }
    keychar = String.fromCharCode(keynum);
    numcheck = /\d/;
    return numcheck.test(keychar);
}

// Function to 'activate' images.
function imgOn(imgName,windowStatus) {
        if (document.images) {
            document[imgName].src = eval(imgName + 'on.src');
        }
}

// Function to 'deactivate' images.
function imgOff(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + 'off.src');
        }
}

//open a window with defined width and height.
function openDynWin(page,w,h) {
    window_handle = window.open(page,'popup','width='+w+',height='+h+',scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no');
    window_handle.focus();
}

function get_numbers(s) {
    var sChars='1234567890';
    var i=0;
    var n='';
    for (i=0;i<s.length;i++) {
        if (sChars.indexOf(s.charAt(i))!=-1) n+=s.charAt(i);
    }
    return n;
}