/** ********************************************************************
 ** 
 ** *******************************************************************/
function Glue_util( debug )
{
    if(debug) this._debug = debug;
}

Glue_util.prototype =
{
    _debug: false,

    getByID: function( id )
    {
        return document.getElementById
            ? document.getElementById(id)
            : document.all[id]
        ;
    },
    getsByTag: function( tag )
    {
        return document.getElementsByTagName(tag);
    },

    // 正規表現
    regEmail: function( str )
    {
        return str.match(/^.+@.+\..+$/);
    },
    regPassword: function( str )
    {
        for( var i = 0; i < str.length; i++ ){
            var c = str.charCodeAt(i);
            if(
                ( 48 <= c && c <= 57 )
             || ( 65 <= c && c <= 90 )
             || ( 97 <= c && c <= 122 )
            ){
            }else{
                return false;
            }
        }
        return true;
    },
    regZipcode: function( str )
    {
        return str.match(/^\d\d\d-\d\d\d\d$/);
    },
    regTelno: function( str )
    {
        if(( str.substring( 0, 1 ) == '0' ) && ( str.substring( 2, 1 ) == '0' )){
            return str.match(/^0[0-9]0-\d{4}-\d{4}$/);
        }else{
            return str.match(/^\d{2,5}-\d{1,4}-\d{4}$/);
        }
    },
    regLength: function( str, min, max )
    {
        return (( str.length >= min ) && ( str.length <= max )) ? true : false;
    }
}
var util = new Glue_util();
