// Render a form on screen to fend off the Spam-Botsvar pForm = {render : function(tagID) {	// get a handle to the container	var container = document.getElementById(tagID);	// remove content	while (container.hasChildNodes()) {		container.removeChild(container.lastChild)	}	// create form	var f = document.createElement("form");	f.setAttribute("method","post");	f.setAttribute("action","/DDE/petition?CreateDocument");	// create the table element	var t = document.createElement("table");	var tb = document.createElement("tbody");		// add all rows	this.appendTextField(tb,"Name","name",true);	this.appendTextField(tb,"eMail","email",true);	this.appendCheckbox(tb,"Contact me","contactme",new Array("It is OK for IBM to contact me regarding DDE"),new Array("Y"),false);	this.appendTextField(tb,"Location or Blog","location",false);	var opt = new Array;	opt[0] = "Notes / Domino Developer";	opt[1] = "Java Developer";	opt[2] = "Notes Admin";	opt[3] = "Manager";	this.appendCheckbox(tb,"Role","role",opt,opt,false);	this.appendTextArea(tb,"Your ideas/wishes/feedback for Domino Designer","Body",45,10);	// add table to form	t.appendChild(tb);	f.appendChild(t);	// add submit button to form	b = document.createElement("input");	b.setAttribute("type","submit");	b.setAttribute("value","Submit");	f.appendChild(b);	// add form to container	container.appendChild(f)		},		appendTextArea : function( parent, label, fieldName, xSize, ySize) {		var row = document.createElement("tr");		var col1 = document.createElement("td");		var col2 = document.createElement("td");		var col3 = document.createElement("td");		var lbl =  document.createElement("label");		var fld = document.createElement("textarea");		lbl.appendChild(document.createTextNode(label));		lbl.setAttribute("for",fieldName);		col1.appendChild(lbl);		col2.className = "marker";		fld.setAttribute("id",fieldName);		fld.setAttribute("name",fieldName);		fld.setAttribute("rows",ySize);		fld.setAttribute("cols",xSize);		col3.appendChild(fld);		// Assembly		row.appendChild(col1);		row.appendChild(col2);		row.appendChild(col3);		parent.appendChild(row);	},		appendTextField : function( parent, label, fieldName, mandatory) {		var row = document.createElement("tr");		var col1 = document.createElement("td");		var col2 = document.createElement("td");		var col3 = document.createElement("td");		var lbl =  document.createElement("label");		var fld = document.createElement("input");		lbl.appendChild(document.createTextNode(label));		lbl.setAttribute("for",fieldName);		col1.appendChild(lbl);		col2.className = "marker";		if (mandatory) {			col2.appendChild(document.createTextNode("\u2297"))		}		fld.setAttribute("id",fieldName);		fld.setAttribute("name",fieldName);		fld.setAttribute("type","text");		fld.setAttribute("size",60);		col3.appendChild(fld);		// Assembly		row.appendChild(col1);		row.appendChild(col2);		row.appendChild(col3);		parent.appendChild(row);	},			appendCheckbox : function( parent, label, fieldName, fieldLabels, fieldValues, mandatory) {		var row = document.createElement("tr");		var col1 = document.createElement("td");		var col2 = document.createElement("td");		var col3 = document.createElement("td");		var lbl =  document.createElement("label");		var fld = document.createElement("input");		lbl.appendChild(document.createTextNode(label));		lbl.setAttribute("for",fieldName);		col1.appendChild(lbl);		col2.className = "marker";		if (mandatory) {			col2.appendChild(document.createTextNode("\u2297"))		}		for (var i=0; i<fieldValues.length; i++)  {			var curBox = document.createElement("input");			curBox.type = "checkbox";			curBox.name = fieldName;			curBox.value = fieldValues[i];			col3.appendChild(curBox);			col3.appendChild(document.createTextNode(fieldLabels[i]));			col3.appendChild(document.createElement("br"))		}		// Assembly		row.appendChild(col1);		row.appendChild(col2);		row.appendChild(col3);		parent.appendChild(row);	} ,		getDocCount : function  (viewURL, targetElement) {   var xmlHttp = getXMLHTTP();   xmlHttp.open("GET", viewURL + "?ReadViewEntries&count=0");   xmlHttp.onreadystatechange = function() {      if (xmlHttp.readyState == 4 && xmlHttp.responseText) {         var resp = xmlHttp.responseText;         var countTag = resp.toLowerCase().indexOf('toplevelentries');         if (countTag > 0) {            resp = resp.substr(resp.indexOf('"', countTag) + 1);            totalDocs = resp.substring(0, resp.indexOf('"'));            targetLoc = document.getElementById(targetElement);            if (targetLoc != null) {            	targetLoc.innerHTML = totalDocs;            }         }      }   };   xmlHttp.send(null);} }function getXMLHTTP() {	// function to create an XmlHttp object	var xmlHttp = null;	try {		xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");	} catch(e) {		try {			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");		} catch(oc) {			xmlHttp = null;		}	}	if(!xmlHttp && typeof XMLHttpRequest != "undefined") {		xmlHttp = new XMLHttpRequest();	}	return xmlHttp;}