function insertActionButton(ob,lab,fun){//	var ob = tob.appendChild(nDOMObj(null,"td","","","","","TCG","",lab));	ob.innerHTML =lab	ob.setAttribute("className","TCG");	ob.style.verticalAlign = "middle"	ob.style.textAlign = "right"		ob.style.height = 40;	ob.style.color = "#7BA5B9"	ob.style.backgroundImage = "url(/" + dbname + "/OSAction.gif)"	ob.style.backgroundRepeat = "no-repeat"	ob.style.backgroundPosition = "center right"	ob.style.paddingRight = "30px"	newEvent(ob,"onmouseover","this.style.color='#FF6600'")	newEvent(ob,"onmouseout","this.style.color='#7BA5B9'")  	newEvent(ob,"onclick",fun)	return(ob)}var bdr = "1px solid #AAAAAA"function newTable(mob,lab,tlst,nrws,obf,bd){	var lst ="tr/tbody/colgroup/table".split("/")	tlst.push(8);		tlst.unshift(8)	var smp = true		var alst =new Array()	for (var i=0 ; i<lst.length;i++){		alst[i]= document.createElement(lst[i]);		switch (lst[i]){			case "tbody":				alst[i].appendChild(alst[i-1]) ;				break;							case "table":				alst[i].cellPadding = 0 				alst[i].cellSpacing = 0 				alst[i].border = 0				alst[i].style.verticalAlign="top" 								alst[i].align = "center" 				alst[i].appendChild(alst[i-1]) ;				alst[i].appendChild(alst[i-2]) ;								break;						case "colgroup":				alst[i].span = tlst.length ;				for (j=0; j<tlst.length;j++) alst[i].appendChild(nDOMObj(null,"col","","","","","",tlst[j]+ "px",""));				break;			case "tr"	:				var ob = alst[i].appendChild(nDOMObj(null,"TD","","","","","TCH",""," "));					var ob =  alst[i].appendChild(nDOMObj(null,"TD","","","","","TCH","",lab));					ob.style.fontSize = "18px"				ob.style.fontWeight= "bold"				ob.colSpan = tlst.length-2				var ob = alst[i].appendChild(nDOMObj(null,"TD","","","","","TCH",""," "));					break				}	}	mob.appendChild(alst[lst.length-1]);			for(i=1 ; i<=nrws;i++){			var row = alst[1].appendChild(nDOMObj(null,"TR","","","","","","",""));		var ob = row.appendChild(nDOMObj(null,"TD","","","","","TCI","","&nbsp;"));				ob.style.borderLeft = bdr; //1		if(i==0){			for (j=1; j<tlst.length;j++) var ob = row.appendChild(nDOMObj(null,"td","","","","","TCI",tlst[j],"&nbsp;"));			ob.style.borderRight = bdr		}else if (i== nrws){			ob.style.borderLeft  =bdr;			ob.style.borderBottom =  bdr;			var ob = row.appendChild(nDOMObj(null,"TD","","","","","TCI","","&nbsp;"));				if(obf(ob,i) != false){								ob.style.borderBottom =  bdr;				ob.colSpan = (tlst.length -2);						var ob = row.appendChild(nDOMObj(null,"TD","","","","","TCI","","&nbsp;"));		//4						ob.style.borderRight  =bdr;				ob.style.borderBottom =  bdr;			}else				alst[1].removeChild(row)		}else{			if(obf(row,i) != false){				var ob = row.appendChild(nDOMObj(null,"TD","","","","","TCI","","&nbsp;"));		//4					ob.style.borderRight =  bdr;			} else				alst[1].removeChild(row)		}	}	return (alst[1])}function newEvent(ob,nm,func){	if(document.all && document.getElementById){	  	ob[nm]=new Function(func);	}else		ob.setAttribute(nm,func)}function nDOMObj(ob,ta,ty,na,va,id,cls,w,ht){	if(ob== null) 	var ob =  document.createElement(ta);	if(id !="") ob.setAttribute("id",id);	if(na !="") ob.setAttribute("name",na);	if(ty !="") ob.setAttribute("type",ty);	if(va !="") ob.setAttribute("value",va);	if(cls!= undefined && cls !="") 		ob.className = cls;	if(cls!= undefined && cls !="") 		ob.setAttribute("className",cls);	if(w!= undefined && w!= "" )	ob.style.width = w//	if(ta == "td" || ta == "TD" ) ht = "1"	if(ht!= undefined &&  ht !="") ob.innerHTML = ht	if(ta == "td" || ta == "TD" ) {			ob.style.border ="0px"			ob.style.verticalAlign="top"			ob.style.textAlign ="left"	}	return(ob)}var WI;var OSIt= new Array();var ct ;function OSItem(flab,fdesc,ftype,fm,mand,func,min,max)  {  	this.fLab = flab	this.fDesc = fdesc;	this.fType = ftype;	this.fFunc =  func	this.fMin =  min	this.fMax =  max	if(eval("fm." + flab ) != null){		switch(ftype) {		case 1: //txt				this.fValue = eval("fm." + flab + ".value")							break;					case 5: //rad //rad  at this stage we do not want to track changes			var fld = eval("fm." + flab)			if( fld != null) {				for (i=0;  i< fld.length; i++)	if(fld[i].checked ) this.fValue = i;			}			break;		}		this.fMand = mand;		}	}function OSValidate(fm){	var res = "" ;	var lim	var itm;	var j;	var fld;	for (var i=0 ; i<OSIt.length ; ++i) {		res = false		fld = eval("fm." + OSIt[i].fLab)		if(fld != null) { // don't check fields that are not on the form				fld.value = trim(fld.value)					switch(OSIt[i].fType) {				case 1:  //txt					res =  fld.value == "" ? false : true					res =  !res ||  (fld.value.indexOf("...") > 5 && OSIt[i].fValue.indexOf("...") > 5) ? false : true					break;						case 4:  //txt blur					res =  fld.value == "" ? false : true					break;								case 2: //date					res =  fld.value == "" ? false : true					if(checkdate(fld,OSIt[i].fDesc ) == false ) return false;					if(  OSIt[i].fFunc != null &&  ! eval(OSIt[i].fFunc + "(" + "fm." + OSIt[i].fLab + ")") )return false						break									case 3: //number										res =  fld.value == "" ? false : true					if(checkNumber(fld,OSIt[i].fDesc ) == false ) return false;						if( fld.value != "" && typeof OSIt[i].fMin == "number"  && typeof OSIt[i].fMax == "number"  && 						(fld.value < OSIt[i].fMin ||  fld.value> OSIt[i].fMax)){						alert(OSIt[i].fDesc + " must be in the range " + OSIt[i].fMin  + " to "  + OSIt[i].fMax)						return false											}										break;									case 5: //rad and check					if(isUndefined(fld.checked)) {						for (j=0;  j< fld.length; j++)	{							if(fld[j].checked ) {								res = true;								itm = j;										if(  OSIt[i].fFunc != null &&  ! eval(OSIt[i].fFunc + "(" + itm + ")") )return false								}						}						fld=fld[0]					}else{						if(fld.checked ) {							res = true;							itm = j;									if(  OSIt[i].fFunc != null &&  ! eval(OSIt[i].fFunc + "(" + itm + ")") )return false							}					}											break;					case 6://combobox						if (fld.selectedIndex > 0) {						res = true;						break;								}else{						res = false;						break;					}				}				if(!res && OSIt[i].fMand) {					alert(OSIt[i].fDesc + " is a mandatory field")					try {					if(OSIt[i].fType != 5 && OSIt[i].fType != 4) 		fld.focus();					}catch(e){					}					return false				}		}	}		return true;}var validNumSet = new Array(".","0","1","2","3", "4" , "5", "6","7", "8","9","10") ;function navigateAway() {	//alert(document.forms[0].tmpUser.value) 	//document._DominoForm.__Click.value	if(document._DominoForm.__Click.value != "0" || document.forms[0].tmpState.value !="")  return ;	msg =  "-----------------------------------------------------------------------\n";	msg += "Your request form has not been completely saved.\n";	msg += "Some changes you have made may be lost\n";	msg += "-----------------------------------------------------------------------";	//inbuilt get-out: hold control key to bypass message;	if ( event.ctrlKey == false) event.returnValue = msg;}function checkNumber(objName,lab) {	inp=new String(objName.value);	for (var i=0 ; i<inp.length ; ++i) {		for (var j=0 ; j<validNumSet.length ; j++) {			if (inp.charAt(i) == validNumSet[j]) break ;		}		if (j == validNumSet.length) {			objName.select();			if(lab != "") {				alert("The number for " + lab + "  is invalid.  Please try again.");				objName.focus();			}else objName.value=""			return false;			}	}	return true ;}	// Removes leading whitespacesfunction LTrim( value ) {		var re = /\s*((\S+\s*)*)/;	return value.replace(re, "$1");	}// Removes ending whitespacesfunction RTrim( value ) {		var re = /((\s*\S+)*)\s*/;	return value.replace(re, "$1");	}// Removes leading and ending whitespacesfunction trim( value ) {		return LTrim(RTrim(value));	}