/* 
generalexcelcalc.js  version 3.0.0

*/

NameOfCalc = {  // <= Replace this name with 'Search and Replace'
	jsversion: '3.0.0',
	
  init: function() {
		var Toolbox = CalculatorToolbox;
		var ToolCompliant=DBcore.getJSversion(CalculatorToolbox,'1.39.0');
  		if (ToolCompliant.compliant) {
			 	 var excelMode=true;
			 	 Toolbox.calculatorObj=NameOfCalc;
			 	 Toolbox.listOfTriggers=['radioValue'];
			 	 Toolbox.pseudoChangeElementIdsFromCalc=[];
 				 NameOfCalc.setRadio();
			 	 Toolbox.sampleInitToolbox(excelMode);
				 Toolbox.overwritePrintIcon();
			}
  },

	dispLocalValidators: function(field,classFunction,classParams,eventType) {
			var self=NameOfCalc;
			var ok=true;
			switch (classFunction){
					case 'radioValue':
							 		ok=self.radioValuefunction(field, classParams);
									break;					
					default:
									break;
			}
			return ok;
	},
	
	radioValuefunction: function(field, theparams) {
		document.getElementById(theparams[0]).value = field.value;
		return true;
	},
	
	setRadio: function(){
		var radioNr = document.getElementById("account").value;
			if (radioNr == 2) {
				document.getElementById("account1").click();
			}
			if (radioNr == 1) {
				document.getElementById("account2").click();
				DBcore.removeClass(document.getElementById("app2div"),"hide");
				DBcore.addClass(document.getElementById("app2div"),"show");
			}
	}
}
DBcore.start(NameOfCalc);


