fixHeight=90var doc='';var sty='';var htm='';var is = new Is();var screen_width = screen.width;var screen_height = screen.height;var preventClear=false;var isNS4 = (navigator.appName=="Netscape")?1:0;var CLOSE_DIV = "<div class='errClose'><a href='javascript:hideShowDiv( \"errDiv\",false)'>Close X</a> </div>"function Is() {// Loads all possible parameters of the used browser and platform used  var agent = navigator.userAgent.toLowerCase();  this.major = parseInt(navigator.appVersion);  this.minor = parseFloat(navigator.appVersion);  //alert( navigator.userAgent );  //alert( navigator.appVersion );  this.ns = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));  this.ns2 = (this.ns && (this.major == 3));  this.ns3 = (this.ns && (this.major == 3));  this.ns4b = (this.ns && (this.minor < 4.04));  this.ns4 = (this.ns && (this.major >= 4));  this.ie = (agent.indexOf("msie") != -1);  this.ie3 = (this.ie && (this.major == 2));  this.ie4 = (this.ie && (this.major = 4));  this.ie5 = (this.ie && (this.major >= 5));  this.op3 = (agent.indexOf("opera") != -1);  this.win = (agent.indexOf("win")!=-1);  this.mac = (agent.indexOf("mac")!=-1);  this.unix = (agent.indexOf("x11")!=-1);  this.firefox = (agent.indexOf("firefox")!=-1);  this.safari = (agent.indexOf("safari")!=-1);// alert("Doing IS" + agent)// alert(this.safari)}function setDOM(){// this function loads the variables, to build up the DOM// layers and images are approached differently, depending on the type of browserif (is.safari || is.firefox) {  doc = "document.all";  sty = ".style";  htm = ".document";}else if(is.ns4) {  doc = "document";  sty = "";  htm = ".document"} else if(is.ie4) {  doc = "document.all";  sty = ".style";  htm = ""}else {  doc = "document.all";  sty = ".style";  htm = ".document"}}//<<<<<<<<<<<<<<<<<<<<<<function isEmailAddress >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>function isEmailAddress(email){  var result = false  var theStr = new String(email)  var index = theStr.indexOf("@");  if (index > 0)  {    var pindex = theStr.indexOf('.',index);    if ((pindex > index+1) && (theStr.length > pindex+1))	result = true;  }  return result;}//<<<<<<<<<<<<<<<<<<<<<<function isEmailAddress end>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>//<<<<<<<<<<<<<<<<<<<<<<function popupWindow >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>function popupWindow(the_page,the_width,the_height) {	window.open(the_page,"","status=no,menubar=no,scrollbars=yes,resizable=no,width=" + the_width + ",height=" + the_height);}//<<<<<<<<<<<<<<<<<<<<<<function popupWindow end>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>//<<<<<<<<<<<<<<<<<<<<<<function execSearch>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>function execSearch(view){	var form = document.forms[0];	var path = form.WebDbName.value;	var query = escape(form.Search[form.Search.selectedIndex].text);		urlReturn = '/' + path + '/' + view + '?SearchView&Query=' + '(' + query + ')';		location.href = urlReturn;}//<<<<<<<<<<<<<<<<<<<<<<function execSearch end>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>function hideShowDiv( identifier,show){	var thisLayer;	try {		var tmp = document.getElementById( identifier );		thisLayer = tmp.style;	}	catch (e) {		var toEval = doc + '["'+identifier+'"]'+sty;		thisLayer = eval(toEval);	}		try {		thisLayer.display = (!show) ? "none" : "block";	}	catch (e) {}}function hideShow( identifier,show){	thisLayer = eval(doc + '["'+identifier+'"]'+sty);	//thisLayer = document.getElementById(identifier);	if(!show)	{		thisLayer.visibility = 'hidden';		thisLayer.height = 1;	} else {		thisLayer.visibility = 'visible';		thisLayer.height=eval(doc+'["'+identifier+'"].scrollHeight');		//thisLayer.height=thisLayer.scrollHeight;	}}function removeForm() {	var frm0 = window.document.forms[0];	var frm1 = window.document.forms[1];	frm1.action 	= frm0.action;	frm1.name 	= frm0.name;	frm0.name		= "OLD";	frm1.method	= frm0.method;	frm1.target	= frm0.target;  	frm0.parentNode.removeChild(frm0);}function Left(str, n){	if (n <= 0)	    return "";	else if (n > String(str).length)	    return str;	else	    return String(str).substring(0,n);}function Right(str, n){    if (n <= 0)       return "";    else if (n > String(str).length)       return str;    else {       var iLen = String(str).length;       return String(str).substring(iLen, iLen - n);    }}function trim(aStr) {	return aStr.replace(/^\s{1,}/, "").replace(/\s{1,}$/, "")}//@Left equivalentfunction strLeft(sourceStr, keyStr){	return (sourceStr.indexOf(keyStr) == -1 | keyStr=='') ? '' : sourceStr.split(keyStr)[0];}//@Right equivalentfunction strRight(sourceStr, keyStr){	idx = sourceStr.indexOf(keyStr);	return (idx == -1 | keyStr=='') ? '' : sourceStr.substr(idx+ keyStr.length);}//@RightBack equivalentfunction rightBack(sourceStr, keyStr){	arr = sourceStr.split(keyStr);	return (sourceStr.indexOf(keyStr) == -1 | keyStr=='') ? '' : arr.pop()}//@LeftBack equivalentfunction leftBack(sourceStr, keyStr){	arr = sourceStr.split(keyStr)	arr.pop();	return (keyStr==null | keyStr=='') ? '' : arr.join(keyStr)}//@Middle equivalentfunction middle(sourceStr, keyStrLeft, keyStrRight){	return strLeft(strRight(sourceStr,keyStrLeft), keyStrRight);}function Querystring(qs) { // optionally pass a querystring to parse	this.params = new Object()	this.get=Querystring_get	if (qs == null) {		var theRef = unescape(location.href);		if (theRef.indexOf("!") > -1) 			qs = strRight(theRef, "!");		else			qs = location.search.substring(1,location.search.length);		}	if (qs.length == 0) return// Turn <plus> back to <space>// See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1	qs = qs.replace(/\+/g, ' ')	var args = qs.split('&') // parse out name/value pairs separated via &	// split out each name=value pair	for (var i=0;i<args.length;i++) {		var value;		var pair = args[i].split('=')		var name = unescape(pair[0])		if (pair.length == 2)			value = unescape(pair[1])		else			value = name		name = name.toLowerCase();//alert(name + ":" + value)				this.params[name] = value	}}function Querystring_get(key, default_) {	// This silly looking line changes UNDEFINED to NULL	if (default_ == null) default_ = null;	key = key.toLowerCase();	var value=this.params[key]	if (value==null) value=default_;		return value}/***********************************************************errorHandler()Used by Netscape to return the error message to the user.Best used only when debuggind in development. Turn on by adding the following line to a form:if (navigator.appName=="Netscape") window.onerror = errorHandler;***********************************************************/function errorHandler( e, f, l ) {	alert("Error\nFile: " + f + "\nLine: " + l + "\nError:" + e);	return true;}/***********************************************************doDelete is used to delete the from the serverThe user is first asked to confirm that this is what they want to do. Giving them the chance to cancel the action.This works SIMPLY by changing the end of the URL from "?OpenDocument" to "?DeleteDocument"************************************************************/function doDelete() {	if ( confirm('Are you sure you want to delete this document?') ){		location.search = "?DeleteDocument";	}}/***********************************************************trim is a simple function to remove leading/trailing spaces************************************************************/function trim(aStr) {	return aStr.replace(/^\s{1,}/, "").replace(/\s{1,}$/, "")}/***********************************************************following two functions call the date picking dialog box************************************************************/function myDateDialog(){	var retDay;	var retMonth;	var retYear;}function openDatePickerDialog(wnd, field, dateFormat) {	myDateDialog.retDay="";	myDateDialog.retMonth="";	myDateDialog.retYear="";	var pathname = window.location.pathname;	var dlgURL = pathname.substring(0,(pathname.lastIndexOf(".nsf") + 5))+'dlgDatePicker?OpenForm';	if(wnd.showModalDialog(dlgURL,myDateDialog,"dialogHeight:380px;dialogWidth:280px;center")==true){		field.value=dateFormat.replace(/yyyy/, myDateDialog.retYear).replace(/mm/, myDateDialog.retMonth).replace(/dd/, myDateDialog.retDay);	}else{		return;	}}function initForm(){//initializes DOM Objects in variables//sets all initial layers properlysetDOM()setSubDivsSimple('auto')}function initFormTabs(){//initializes DOM Objects in variables//sets all initial layers properlysetDOM()setTab(1)}function setTab(tabNr){//Sets background picture of the table cell //Re-sets the class of the hyperlink //aligns the appropiate div //hides the other divsthisLayer=eval(doc + '["content1"]'+sty);for (var i=1;i<totTabs+1;i++){	thisLayer=eval(doc + '["content"+i+""]'+sty);	//thisLink=eval(doc + '["text"+i+""]');	if(i==tabNr){		thisLayer.top=fixHeight		//document.getElementById("tab"+i+"").style.background = "url(/tab_active?openImageResource)";	//	thisLink.className="selectorActive"		thisLayer.visibility="visible"		//if(mode=='edit'){setSubDivs(i,'auto')}	//in edit mode we use the form containing these divs. Show hide-when layers when active tab		}	else{		thisLayer.top=fixHeight		thisLayer.visibility="hidden"		//document.getElementById("tab"+i+"").style.background = "url(/tab_inactive?openImageResource)"	//	thisLink.className="selectorInactive"		//if(mode=='edit'){setSubDivs(i,'off')}	//in edit mode we use the form containing these divs. Hide hide-when layers when not active tab		}	}}function setSubDivs(tab,show){//takes care of showing hide-whens, based on the active tab selectedswitch (tab){	case 1:								//tab 1		//hideWhen('Children','value','Children',show);		break;	case 2:								//tab2		break;	case 3:								//tab3		break;	case 4 :								//tab4		break;	default :								//nothing	}}function setSubDivsSimple(show){//takes care of showing hide-whenshideWhen('Children','value','Children',show);}function hideWhen(identifier,hwType,theField,show){//obj equals the field which we will check for values, dependant on the type of fieldobj=eval(doc+'["'+theField+'"]')switch (hwType){	case 'ynn':		//this means radio button, first value='yes'		thisLayer=eval(doc + '["div'+identifier+'"]'+sty);		//thisLayer.visibility='visible'		if(obj[0].checked){			//show DIV			if(show=='off'){				thisLayer.visibility='hidden'				thisLayer.height=1}			else{				thisLayer.visibility='visible'				thisLayer.height=eval(doc+'["div'+identifier+'"].scrollHeight')}			}		else{			//hide DIV			if(thisLayer.visibility=='visible' && !preventClear){clearDivFlds(identifier,hwType,1)}			thisLayer.visibility='hidden'			thisLayer.height=1			}		break;		case 'value' :		for (var options1=0;options1<obj.length;options1++){			if(obj[options1].value!=='N/A'){				thisLayer=eval(doc+'["div'+identifier+(options1+1)+'"]'+sty);				//thisLayer.visibility='visible'				if (obj[options1].checked){					if(show=='off'){						thisLayer.visibility='hidden'						thisLayer.height=1					}					else{						thisLayer.visibility='visible'						thisLayer.height=eval(doc+'["div'+identifier+(options1+1)+'"].scrollHeight')						}				}				else{					if(thisLayer.visibility=='visible' && !preventClear){clearDivFlds(identifier,hwType,options1+1)}					thisLayer.visibility='hidden'					thisLayer.height=1				}			}		}		break;						default :	}}function clearDivFlds(identifier,hwType,fldNr){//takes care of clearing fields which are in a hide-when div, when the related selecto field is reset//lkist of fields is derived from an HTML-Hidden field on the main formvar fieldList=new Array()if(hwType=='value'){	var fieldString=eval(doc + '["arr'+identifier+fldNr+'"].value');}else{		var fieldString=eval(doc + '["arr'+identifier+'"].value');}if(fieldString!=='*'){	fieldList=fieldString.split('; ');	totFields=fieldList.length	for (var i=0; i<totFields;i++){		fT=eval(doc+'.'+fieldList[i]+'.type')		switch(fT)		{			case 'select-one' :				eval(doc+'.'+fieldList[i]+'.options[0].selected=true')				break;			default :				eval(doc+'.'+fieldList[i]+'.value=""')		}	}}}function hideWhenSimple(identifier,show){	//thisLayer=eval(doc + '["div'+identifier+'"]'+sty);	thisLayer = document.getElementById( 'div'+ identifier)	if(show=='off')		{				thisLayer.visibility='hidden'				thisLayer.height=1}		else		{				thisLayer.visibility='visible'				thisLayer.height=eval(doc+'["div'+identifier+'"].scrollHeight')		}}function showPopHelp( html) {	//config.Width = 120;	Tip(html, WIDTH, 120, PADDING, 6, BGCOLOR, '#E1FFEB',FADEIN, 400,FADEIN, 300)}function showPopHelpClose( html) {	//config.Width = 120;	Tip(html, WIDTH, 120, PADDING, 6, BGCOLOR, '#E1FFEB',FADEIN, 400,FADEIN, 300, CLICKCLOSE, true, CLICKSTICKY, true)}function showHelp( html ) {	var dbpath = document.getElementById("dbpath").innerHTML;	var inp = html;	inp = inp.replace(/'/g,"\\'");	inp = inp.replace(/<p>/g,"");	inp = inp.replace(/<\/p>/g,"<br>");	document.write( "<a onmouseout='UnTip()' href='javascript:void(0);' onmouseover=\"showPopHelp('" + inp + "')\"><img src='/" + dbpath + "/info.gif!openimageresource'></a>")}function showHelpClose( html ) {	var dbpath = document.getElementById("dbpath").innerHTML;	var inp = html;	inp = inp.replace(/'/g,"\\'");	inp = inp.replace(/<p>/g,"");	inp = inp.replace(/<\/p>/g,"<br>");	document.write( "<a onmouseout='UnTip()' href='javascript:void(0);' onmouseover=\"showPopHelpClose('" + inp + "')\"><img src='/" + dbpath + "/info.gif!openimageresource'></a>")}function showDHTMwin( url, w, h) {	ajaxwin=dhtmlwindow.open("ajaxbox", "ajax", url, "Map", "width=" + w + "px,height=" + h + "px,resize=1,scrolling=1")}