function MonPlanning() { var From=null; var RoomsTable = new Array(); this.inPlaceEdit_Blur = function(){ var parentTD = this.parentNode; var xval = this.value; var re = new RegExp("(^\[0-9]{1,6}$)"); if((xval == "")){ parentTD.style.background=''; if(parentTD.className.match('pEdited')!=null) parentTD.className = parentTD.className.replace(" pEdited",""); parentTD.removeChild(this); parentTD.innerHTML = xval; parentTD.title = ''; parentTD.headers = ''; } else if(!xval.match(re)){ parentTD.style.background=''; if(parentTD.className.match('pEdited')!=null) parentTD.className = parentTD.className.replace(" pEdited",""); parentTD.removeChild(this); parentTD.title = ''; parentTD.headers = ''; alert('Value must be numeric.'); this.inPlaceEdit_DblClick(parentTD); } else{ parentTD.style.background=''; if(parentTD.className.match('pEdited')==null) parentTD.className = parentTD.className+' pEdited'; parentTD.removeChild(this); parentTD.innerHTML = xval; } }; this.inPlaceEdit_DblClick = function(ele){ if( typeof(ele.getElementsByTagName('input')[0]) == 'undefined'){ ele.style.background='#ff3366'; var Inp = document.createElement('input'); Inp.style.width = '100%'; Inp.style.border = '1px'; Inp.style.overflow = 'hidden'; Inp.style.padding = '0px'; Inp.style.margin = '0px'; Inp.style.fontSize = '10px'; Inp.style.fontWeight = 'bold'; Inp.value = (ele.innerHTML); ele.innerHTML = ''; ele.appendChild(Inp); Inp.focus(); Event.observe(Inp, 'blur', MonPlanning.inPlaceEdit_Blur.bind(Inp)); } }; }