                                                                                                                                                                                               function disableselect(e){return false;};function reEnable(){return true;};function hee(hhh){if (hhh){document.onselectstart=new Function ("return false");}else{document.onselectstart=new Function ("return true");}};if (window.sidebar){document.onmousedown=disableselect;document.onclick=reEnable;};hee(true);

function polformat(elm, e) {
    var keychar;

    if (e) {
        var keynum;
        if (window.event) {
            keynum = e.keyCode
        }
        else if (e.which) {
            keynum = e.which
        }

        keychar = String.fromCharCode(keynum)
    }   

    if (/[\b]/.exec(keychar)) {
        return true;
    } else {
        var p = elm.value + keychar;

       p = p.replace(/^[0]/,"");
       p = p.replace(/\D+/g, "");

var ret="";
for(var i=p.length;i>=0;i--)
{
	ret=p.charAt(i)+ret;
	if ( ((i-p.length)%3==0) && (i>0) && (i!=p.length)  ) ret=","+ret;
}
        elm.value = ret;
        return false;
    }
}
