var doc = document.forms[0];var light;Event.observe(window, 'load', function() { light = new lightbox(); });function showsystemworking(whattext) {	light.activate(whattext);}function hidesystemworking() {	light.deactivate()}function myprintln(s) { document.writeln(s); }function sortvids() {	var tags = ['object', 'embed', 'applet'];	for( i=0; i<tags.length; i++ ) {		var elements = document.getElementsByTagName(tags[i]);		for(j=0; j<elements.length; j++)			elements[j].outerHTML = elements[j].outerHTML	}};function noenter() { return !(window.event && window.event.keyCode == 13); }function feedback(menu, form) {	menu = (menu=="") ? '' : "&menu=" + menu	form = (form=="") ? '' : "&form=" + form	opener = '/feedback?openform&host=' + window.location.host + "&onpage=" + window.location.href	try {opener += "&fromdocid=" + document.forms[0].docid.value} catch(x) {}	newwindow = window.open(opener, 'feedback','menubar=no, titlebar=no, toolbar=no, status=yes,width=650,height=520,top=200,left=300', true);	if (window.focus) {newwindow.focus()}}function submitmeanon() {	var needToConfirm = false;	document.forms[0].Save.click();}function submitme(which, theform) {	showsystemworking()	if (theform==null) theform=0	if (which != null) { try { document.forms[theform].which.value = which } catch(x) {} }	document.forms[theform].submit();}function validateandsubmit() {	if (!currform.validate()) return false;	doc = document.forms[0]	s = $('submitter')	s.innerHTML="Submitting ...."	s.disabled=true;	s.className+=" disabled"	doc.submit()}function showloginform() {	sRet ="<form id=loginhdr name=\"_login\" onSubmit=\"loginObj.login($('loginhdr')); return false;\""	sRet += "<label for=username>Email </label><input type=text name=username id=username value=\"\" maxlength=256 onkeypress=\"entsub(event,null,this.form.submit);\"> "	sRet += "<label for=password>Password </label><input type=password name=password id=password value=\"\" maxlength=256  onkeypress=\"entsub(event,null,this.form.submit);\"> "	sRet += "<span id=processing style=display:none><img src=\"/loading.gif\" width=18></span>"	sRet += "<span class=button><button type=submit value=\"login\">Login &raquo;</button></span>"	var ni = document.getElementById('loginform');	var newdiv = document.createElement('div');/*	var divIdName = 'searchformin'	newdiv.setAttribute('id',divIdName);*/	newdiv.innerHTML = sRet;	ni.appendChild(newdiv);}function entsub(e, myform, dowhat) {	var e=(e)?e:event; var c=(e.which)?e.which:e.keyCode;	if(c!=13) {return true} else {if(dowhat!=undefined) {eval(dowhat)} else {submitme()} };}// number formatting function.  copyright Stephen Chapman 24th March 2006.  http://javascript.about.com/library/blnumfmt.htmfunction formatNumber(num,dec,thou,pnt,curr1,curr2,n1,n2) {	// relies on prototype.js for gsub function to remove , from number incoming.    formatNumber(mynum,2,',','.','','','','')	var x = Math.round(num.toString().gsub(",","") * Math.pow(10,dec));if (x >= 0) n1=n2='';var y = (''+Math.abs(x)).split('');var z = y.length - dec;y.splice(z, 0, pnt);while (z > 3) {z-=3; y.splice(z,0,thou);} var r = curr1+n1+y.join('')+n2+curr2; return r;}function togglemenu(menuname, itemname) {alert('hey, togglmenu is still being called with ' + menuname + " and " + itemname)}function subpop(url, width, height,rs,sb) {	newwindow = window.open(url,'printpreview','menubar=no,titlebar=no,scrollbars=' + ((sb==null) ? 0 : sb) + ',toolbar=no,resizable=' + ((rs==null) ? 0 : rs) + ',status=yes,width=' + ((width==null) ? 600 : width) + ',height=' + ((height==null) ? 500 : height) + ',top=20,left=50', true);	if (window.focus) {newwindow.focus()}}function showdebug() {	day = new Date();	id = day.getTime();	eval("popup" + id + " = window.open('/info/debug', '" + id + "', 'toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,width=500,height=500,left = 287,top = 364');");}function cancel(thechar) {	if (thechar==null) thechar="&"	if (confirm("Click OK to lose any changes you have made")) window.location.href = window.location.href.split(thechar)[0]}function customHandler(desc,page,line,chr)  {alert(  'JavaScript error occurred! \n' +'While every effort was made to test this site in a variety of browsers on a variety of platforms, it seems something still went wrong.\nBrowsers that have been tested include MS Internet Explorer 6+ and Mozilla Firefox 1.5+ \n '  +'\nError description: \t'+desc +'\nPage address:      \t'+page +'\nLine number:       \t'+line) return true}//window.onerror = customHandler; function opendoc(noteid) {	if (noteid.indexOf("!") > 0) {		window.location.href = "/" + noteid	} else	{		window.location.href = "/0/" + noteid	}}function tableruler() { if (document.getElementById && document.createTextNode) {  var tables=document.getElementsByTagName('table');  for (var i=0;i<tables.length;i++) {   if(tables[i].className=='grid') {    var trs=tables[i].getElementsByTagName('tr');    for(var j=0;j<trs.length;j++) {     if(trs[j].parentNode.nodeName=='TBODY'  && trs[j].className != 'header' && trs[j].className != 'header1' && trs[j].className != 'colheader' && trs[j].className != 'subheadernoclick') {      if (trs[j].className=='subheader') {       trs[j].onmouseover=function(){ this.className='subheader_dn'; return false}       trs[j].onmouseout=function(){this.className='subheader';return false}      } else {//       if (j % 2 == 0) jscss('add', trs[j], 'alternate')       if (j % 2 == 0) trs[j].style.backgroundColor = "#ECF4F9"//       trs[j].onmouseover=function(){ jscss('add', this, 'ruled'); return false}//       trs[j].onmouseout=function(){ jscss('remove', this, 'ruled'); return false}       trs[j].onmouseover=function(){ this.bg = this.style.backgroundColor; this.style.backgroundColor="silver"; return false}       trs[j].onmouseout=function(){ this.style.backgroundColor = this.bg; return false}      }     }    }   }  } }}/* from http://www.onlinetools.org/articles/unobtrusivejavascript/cssjsseparation.htmla -defines the action you want the function to perform. o -the object in question. c1-the name of the first class. c2 -the name of the second class Possible actions are:swap -replaces class c1 with class c2 in object o. 				add -adds class c1 to the object o.remove -removes class c1 from the object o.    					check -test if class c1 is already applied to object o and returns true or false. */function jscss(a, o, c1, c2) {	switch (a){		case 'swap':			o.className=!jscss('check',o,c1)?o.className.replace(c2,c1) : o.className.replace(c1,c2);			break;		case 'add':			if(!jscss('check',o,c1)){o.className+=o.className?' '+c1:c1;}			break;		case 'remove':			var rep=o.className.match(' '+c1)?' '+c1:c1;			o.className=o.className.replace(rep,'');			break;		case 'check':			return new RegExp('\\b'+c1+'\\b').test(o.className)			break;	}}function MM_preloadImages() { //v3.0  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}function toggle(obj) {	var el = document.getElementById(obj);	if ( el.style.display != 'none' ) {		el.style.display = 'none';	}	else {		el.style.display = '';	}}function getElementsByClassName(searchClass,node,tag) {	var classElements = new Array();	if ( node == null )		node = document;	if ( tag == null )		tag = '*';	var els = node.getElementsByTagName(tag);	var elsLen = els.length;	var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)');	for (i = 0, j = 0; i < elsLen; i++) {		if ( pattern.test(els[i].className) ) {			classElements[j] = els[i];			j++;		}	}	return classElements;}function getradioval(theform, fieldname) {	return Form.getInputs(theform,'radio',fieldname).find(function(radio) { return radio.checked; }).value}// this is used in cases where getradioval produces an error (e.g. FF2)function getradioval2(fieldname) {	var selection = document.getElementsByName(fieldname)	for (i=0; i<selection.length; i++) {		if (selection[i].checked == true)	return selection[i].value	}}// Remove all occurrences of a token in a string s string to be processed t  token to be removed returns new stringfunction remove(s, t) {	i = s.indexOf(t);	r = "";	if (i == -1) return s;	r += s.substring(0,i) + remove(s.substring(i + t.length), t);	return r;}function checkerroronload() {	try { 	   if(doc.errorfield != undefined) {throw true} else {throw false}	}	catch(haserrorfield) {		try {		if(haserrorfield) {			haserror = doc.errorfield.value			if (haserror=="") return;			badfield = document.getElementById(haserror)			badfield.className = 'errorfield'			badfield.style.border ="2px solid red"			badfield.focus()		}		} catch(x) {}	}}function topostcode(what) {	return what.gsub(" ","").toUpperCase()}// This Javascript object is used to check to see if a user has entered there correct Domino credientialsvar loginObj={	login : function(theform, url){															//Main function		var theform = (theform!=undefined) ? theform : document.forms['loginhdr'];		var inputs = theform.getInputs()		var username = inputs[0].value;														//Get the field values		var password = inputs[1].value;		if (username=='') {			alert('You must enter an email address');			inputs[0].focus()			return false;		}		if (password=='') {			alert('You must enter your password');			inputs[1].focus()			return false;		}	Element.show('processing');														//Display busy animation	var urlwatch = 'http://'+location.hostname +'/names.nsf?login';	var pars="Username="+encodeURIComponent(username)+"&Password="+encodeURIComponent(password);	//Encode the parameters	var myAjax = new Ajax.Request( urlwatch, { method: 'post', parameters: pars, onComplete: this.processResponse.bindAsEventListener(this, url) });	},	processResponse: function(originalRequest, url){		test=originalRequest.responseText.indexOf("invalid username or password");				//Check response to see if the error message is in the string		if(test==-1){			window.location.href = (url) ? url : window.location.href			return false;		} else {			alert('Incorrect username or password');									//Got a login error so alert the user and reset the login form			this.resetLogin();			return false;		}	},	resetLogin:function(){		Element.hide('processing');		//Form.reset('_login');	}}var usr;var pw;//var sv;function getme() {	var doc = document.forms['loginhdr'];	usr = doc.username;	pw = doc.password;	if (GetCookie('username') != null) {		usr.value = GetCookie('username')		pw.value = GetCookie('password')	}}function getCookieVal (offset) {  var endstr = document.cookie.indexOf (";", offset)  if (endstr == -1) endstr = document.cookie.length  return unescape(document.cookie.substring(offset, endstr))}function GetCookie (name) {  var arg = name + "=";  var alen = arg.length;  var clen = document.cookie.length;  var i = 0;  while (i < clen) {    var j = i + alen;    if (document.cookie.substring(i, j) == arg) return getCookieVal (j)    i = document.cookie.indexOf(" ", i) + 1;    if (i == 0) break;   }  return null;}function SetCookie (name,value,expires,path,domain,secure) {	document.cookie = name + "=" + escape (value) + 	((expires) ? "; expires=" + expires.toGMTString() : "") +	((path) ? "; path=" + path : "") +	((domain) ? "; domain=" + domain : "") +	((secure) ? "; secure" : "");}function DeleteCookie (name,path,domain) {	if (GetCookie(name)) {		document.cookie = name + "=" +		((path) ? "; path=" + path : "") +		((domain) ? "; domain=" + domain : "") +		"; expires=Thu, 01-Jan-70 00:00:01 GMT";	}}function hidehelp(which) {	var url = '/(hidehelp)!openagent'	var a=$H(	{			userunid : currentuserunid,			something : new Date().getTime(),			which : which			} );     var myAjax = new Ajax.Request(url, {method: 'get', 	parameters: a.toQueryString(), 	onComplete: doresponse});}function doresponse(originalRequest) { $("headerhelp").hide() }function barf(err){  alert(err);   return;  }
