﻿<!--
// JScript File
function parentID(ctrID){return new String(ctrID).replace(/(.*)_.*/, function re($0, $1){return $1;});}
function padLeft(str, len, chr){while(str.length <len){str = chr + str;} return str;}
function padRight(str, len, chr){while(str.length <len){str = str + chr;} return str;}




function eid(obj){return document.getElementById(obj);};

function a(msg) {alert(msg);}
//input.value = new String(input.value).replace(/\D/g, "");
function timeentry_OnEnter(input)
{
    input.select();
}
function timeentry_OnBlur(input)
{
    var val = input.value
    if (val != null)
    {
        val = new String(val).replace(/(\d{1,2})(\W{0,1})(\d{0,2})/g,function ($0, $1, $2, $3){return padLeft($1,2,"0") + ($2==":"?":":":") + padRight($3, 2, "0");});
        input.value = val
    }
}
function timeentry_isValid(input)
{
    if(input.value=="")
    {
        return true;
    }
    var valid = (new String(input.value).replace(/(\d{1,2})(\W{0,1})(\d{0,2})/g, function re($0,$1,$2,$3){return (($1<24 && $3 <60))})=="true");if (!valid){alert("Invalid time : " + input.value);}
    return valid;
}

// allows strongly typed javascript function overloads !!
// var yourFunction = new Overloader();
// yourFunction.overLoad(function(x,y){...;},typeOfx, typeOfy);
Overloader = function(){ //v1.0
    var f = function(args){
	    var i, h = "#";
	    for(i in args = [].slice.call(arguments))
		    h += args[i].constructor;

	    if(!(h = f._methods[h])){
		    var x, j, k, m = -1;
		    for(i in f._methods){
			    for(j in args.length > (k = 0, x = f._methods[i][1]).length ? x : args)
				    (args[j] instanceof x[j] || args[j].constructor == x[j]) && ++k;
			    k > m && (h = f._methods[i], m = k);
		    }
	    }
	    return h ? h[0].apply(f, args) : undefined;
    };
    f._methods = {};

    f.overLoad = function(f, args){this._methods["#" + (args = [].slice.call(arguments, 1)).join("")] = [f, args];};
    f.unoverLoad = function(args){return delete this._methods["#" + [].slice.call(arguments).join("")];};

    return f;
};


function disableBtn(btnID) 
	{
		var btn = document.getElementById(btnID);
		//btn.disabled = true;
        btn.style.display = 'none';

}


-->


