// Set variables required thru the session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;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);}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.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 = ""}}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')		}}
