// Render a form on screen to fend off the Spam-Botsvar pForm = {action : "alert('hallo')",OderFormID : "null",CourseSubject : "null",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",this.action);	f.setAttribute("id","OrderForm");	f.onSubmit = "return rememberMe(this)";	f.appendChild(document.createTextNode("Please fill in the following information completely and accurately. We cannot entertain requests that are incomplete or missleading.  Required fields are marked \u2297"));		// create the table element	var t = document.createElement("table");	var tb = document.createElement("tbody");		// add all rows	this.appendTextField(tb,"Your Name","ClientName",true);	this.appendTextField(tb,"Your Company","ClientCompany",true);	this.appendTextField(tb,"Company's website","ClientWebSite",false);	this.appendTextField(tb,"Your eMail","ClientEmail",true,"Please understand that we do not reply to webbased anonymous emails like Hotmail or Yahoo unless we can verify your company information.");	this.appendTextField(tb,"Your phone number","ClientPhone",true);	this.appendTextField(tb,"Your fax number","ClientFax",false);	this.appendTextArea(tb,"Your address","ClientAddress",36,4);		var opt = new Array;	opt[0] = "eMail";	opt[1] = "Fax";	opt[2] = "Phone";	opt[3] = "Paper";	var opt2 = new Array;	opt2[0] = "by eMail";	opt2[1] = "by Fax";	opt2[2] = "by Phone";	opt2[3] = "by Paper Mail";	this.appendCheckbox(tb,"How to contact you","ContactOption",opt2,opt,false);	this.appendTextArea(tb,"Your message","Body",45,10,"Please send me more information about: "+this.CourseSubject);	// add submit button to form	b = document.createElement("input");	b.setAttribute("type","submit");	b.setAttribute("value","Submit");	var sbr = document.createElement("tr"); 	var sbc = document.createElement("td");	sbc.appendChild(b);	sbr.appendChild(document.createElement("td"));	sbr.appendChild(document.createElement("td"));	sbr.appendChild(sbc);	tb.appendChild(sbr);	// add table to form	t.appendChild(tb);	f.appendChild(t);		// add form to container	container.appendChild(f);			// Set values	f.ClientName.value = getCookie("tcintcn");	f.ClientCompany.value = getCookie("tcintcc");	f.ClientWebSite.value = getCookie("tcintcw");	f.ClientEmail.value = getCookie("tcintce");	f.ClientPhone.value = getCookie("tcintcp");	f.ClientFax.value = getCookie("tcintcf");	f.ClientAddress.value = getCookie("tcintca")			},		appendTextArea : function( parent, label, fieldName, xSize, ySize, content) {		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);		if (content) {		fld.appendChild(document.createTextNode(content));		}		col3.appendChild(fld);		// Assembly		row.appendChild(col1);		row.appendChild(col2);		row.appendChild(col3);		parent.appendChild(row);	},		appendTextField : function( parent, label, fieldName, mandatory, remark) {		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);		if (remark) {			col3.appendChild(document.createElement("br"));			rspan = document.createElement("span");			rspan.setAttribute("class","remark");			rspan.className = "remark";			rspan.appendChild(document.createTextNode(remark));			col3.appendChild(rspan);		}		// 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;}