// I know this part is dirty, yet it is needed to check for the visibility tag in different browsers.var explorer;var netscape4;var netscape6;var theDOM, theSuffix, hiddenKeyword, dhtml;if (document.all) {explorer = true;}else if (document.layers) {netscape4 = true;} else {netscape6 = true;}if(explorer){   theDOM = 'document.all';   theSuffix = '.style';   hiddenKeyword = 'hidden';   dhtml = true;}if(netscape4){   theDOM = 'document';   theSuffix = '';   hiddenKeyword = 'hide';   dhtml = true;}if (netscape6) {  theDOM = "document.getElementsByTagName('*')";  theSuffix = ".style";  hiddenKeyword = "hidden";  dhtml = true;}function CheckRequiredFields(f) {   var sFieldValue = "";   var iIndex = 0;   var iElement = 0;   var iRadio = 0;   var iCheck = 0;      // Retrieve the list of field names and labels   var aFieldList = f.valFieldList.value.split(",");      // Loop through the list of fields   for (iIndex = 0; iIndex < aFieldList.length; iIndex++) {            // Inform the user of what's happening      window.status = "Validating field " + aFieldList[iIndex + 1] + " ...";            // Loop through all elements in the form to find the field      for (iElement = 0; iElement < f.elements.length; iElement++) {         // Check whether the selected element is a required field         if (f.elements[iElement].name == aFieldList[iIndex]) {            // Check whether the field contains a value or not            switch (f.elements[iElement].type) {               // Text fields               case "text" :                  sFieldValue = f.elements[iElement].value;                  break;               // Text areas               case "textarea" :                  sFieldValue = f.elements[iElement].value;                  break;               // Listboxes               case "select-one" :                  if (f.elements[iElement].selectedIndex == 0) {                     sFieldValue = "";                  } else {                     sFieldValue = String(f.elements[iElement].selectedIndex);                  }                  break;               // Checkboxes               case "checkbox" :                  for (iCheck = 0; iCheck < f.elements[aFieldList[iIndex]].length; iCheck++) {                     if (f.elements[iElement + iCheck].checked == false) {                        sFieldValue = "";                     } else {                        sFieldValue = String(f.elements[iElement + iCheck].value);                        break;                     }                  }                  break;               // Radiobuttons               case "radio" :                  for (iRadio = 0; iRadio < f.elements[aFieldList[iIndex]].length; iRadio++) {                     if (f.elements[iElement + iRadio].checked == false) {                        sFieldValue = "";                     } else {                        sFieldValue = String(f.elements[iElement + iRadio].value);                        break;                     }                  }                  break;            }            // Warn the user that the selected field is a required field            if (sFieldValue == "") {               alert(aFieldList[iIndex+1] + " is a required field. Make sure that " +               aFieldList[iIndex+1] + " and all other required fields are filled out before saving the document.");               f.elements[iElement].focus();               return false;            }            break;         }      }      iIndex++;   }   return true;}function QuerySave(f){return CheckRequiredFields(f);}function insertEmoticon(number){	//insert emoticon in comments field	var current = document.frmWComment.comBody.value;	this.number = number;	document.frmWComment.comBody.value = current + " !em" + number + "! ";	document.frmWComment.comBody.focus();}// this function is to make the drop-down menu work in IEstartList = function() {	if (document.all&&document.getElementById) {		navRoot = document.getElementById("menu");		if (navRoot!=null) {		for (i=0; i<navRoot.childNodes.length; i++) {			node = navRoot.childNodes[i];			if (node.nodeName=="LI") {				node.onmouseover=function() {					this.className+=" over";				}				node.onmouseout=function() {					this.className=this.className.replace(" over", "");				}			}		}	}	}}window.onload=startList;// function to load an email address, gives basic protecting from spammers. Provided by codestore.netfunction mailto(name, domain) {  location.href = "mailto:" + name + "@" + domain; } function writeSearchResults(){      for(var i=0;i<a.length;i++){       document.write(a[i] + "\n");    }}	function getDisplay(theObject){	var theObjectReference = eval(theDOM + '.' + theObject + theSuffix);	if(theObjectReference.visibility == hiddenKeyword){     	return false;    	} else {		return true;		}	}	function hideObject(theObject){	var theObjectReference = eval(theDOM + '.' + theObject + theSuffix);	theObjectReference.visibility = hiddenKeyword;	}function loadHash() {	// generate random number in our battle to fight comment spam	return ran_number=Math.floor(Math.random()*1000);}function maxArray( arr ) {	// this function calculates the maximum value in the associative array	var max = 0;	for(var i in arr){  	    if (arr[i] > max)  	    		max = arr[i];  	}  	return max;}function minArray( arr ) {	// this function calculates the minimum value in the associative array	var min;	var count = 0;	for(var i in arr){		// initialize minimum value with first value of associative array		if (count==0)			min = arr[i];		if (arr[i] < min)  	    		min = arr[i];  	    	count++;  	}  	return min;}function drawTagCloud(map, maxStyle) {	// this function draws the tag cloud using the associative javascript array generated by the Notes view	// calculate the maximum entries in the cloud. if not found, no tags are found	var maxEntries = maxArray(map);	if (maxEntries==0) {		document.write('No tags found');		return false;	}		//	calculate the minimum entries in the cloud	var minEntries = minArray(map);		// calculate the range	var range = maxEntries - minEntries;	if (range <= 0)		range = 1; 		// get handle on div container to write tag cloud into	var tagcloud = document.getElementById('tagcloud');		// temp variable to store all tags in 	var tagsresult = '';		// loop through the tag map to draw each tag.	for(var tag in map){		tagsresult = tagsresult + calculateTag(tag, map[tag], minEntries, maxEntries, maxStyle);  	}  	  	// finally, write the full tags result to the inner html of the tagcloud div  	tagcloud.innerHTML = tagsresult;	var tagcloud = document.getElementById('tagcloud');  	tagcloud.style.innerHTML = "width:200px;"  	}function calculateTag(tag, count, min, max, maxStyle) {  // this function renders a tag line. first determine  // the size tag to use for this tag count  sizeTag = Math.round((((maxStyle-1)/(max-min))*count) +(1*max-maxStyle*min)/(max-min));    // return link to write to page  return '&nbsp;<a href="categories?open&id=' + tag + '" class="tag' + sizeTag + '">' + tag + ' </a>&nbsp;';}