var product1_count=0;
var hashFlag=0;
	var product2_count=0;
	var product3_count=0;
	var product4_count=0;
	var product5_count=0;
	var param1='';
	var array_Id = new Array  ;
	var array_Flag = new Array  ;
	var k =0;
	var array_Id_des = new Array  ;
	var array_Flag_des= new Array  ;
	var j =0;
	var array_removedInsurances = new Array  ;
	var array_count=0;
	var array_InsDes= new Array  ;
	var array_count1=0;
	
	var sessionData = new SessionData();
	var viSelectedBranch = ++seqNum;
	var indexBranch=0;
	
	var output_tr1="";
	var output_tr2="";
	var output_tr3="";
	var i=0;
	var output_row="";
	var formParamForIns="";
	var count_selectBox=0;
	
	var radioGrp1Value = "10_";
	var radioGrp2Value = "20_";
	var radioGrp3Value = "30_";
	var radioGrp4Value = "40_";
	var checkBox1Value = "50_";
	var checkBox2Value = "60_";
	var checkBox3Value = "70_";
	
	function  fillScreenContent_PreStep_VW()
	{
		currentStep = 0;
		updateComponent('txtPreStep_heading_VW',strPreStep_heading);
		updateComponent('txtPreStep_intro_VW',strPreStep_intro);
		updateComponent('lblPreStep_question_VW', strPreStep_question);
		populatelist('selBranch_PreStep', listOfBranches);
		document.getElementById("volgendebutton_VW").title=altTxt_Volgendebutton;
	}
	
	
	function  fillScreenContent_Step1_VW()
	{
		currentStep = 1;
		var strQuery = unescape(window.location.search.substring(1));	
		if (strQuery.substr(0,3)=='pos')
		strQuery = removePos(strQuery);
		var arrTmpParams = strQuery.split('&');
		var intPos = arrTmpParams[0].indexOf('=');
		if (intPos > 0)
	        value_TypeOfSaving = arrTmpParams[0].substring(intPos+1);
	 
		
		if(strStep1_subHeading=='')
			hideComponent('txtStep1_subHeading');
		else
			updateComponent('txtStep1_subHeading',strStep1_subHeading);
		
		if(strStep1_introTxt_1=='')
			hideComponent('txtStep1_introTxt_1');
		else
			updateComponent('txtStep1_introTxt_1',strStep1_introTxt_1);	
		
		updateComponent('txtStep1_InputHeading',strStep1_InputHeading);
		updateComponent('txtStep1_question1',strPreStep_question);
		populatelist('selBranch_Step1', listOfBranches);
		updateComponent('txtStep1_question2',strStep1_question2);
		updateComponent('lblRadio1',strStep1_radio1);
		updateComponent('lblRadio2',strStep1_radio2);
		updateComponent('txtStep1_question3',strStep1_question3);
		updateComponent('lblRadio3',strStep1_radio1);
		updateComponent('lblRadio4',strStep1_radio2);
		updateComponent('txtStep1_question4',strStep1_question4);
		updateComponent('lblRadio5',strStep1_radio1);
		updateComponent('lblRadio6',strStep1_radio2);
		updateComponent('txtStep1_question5',strStep1_question5);
		updateComponent('lblRadio7',strStep1_radio1);
		updateComponent('lblRadio8',strStep1_radio2);
		updateComponent('txtStep1_question6',strStep1_question6);
		updateComponent('txtStep1_qst6_ChkBox1',strStep1_qst6_ChkBox1);
		updateComponent('txtStep1_qst7_ChkBox2',strStep1_qst7_ChkBox2);
		updateComponent('txtStep1_qst8_ChkBox3',strStep1_qst8_ChkBox3);
		updateComponent('txtStep1_FinalQst1',strStep1_FinalQst1);
		updateComponent('txtStep1_FinalQst2',strStep1_FinalQst2);
		updateComponent('txtStep1_FinalQst3',strStep1_FinalQst3);
		updateComponent('txtCalltoAction_Qst',strCalltoAction);
		
		updateComponent('txtCalltoAction_Form1',strCalltoAction_Form_txt1);
		updateComponent('txtCalltoAction_Form2',strCalltoAction_Form_txt2);
		
		updateComponent('link_tips',strlinkText);
		updateComponent('link_toevoegen',strlinkText);
		
		updateComponent('headerText',strHeaderText);
		updateComponent('txtBranchOther',strBranchOther);
		
		//product 1
		
		updateComponent('heading_product1',strHeading_product1);
		updateComponent('txtProduct1_insurance1',strProduct1_insurance1);
		updateComponent('txtProduct1_ins1_header',strProduct1_insurance1);
		updateComponent('txtProduct1_ins1_description',strProduct1_ins1_description);
		
		updateComponent('txtProduct1_insurance2',strProduct1_insurance2);
		updateComponent('txtProduct1_ins2_header',strProduct1_insurance2);
		updateComponent('txtProduct1_ins2_description',strProduct1_ins2_description);
		
		updateComponent('txtProduct1_insurance3',strProduct1_insurance3);
		updateComponent('txtProduct1_ins3_header',strProduct1_insurance3);
		updateComponent('txtProduct1_ins3_description',strProduct1_ins3_description);
		
		updateComponent('txtProduct1_insurance4',strProduct1_insurance4);
		updateComponent('txtProduct1_ins4_header',strProduct1_insurance4);
		updateComponent('txtProduct1_ins4_description',strProduct1_ins4_description);
		
		//product 2
		updateComponent('heading_product2',strHeading_product2);
		updateComponent('txtProduct2_insurance1',strProduct2_insurance1);
		updateComponent('txtProduct2_ins1_header',strProduct2_insurance1);
		updateComponent('txtProduct2_ins1_description',strProduct2_ins1_description);
		
		updateComponent('txtProduct2_insurance2',strProduct2_insurance2);
		updateComponent('txtProduct2_ins2_header',strProduct2_insurance2);
		updateComponent('txtProduct2_ins2_description',strProduct2_ins2_description);
		
		updateComponent('txtProduct2_insurance3',strProduct2_insurance3);
		updateComponent('txtProduct2_ins3_header',strProduct2_insurance3);
		updateComponent('txtProduct2_ins3_description',strProduct2_ins3_description);
		
		updateComponent('txtProduct2_insurance4',strProduct2_insurance4);
		updateComponent('txtProduct2_ins4_header',strProduct2_insurance4);
		updateComponent('txtProduct2_ins4_description',strProduct2_ins4_description);
		
		updateComponent('txtProduct2_insurance5',strProduct2_insurance5);
		updateComponent('txtProduct2_ins5_header',strProduct2_insurance5);
		updateComponent('txtProduct2_ins5_description',strProduct2_ins5_description);
		
		updateComponent('txtProduct2_insurance6',strProduct2_insurance6);
		updateComponent('txtProduct2_ins6_header',strProduct2_insurance6);
		updateComponent('txtProduct2_ins6_description',strProduct2_ins6_description);
		
		updateComponent('txtProduct2_insurance7',strProduct2_insurance7);
		updateComponent('txtProduct2_ins7_header',strProduct2_insurance7);
		updateComponent('txtProduct2_ins7_description',strProduct2_ins7_description);
		
		updateComponent('txtProduct2_insurance8',strProduct2_insurance8);
		updateComponent('txtProduct2_ins8_header',strProduct2_insurance8);
		updateComponent('txtProduct2_ins8_description',strProduct2_ins8_description);
		
		//product 3
		updateComponent('heading_product3',strHeading_product3);
		updateComponent('txtProduct3_insurance1',strProduct3_insurance1);
		updateComponent('txtProduct3_ins1_header',strProduct3_insurance1);
		updateComponent('txtProduct3_ins1_description',strProduct3_ins1_description);
		
		updateComponent('txtProduct3_insurance2',strProduct3_insurance2);
		updateComponent('txtProduct3_ins2_header',strProduct3_insurance2);
		updateComponent('txtProduct3_ins2_description',strProduct3_ins2_description);
		
		updateComponent('txtProduct3_insurance3',strProduct3_insurance3);
		updateComponent('txtProduct3_ins3_header',strProduct3_insurance3);
		updateComponent('txtProduct3_ins3_description',strProduct3_ins3_description);
		
		updateComponent('txtProduct3_insurance4',strProduct3_insurance4);
		updateComponent('txtProduct3_ins4_header',strProduct3_insurance4);
		updateComponent('txtProduct3_ins4_description',strProduct3_ins4_description);
		
		updateComponent('txtProduct3_insurance5',strProduct3_insurance5);
		updateComponent('txtProduct3_ins5_header',strProduct3_insurance5);
		updateComponent('txtProduct3_ins5_description',strProduct3_ins5_description);
		
		//product 4
		updateComponent('heading_product4',strHeading_product4);
		updateComponent('txtProduct4_insurance1',strProduct4_insurance1);
		updateComponent('txtProduct4_ins1_header',strProduct4_insurance1);
		updateComponent('txtProduct4_ins1_description',strProduct4_ins1_description);
		
		updateComponent('txtProduct4_insurance2',strProduct4_insurance2);
		updateComponent('txtProduct4_ins2_header',strProduct4_insurance2);
		updateComponent('txtProduct4_ins2_description',strProduct4_ins2_description);
		
		updateComponent('txtProduct4_insurance3',strProduct4_insurance3);
		updateComponent('txtProduct4_ins3_header',strProduct4_insurance3);
		updateComponent('txtProduct4_ins3_description',strProduct4_ins3_description);
		
		updateComponent('txtProduct4_insurance4',strProduct4_insurance4);
		updateComponent('txtProduct4_ins4_header',strProduct4_insurance4);
		updateComponent('txtProduct4_ins4_description',strProduct4_ins4_description);
		
		updateComponent('txtProduct4_insurance5',strProduct4_insurance5);
		updateComponent('txtProduct4_ins5_header',strProduct4_insurance5);
		updateComponent('txtProduct4_ins5_description',strProduct4_ins5_description);
		
		updateComponent('txtProduct4_insurance6',strProduct4_insurance6);
		updateComponent('txtProduct4_ins6_header',strProduct4_insurance6);
		updateComponent('txtProduct4_ins6_description',strProduct4_ins6_description);
		
		//product 5
		updateComponent('heading_product5',strHeading_product5);
		updateComponent('txtProduct5_insurance1',strProduct5_insurance1);
		updateComponent('txtProduct5_ins1_header',strProduct5_insurance1);
		updateComponent('txtProduct5_ins1_description',strProduct5_ins1_description);
		
		updateComponent('txtProduct5_insurance2',strProduct5_insurance2);
		updateComponent('txtProduct5_ins2_header',strProduct5_insurance2);
		updateComponent('txtProduct5_ins2_description',strProduct5_ins2_description);
		
		updateComponent('txtProduct5_insurance3',strProduct5_insurance3);
		updateComponent('txtProduct5_ins3_header',strProduct5_insurance3);
		updateComponent('txtProduct5_ins3_description',strProduct5_ins3_description);
		
		updateComponent('txtProduct5_insurance4',strProduct5_insurance4);
		updateComponent('txtProduct5_ins4_header',strProduct5_insurance4);
		updateComponent('txtProduct5_ins4_description',strProduct5_ins4_description);
		
		//update selectBox components
		updateComponent('txtHeading_product1',strHeading_product1);
		updateComponent('lbl_Product1_insurance1',strHeading_product1);
		updateComponent('lbl_Product1_insurance2',strProduct1_insurance2);
		updateComponent('lbl_Product1_insurance3',strProduct1_insurance3);
		updateComponent('lbl_Product1_insurance4',strProduct1_insurance4);
		
		updateComponent('txtHeading_product2',strHeading_product2);
		updateComponent('lbl_Product2_insurance1',strProduct2_insurance1_selectBox);
		updateComponent('lbl_Product2_insurance2',strProduct2_insurance2_selectBox);
		updateComponent('lbl_Product2_insurance3',strProduct2_insurance3);
		updateComponent('lbl_Product2_insurance4',strProduct2_insurance4);
		updateComponent('lbl_Product2_insurance5',strProduct2_insurance5);
		updateComponent('lbl_Product2_insurance6',strProduct2_insurance6);
		updateComponent('lbl_Product2_insurance7',strProduct2_insurance7);
		updateComponent('lbl_Product2_insurance8',strProduct2_insurance8);
		
		updateComponent('txtHeading_product3',strHeading_product3);
		updateComponent('lbl_Product3_insurance1',strProduct3_insurance1);
		updateComponent('lbl_Product3_insurance2',strProduct3_insurance2_selectBox);
		updateComponent('lbl_Product3_insurance3',strProduct3_insurance3_selectBox);
		updateComponent('lbl_Product3_insurance4',strProduct3_insurance4);
		updateComponent('lbl_Product3_insurance5',strProduct3_insurance5);
		
		updateComponent('txtHeading_product4',strHeading_product4);
		updateComponent('lbl_Product4_insurance1',strProduct4_insurance1_selectBox);
		updateComponent('lbl_Product4_insurance2',strProduct4_insurance2_selectBox);
		updateComponent('lbl_Product4_insurance3',strProduct4_insurance3_selectBox);
		updateComponent('lbl_Product4_insurance4',strProduct4_insurance4_selectBox);
		updateComponent('lbl_Product4_insurance5',strProduct4_insurance5_selectBox);
		updateComponent('lbl_Product4_insurance6',strProduct4_insurance6_selectBox);
		
		updateComponent('txtHeading_product5',strHeading_product5);
		updateComponent('lbl_Product5_insurance1',strProduct5_insurance1);
		updateComponent('lbl_Product5_insurance2',strProduct5_insurance2);
		updateComponent('lbl_Product5_insurance3',strProduct5_insurance3);
		updateComponent('lbl_Product5_insurance4',strProduct5_insurance4);
		
		updateComponent('txtCancelLink',strCancelLink);
		document.getElementById("txtCancelLink").title=altTxt_cancelLink;
		document.getElementById("txtOkImage").title=altTxt_Okbutton;
		
		//for disclaimer
		updateComponent('step1disclaimer',strStep1disclaimer);
		hideComponent('IAM_VWForm2_Step1');
		hideComponent('IAM_VWForm1_Step1');
		hideComponent('background_selectBox');
		hideComponent('divQuestion2');
	        hideComponent('divQuestion3');
	        hideComponent('divQuestion4');
	        hideComponent('divQuestion5');
	        hideComponent('divQuestion6');
	        hideComponent('divQuestion7');
	        hideComponent('divQuestion8');
		hideComponent('txtCalltoAction_Qst');
	     
	        hideComponent('selectBox_link');
		hideComponent('branchOther');
		
		hideComponent('heading_product1');
	        hideComponent('product1_insurance1');
		hideComponent('product1_ins1_description');
		hideComponent('product1_insurance2');
		hideComponent('product1_ins2_description');
		hideComponent('product1_insurance3');
		hideComponent('product1_ins3_description');
		hideComponent('product1_insurance4');
		hideComponent('product1_ins4_description');
		
		hideComponent('heading_product2');
	        hideComponent('product2_insurance1');
		hideComponent('product2_ins1_description');
		hideComponent('product2_insurance2');
		hideComponent('product2_ins2_description');
		hideComponent('product2_insurance3');
		hideComponent('product2_ins3_description');
		hideComponent('product2_insurance4');
		hideComponent('product2_ins4_description');
		hideComponent('product2_insurance5');
		hideComponent('product2_ins5_description');
		hideComponent('product2_insurance6');
		hideComponent('product2_ins6_description');
		hideComponent('product2_insurance7');
		hideComponent('product2_ins7_description');
		hideComponent('product2_insurance8');
		hideComponent('product2_ins8_description');
		
	        hideComponent('heading_product3');
	        hideComponent('product3_insurance1');
		hideComponent('product3_ins1_description');
		hideComponent('product3_insurance2');
		hideComponent('product3_ins2_description');
		hideComponent('product3_insurance3');
		hideComponent('product3_ins3_description');
		hideComponent('product3_insurance4');
		hideComponent('product3_ins4_description');
		hideComponent('product3_insurance5');
		hideComponent('product3_ins5_description');
		
	        hideComponent('heading_product4');
	        hideComponent('product4_insurance1');
		hideComponent('product4_ins1_description');
		hideComponent('product4_insurance2');
		hideComponent('product4_ins2_description');
		hideComponent('product4_insurance3');
		hideComponent('product4_ins3_description');
		hideComponent('product4_insurance4');
		hideComponent('product4_ins4_description');
		hideComponent('product4_insurance5');
		hideComponent('product4_ins5_description');
		hideComponent('product4_insurance6');
		hideComponent('product4_ins6_description');
		
	        hideComponent('heading_product5');
	        hideComponent('product5_insurance1');
		hideComponent('product5_ins1_description');
		hideComponent('product5_insurance2');
		hideComponent('product5_ins2_description');
		hideComponent('product5_insurance3');
		hideComponent('product5_ins3_description');
		hideComponent('product5_insurance4');
	        hideComponent('product5_ins4_description');
		hideComponent('calltoAction_Form');
	
		//selectBox_list
		hideComponent('div_SelectBox');
		hideComponent('txtHeading_product1');
		hideComponent('selectBox_product1_insurance1');
		hideComponent('selectBox_product1_insurance2');
		hideComponent('selectBox_product1_insurance3');
		hideComponent('selectBox_product1_insurance4');
		
		hideComponent('txtHeading_product2');
		hideComponent('selectBox_product2_insurance1');
		hideComponent('selectBox_product2_insurance2');
		hideComponent('selectBox_product2_insurance3');
		hideComponent('selectBox_product2_insurance4');
		hideComponent('selectBox_product2_insurance5');
		hideComponent('selectBox_product2_insurance6');
		hideComponent('selectBox_product2_insurance7');
		hideComponent('selectBox_product2_insurance8');
		
		hideComponent('txtHeading_product3');
		hideComponent('selectBox_product3_insurance1');
		hideComponent('selectBox_product3_insurance2');
		hideComponent('selectBox_product3_insurance3');
		hideComponent('selectBox_product3_insurance4');
		hideComponent('selectBox_product3_insurance5');
		
		hideComponent('txtHeading_product4');
		hideComponent('selectBox_product4_insurance1');
		hideComponent('selectBox_product4_insurance2');
		hideComponent('selectBox_product4_insurance3');
		hideComponent('selectBox_product4_insurance4');
		hideComponent('selectBox_product4_insurance5');
		hideComponent('selectBox_product4_insurance6');
		
		hideComponent('txtHeading_product5');
		hideComponent('selectBox_product5_insurance1');
		hideComponent('selectBox_product5_insurance2');
		hideComponent('selectBox_product5_insurance3');
		hideComponent('selectBox_product5_insurance4');
		fillStoreValues();
		getSessionData_VW();
		if(indexBranch !=0 && hashFlag==0) {
		    document.getElementById('selBranch_Step1').selectedIndex = indexBranch;
		    showNextQst_FormforBranches('divQuestion2',getFormParamforBranches());
		}
		setDisabled('IAM_VWForm_Step1', false);
		setDisabled('IAM_VWForm2_Step1', false);
		
	}
	

	function validate_PreStep_VW(e){
		var param="0="+document.IAM_PreStep_VW.selBranch_PreStep.value; 
		YAHOO.util.Event.preventDefault(e);
		location.href=strURL_step1+'?pos='+strOmniture_variable+'&'+param;
		return false;	
	}
	
	function getSessionData_VW(arrParams) {
		if (sessionData.hasVal(viSelectedBranch)) 
			indexBranch = sessionData.getVal(viSelectedBranch);
		else indexBranch = '';
	}
	
	// functions for Ververzekeringswijzer
	
	var formParam="";
	var selected_answer="";
	
	function getFormParamforBranches(){
		var selectObject=document.getElementById("selBranch_Step1");
		var chosenOption=selectObject.options[selectObject.selectedIndex]; 
		
		for(i = 0 ; i < listOfFormParams_Branches.length ; i++){ 
			if (chosenOption.text==listOfFormParams_Branches[i][0]){
			var formParam=listOfFormParams_Branches[i][1];
		
			return formParam;
			}
		}
	}
	function getFormParamforQsts(objId, qst_number){
		for(i=0; i < questionIDs.length ; i++){
			if(objId==questionIDs[i]){ 
				var formInputObj=document.getElementById(objId); 
				if(formInputObj.checked){
					var selectedOption=formInputObj.value; 
					if (selectedOption==1){ 
						var selected_answer="ja";
						}
					if(selectedOption==2) {selected_answer="nee";
						}
					if (selectedOption=="ChkBox1"){selected_answer="ja";
						}
					if (selectedOption=="ChkBox2"){selected_answer="ja";
						}
					if (selectedOption=="ChkBox3"){selected_answer="ja";
						}
				}else selected_answer="nee"; 
			}
		}
		switch(parseInt(qst_number))
			{
			case 2:    formParam="andlocbed="+selected_answer;
					return formParam;
					break;
			
			case 3:     formParam="bedeig="+selected_answer;
					return formParam;
					break;
					
			case 4:     formParam="goedtran="+selected_answer;
					return formParam;
					break;
					
			case 5:     formParam="prsnl="+selected_answer;
					return formParam;
					break;
					
			case 6:     formParam="invent="+selected_answer;
						storeInputValues("6");
					return formParam;
					break;
			
			case 7:     formParam="kas="+selected_answer;
						storeInputValues("7");
					return formParam;
					break;
			
			case 8:     formParam="mtrvrtg="+selected_answer;
						storeInputValues("8");
					return formParam;
					break;
			
			}
	}
	
	
	function showNextQst_FormforBranches(id, form_paramBranches){
		var list_Input1 = document.getElementById('IAM_VWForm_Step1').getElementsByTagName('input');
		for(i=0;i<list_Input1.length;i++)
		{
			list_Input1[i].checked=false;
		}
		
		hideComponent('divQuestion2');
	        hideComponent('divQuestion3');
	        hideComponent('divQuestion4');
	        hideComponent('divQuestion5');
	        hideComponent('divQuestion6');
	        hideComponent('divQuestion7');
	        hideComponent('divQuestion8');
	        hideComponent('txtCalltoAction_Qst');
	        hideComponent('selectBox_link');
	        hideComponent('branchOther');
	       
	        hideComponent('heading_product1');
	        hideComponent('product1_insurance1');
		hideComponent('product1_ins1_description');
		hideComponent('product1_insurance2');
		hideComponent('product1_ins2_description');
		hideComponent('product1_insurance3');
		hideComponent('product1_ins3_description');
		hideComponent('product1_insurance4');
		hideComponent('product1_ins4_description');
		
		for(i=1;i<5;i++){
			for(l=0;l<array_Id.length;l++){
				if(array_Id[l] == 'product1_insurance'+i){	
					array_Flag[l]=0;
				}							
			}
		}
		for(i=1;i<5;i++){
			for(l=0;l<array_Id_des.length;l++){
				if(array_Id_des[l] == 'product1_ins'+i+'_description'){	
					array_Flag_des[l]=0;
				}							
			}
		}
		
		hideComponent('heading_product2');
	        hideComponent('product2_insurance1');
		hideComponent('product2_ins1_description');
		hideComponent('product2_insurance2');
		hideComponent('product2_ins2_description');
		hideComponent('product2_insurance3');
		hideComponent('product2_ins3_description');
		hideComponent('product2_insurance4');
		hideComponent('product2_ins4_description');
		hideComponent('product2_insurance5');
		hideComponent('product2_ins5_description');
		hideComponent('product2_insurance6');
		hideComponent('product2_ins6_description');
		hideComponent('product2_insurance7');
		hideComponent('product2_ins7_description');
		hideComponent('product2_insurance8');
		hideComponent('product2_ins8_description');
		
		for(i=1;i<9;i++){
			for(l=0;l<array_Id.length;l++){
				if(array_Id[l] == 'product2_insurance'+i){	
					array_Flag[l]=0;
				}							
			}
		}
		for(i=1;i<9;i++){
			for(l=0;l<array_Id_des.length;l++){
				if(array_Id_des[l] == 'product2_ins'+i+'_description'){	
					array_Flag_des[l]=0;
				}							
			}
		}
		
	        hideComponent('heading_product3');
	        hideComponent('product3_insurance1');
		hideComponent('product3_ins1_description');
		hideComponent('product3_insurance2');
		hideComponent('product3_ins2_description');
		hideComponent('product3_insurance3');
		hideComponent('product3_ins3_description');
		hideComponent('product3_insurance4');
		hideComponent('product3_ins4_description');
		hideComponent('product3_insurance5');
		hideComponent('product3_ins5_description');
		
		for(i=1;i<6;i++){
			for(l=0;l<array_Id.length;l++){
				if(array_Id[l] == 'product3_insurance'+i){	
					array_Flag[l]=0;
				}							
			}
		}
		for(i=1;i<6;i++){
			for(l=0;l<array_Id_des.length;l++){
				if(array_Id_des[l] == 'product3_ins'+i+'_description'){	
					array_Flag_des[l]=0;
				}							
			}
		}
				
	        hideComponent('heading_product4');
	        hideComponent('product4_insurance1');
		hideComponent('product4_ins1_description');
		hideComponent('product4_insurance2');
		hideComponent('product4_ins2_description');
		hideComponent('product4_insurance3');
		hideComponent('product4_ins3_description');
		hideComponent('product4_insurance4');
		hideComponent('product4_ins4_description');
		hideComponent('product4_insurance5');
		hideComponent('product4_ins5_description');
		hideComponent('product4_insurance6');
		hideComponent('product4_ins6_description');
		
		for(i=1;i<7;i++){
			for(l=0;l<array_Id.length;l++){
				if(array_Id[l] == 'product4_insurance'+i){	
					array_Flag[l]=0;
				}							
			}
		}
		for(i=1;i<7;i++){
			for(l=0;l<array_Id_des.length;l++){
				if(array_Id_des[l] == 'product4_ins'+i+'_description'){	
					array_Flag_des[l]=0;
				}							
			}
		}
	        hideComponent('heading_product5');
	        hideComponent('product5_insurance1');
		hideComponent('product5_ins1_description');
		hideComponent('product5_insurance2');
		hideComponent('product5_ins2_description');
		hideComponent('product5_insurance3');
		hideComponent('product5_ins3_description');
		hideComponent('product5_insurance4');
	        hideComponent('product5_ins4_description');
		hideComponent('calltoAction_Form');
		
		for(i=1;i<5;i++){
			for(l=0;l<array_Id.length;l++){
				if(array_Id[l] == 'product5_insurance'+i){	
					array_Flag[l]=0;
				}							
			}
		}
		for(i=1;i<5;i++){
			for(l=0;l<array_Id_des.length;l++){
				if(array_Id_des[l] == 'product5_ins'+i+'_description'){	
					array_Flag_des[l]=0;
				}							
			}
		}
		//hide selectBox
		hideComponent('div_SelectBox');
		hideComponent('txtHeading_product1');
		hideComponent('selectBox_product1_insurance1');
		hideComponent('selectBox_product1_insurance2');
		hideComponent('selectBox_product1_insurance3');
		hideComponent('selectBox_product1_insurance4');
		
		hideComponent('txtHeading_product2');
		hideComponent('selectBox_product2_insurance1');
		hideComponent('selectBox_product2_insurance2');
		hideComponent('selectBox_product2_insurance3');
		hideComponent('selectBox_product2_insurance4');
		hideComponent('selectBox_product2_insurance5');
		hideComponent('selectBox_product2_insurance6');
		hideComponent('selectBox_product2_insurance7');
		hideComponent('selectBox_product2_insurance8');
		
		hideComponent('txtHeading_product3');
		hideComponent('selectBox_product3_insurance1');
		hideComponent('selectBox_product3_insurance2');
		hideComponent('selectBox_product3_insurance3');
		hideComponent('selectBox_product3_insurance4');
		hideComponent('selectBox_product3_insurance5');
		
		hideComponent('txtHeading_product4');
		hideComponent('selectBox_product4_insurance1');
		hideComponent('selectBox_product4_insurance2');
		hideComponent('selectBox_product4_insurance3');
		hideComponent('selectBox_product4_insurance4');
		hideComponent('selectBox_product4_insurance5');
		hideComponent('selectBox_product4_insurance6');
		
		hideComponent('txtHeading_product5');
		hideComponent('selectBox_product5_insurance1');
		hideComponent('selectBox_product5_insurance2');
		hideComponent('selectBox_product5_insurance3');
		hideComponent('selectBox_product5_insurance4');
		unhideComponent('IAM_VWForm2_Step1');
		unhideComponent('IAM_VWForm1_Step1');
		
	       if(form_paramBranches==undefined){
			unhideComponent('changeContent');	
			hideComponent('branchOther');
			hideComponent('IAM_VWForm2_Step1');
			hideComponent('IAM_VWForm1_Step1');
	       }else if(form_paramBranches=='over'){
			hideComponent('changeContent');	
			unhideComponent('branchOther');
			hideComponent('IAM_VWForm2_Step1');
			hideComponent('IAM_VWForm1_Step1');
		}
	       else	{
			unhideComponent(id);
			getFormforBranches(form_paramBranches);
		}
		
		for(i=0; i<array_removedInsurances.length; i++){
			array_removedInsurances[i]='';
		}
		count_selectBox=0;
		
		for(i=0; i<array_InsDes.length; i++){
			array_InsDes[i]='';
		}
			radioGrp1Value = "10_";
			radioGrp2Value = "20_";
			radioGrp3Value = "30_";
			radioGrp4Value = "40_";
			checkBox1Value = "50_";
			checkBox2Value = "60_";
			checkBox3Value = "70_";
			storeInputValues("a");
			
	}
	
	function getFormforBranches(form_param_branches){
	
		hideComponent("changeContent"); 
		unhideComponent('heading_product1');
		unhideComponent('heading_product2');
		unhideComponent('heading_product3');
		unhideComponent('heading_product4');
		unhideComponent("product1_insurance1");
		unhideComponent("product2_insurance1");
		unhideComponent("product3_insurance1");
		unhideComponent("product4_insurance5");
		unhideComponent("calltoAction_Form");
		
		var arrayList= ["product1_insurance1","product2_insurance1","product3_insurance1","product4_insurance5"];
		for(l=0;l<array_Id.length;l++){
			for(j=0;j<arrayList.length;j++)
				if(array_Id[l] == arrayList[j])
				{	
					array_Flag[l]=1;
				}							
		}
		
		for(i=0; i < matrixA.length ; i++){
			if(matrixA[i][0]==form_param_branches){
				var insurancesforBranch=matrixA[i][1]; 
				var insurances_array=insurancesforBranch.split(','); 
				for(j=0; j<insurances_Ids.length; j++){
					for(k=0; k<insurances_array.length; k++){
						if(insurances_Ids[j][0]==insurances_array[k]){
							var id= insurances_Ids[j][1]; 
							var id_product_array=id.split('_');
							if(id_product_array[0]=='product5'){
								unhideComponent('heading_product5');
							}
							hideComponent("changeContent"); 
							unhideComponent(id);
							for(l=0;l<array_Id.length;l++){
								if(array_Id[l] == id){	
									array_Flag[l]=1;
								}							
							}
						}
					}
				}
			}
		}
	}
	
	function showNextQst_Form(id, form_param2){
		storeInputValues(id);
		if(id=="divQuestion4")
		{
			var selectedBranch=getFormParamforBranches();
			if((selectedBranch=="agra")||(selectedBranch=="bouw")||(selectedBranch=="intw")||(selectedBranch=="trbi")||(selectedBranch=="trbg")||(selectedBranch=="trld")||(selectedBranch=="trtp"))
			{
				unhideComponent(id);
			}
			else
			{
				unhideComponent("divQuestion5");
			}
		}
		else if(id=="divQuestion6")
		{
			var nxtDivId=eval(id.substring(11))+1; 
			unhideComponent(id); 
			var selectedBranch=getFormParamforBranches();
			if((selectedBranch=="agra")||(selectedBranch=="dhfo")||(selectedBranch=="dhnf")||(selectedBranch=="grfo")||(selectedBranch=="grnf")||(selectedBranch=="hore")){
			unhideComponent("divQuestion"+nxtDivId); 
			unhideComponent("divQuestion"+eval(nxtDivId+1)); 
			}else{
				unhideComponent("divQuestion"+eval(nxtDivId+1)); 
				}
			unhideComponent("txtCalltoAction_Qst");
		}
		else
		{
			unhideComponent(id); 
		}
		
		var formParamforQst=form_param2; 
		getFormforQsts(formParamforQst);
	}
	
	

	function getFormforQsts(form_param_qst){	
		
		var answer_Qsts_Array=form_param_qst.split('='); 
		if (answer_Qsts_Array[1]=="ja"){	
			for(l=0; l < matrixB_nee.length ; l++){
				var formParam_matrixB_nee=matrixB_nee[l][0].split('='); 
				if(formParam_matrixB_nee[0]==answer_Qsts_Array[0]){
					var insurancestoHide=matrixB_nee[l][1];
					var insurances_array=insurancestoHide.split(','); 
					for(j=0; j<insurances_Ids.length; j++){
						for(k=0; k<insurances_array.length; k++){
							if(insurances_Ids[j][0]==insurances_array[k]){
								var id= insurances_Ids[j][1];
								var id_product_array=id.split('_');
								hideComponent("changeContent"); 
								hideComponent(id);
								for(l=0;l<array_Id.length;l++){
									if(array_Id[l] == id){	
										array_Flag[l]=0;
									}							
								}
							}
						}
					}
				}
			}
			for(i=0; i < matrixB_ja.length ; i++){
				if(matrixB_ja[i][0]==form_param_qst){
					var insurancesforQst=matrixB_ja[i][1]; 
					var insurances_array_qsts=insurancesforQst.split(','); 
					for(j=0; j<insurances_Ids.length; j++){
						for(k=0; k<insurances_array_qsts.length; k++){
							if(insurances_Ids[j][0]==insurances_array_qsts[k]){
								var selectObject=document.getElementById("selBranch_Step1");
								var chosenOption=selectObject.options[selectObject.selectedIndex]; 
									if(insurances_Ids[j][0]=="Pensioen (Collectief)"){
										if((chosenOption.text=="Dienstverlening in IT")||(chosenOption.text=="Advocaat/notaris/accountant/makelaar/")||(chosenOption.text=="Interim manager/ingenieur")||(chosenOption.text=="Groothandel food")||(chosenOption.text=="Groothandel non food")){
											if(form_param_qst=="prsnl=ja"){
												var id= insurances_Ids[j][1];
												var id_product_array=id.split('_');
												hideComponent("changeContent"); 
												unhideComponent(id);
												for(l=0;l<array_Id.length;l++){
													if(array_Id[l] == id){
														array_Flag[l]=1;
													}							
												}
											}
										}
									}
									else{
										var id= insurances_Ids[j][1];
										var id_product_array=id.split('_');
										hideComponent("changeContent"); 
										unhideComponent(id);
										for(l=0;l<array_Id.length;l++){
											if(array_Id[l] == id){
												array_Flag[l]=1;
										}							
									}
								}
							}
						}
					}
				}
			}
		}
		if (answer_Qsts_Array[1]=="nee"){
			for(l=0; l < matrixB_ja.length ; l++){
				var formParam_matrixB_ja=matrixB_ja[l][0].split('=');
				if(formParam_matrixB_ja[0]==answer_Qsts_Array[0]){
					var insurancestoHide=matrixB_ja[l][1]; 
					var insurances_array=insurancestoHide.split(','); 
					for(j=0; j<insurances_Ids.length; j++){
						for(k=0; k<insurances_array.length; k++){
							if(insurances_Ids[j][0]==insurances_array[k]){
								var id= insurances_Ids[j][1];
								var id_product_array=id.split('_');
								hideComponent("changeContent"); 
								hideComponent(id);
								for(l=0;l<array_Id.length;l++){
									if(array_Id[l] == id){	
										array_Flag[l]=0;
									}					
								}
							}
						}
					}
				}
			}
			for(i=0; i < matrixB_nee.length ; i++){
				if(matrixB_nee[i][0]==form_param_qst){
					var insurancesforQst=matrixB_nee[i][1]; 
					var insurances_array_qsts=insurancesforQst.split(','); 
					for(j=0; j<insurances_Ids.length; j++){
						for(k=0; k<insurances_array_qsts.length; k++){
							if(insurances_Ids[j][0]==insurances_array_qsts[k]){
								var id= insurances_Ids[j][1];
								var id_product_array=id.split('_');
								hideComponent("changeContent"); 
								unhideComponent(id);
								for(l=0;l<array_Id.length;l++){
									if(array_Id[l] == id){	
										array_Flag[l]=1;
									}							
								}
							}
						}
					}
				}
			}
		}
		
		for(i=1;i<6;i++)
		{
			var count_Flag=0;
			for(l=0;l<array_Id.length;l++){
				var productId_array1=array_Id[l].split('_');
				if( productId_array1[0] == "product"+i){	
					count_Flag=count_Flag + array_Flag[l];
				}							
			
				if(count_Flag==0){
					hideComponent('heading_product'+i);
				}
				else{
					unhideComponent('heading_product'+i);
				}
			} 
		}
	}
	
	
	function removeInsurance(productId){
		count_selectBox++;
		unhideComponent("selectBox_link");
		var count_Flag=0;
		var productId_array=productId.split('_');
		hideComponent(productId);
		for(l=0;l<array_Id.length;l++){
			if(array_Id[l] == productId){	
				array_Flag[l]=0;
			}							
		}
		var No_heading_product=productId_array[0].substring(7);
		for(l=0;l<array_Id.length;l++){
			var productId_array1=array_Id[l].split('_');
			if( productId_array1[0] == productId_array[0]){	
				count_Flag=count_Flag + array_Flag[l];
			}							
		}
		
		if(count_Flag==0){
			var heading_product="heading_product"+No_heading_product; 
			hideComponent(heading_product);
		}
		array_removedInsurances[array_count]= productId;
		array_count++;
	}
	
	
	function removeInsurance_Description(productId1, productId2){
		count_selectBox++;
		unhideComponent("selectBox_link");
		var count_Flag=0;
		hideComponent(productId1);
		for(l=0;l<array_Id.length;l++){
			if(array_Id[l] == productId2){	
				array_Flag[l]=0;
			}							
		}
		for(l=0;l<array_Id_des.length;l++){
			if(array_Id_des[l] == productId1){	
				array_Flag_des[l]=0;
			}							
		}
		var productId_array=productId1.split('_');
		var No_heading_product=productId_array[0].substring(7);
		
		for(l=0;l<array_Id.length;l++){
			var productId_array1=array_Id[l].split('_');
			if( productId_array1[0] == productId_array[0]){	
				count_Flag=count_Flag + array_Flag[l];
			}							
		}
		if(count_Flag==0){
			var heading_product="heading_product"+No_heading_product; 
			hideComponent(heading_product);
		}
		array_removedInsurances[array_count]= productId2;
		array_count++;
	}
	
	
	function showInsuranceDescription(productId, productId_des){ 
		
		if(array_InsDes.length>0){
			for(i=0; i<array_InsDes.length; i++){
				for(l=0;l<array_Id_des.length;l++){
					if(array_Id_des[l] == array_InsDes[i]){	
						if(array_Flag_des[l]==1){
							hideComponent(array_InsDes[i]);
							for(l=0;l<array_Id_des.length;l++){
								if(array_Id_des[l] == array_InsDes[i]){	
									array_Flag_des[l]=0;
								}							
							}
							var id_product=array_InsDes[i].split('_')[0]+"_insurance"+array_InsDes[i].substring(12,13);
							unhideComponent(id_product);
							for(l=0;l<array_Id.length;l++){
								if(array_Id[l] == id_product){	
									array_Flag[l]=1;
								}							
							}
						}
					}							
				}
			}
			hideComponent(productId);
			for(l=0;l<array_Id.length;l++){
				if(array_Id[l] == productId){	
					array_Flag[l]=3;
				}							
			}
			unhideComponent(productId_des);
			for(l=0;l<array_Id_des.length;l++){
				if(array_Id_des[l] == productId_des){	
					array_Flag_des[l]=1;
				}							
			}
		}
		else{
			hideComponent(productId);
			for(l=0;l<array_Id.length;l++){
				if(array_Id[l] == productId){	
					array_Flag[l]=3;
				}							
			}
			unhideComponent(productId_des);
			for(l=0;l<array_Id_des.length;l++){
				if(array_Id_des[l] == productId_des){	
					array_Flag_des[l]=1;
				}							
			}
		}
		array_InsDes[array_count1]=productId_des;
		array_count1++;
		
	}
	
	function hideInsuranceDescription(productId_des, productId){ 
		hideComponent(productId_des);
		for(l=0;l<array_Id_des.length;l++){
			if(array_Id_des[l] == productId_des){	
				array_Flag_des[l]=0;
			}							
		}
		unhideComponent(productId);
		for(l=0;l<array_Id.length;l++){
			if(array_Id[l] == productId){	
				array_Flag[l]=1;
			}							
		}
	}
	
	function generateInsurances(productNo, numberofInsurances){
		for(i=1; i<=numberofInsurances; i++){
			output_tr1="<tr id='product"+productNo+"_insurance"+i+"'><td><table><tr class=\"selectBox_tableTr1\" ><td class=\"selectBox_tableTr1\"><a href=\"javascript:;\" style=\"text-decoration:none;\"><span onclick=\"showInsuranceDescription('product"+productNo+"_insurance"+i+"','product"+productNo+"_ins"+i+"_description');return false;\" class=\"selectBox_plus\"  id='imgProduct"+productNo+"_insurance"+i+"' onmouseover=\"changeColor('product"+productNo+"_insurance"+i+"',1);\"  onMouseOut=\"changeColor('product"+productNo+"_insurance"+i+"',2); \"></span><span onclick=\"showInsuranceDescription('product"+productNo+"_insurance"+i+"','product"+productNo+"_ins"+i+"_description');return false;\" style=\"color:#666666;margin-bottom:-23px;padding-left:29px\" id='txtProduct"+productNo+"_insurance"+i+"' onmouseover=\"changeColor('product"+productNo+"_insurance"+i+"',1); \"  onMouseOut=\"changeColor('product"+productNo+"_insurance"+i+"',2);\"></span><span  style=\"margin-left:304px;\"><img  id='imgTrashProduct"+productNo+"_insurance"+i+"' src=\"/nl/images/Systeem/abnamroNL/Content/includes/images/System/Includes/gfx/ICO_bin.gif\" onclick=\"removeInsurance('product"+productNo+"_insurance"+i+"');return false;\" style=\"padding-right:5px;\"></img></span></a></td></tr></table></td></tr>";
			
			output_tr2="<tr id='product"+productNo+"_ins"+i+"_description' ><td><table><tr class=\"selectBox_tableTr2\" ><td style=\"padding-right:0px;border:1px solid #F8F8F8;\"><a href=\"javascript:;\" style=\"text-decoration:none;\"><span    onclick=\"hideInsuranceDescription('product"+productNo+"_ins"+i+"_description','product"+productNo+"_insurance"+i+"');return false;\" class=\"selectBox_min\" id='imgProduct"+productNo+"_ins"+i+"_header' onmouseover=\"changeColor_description('product"+productNo+"_ins"+i+"_description',1);\"  onMouseOut=\"changeColor_description('product"+productNo+"_ins"+i+"_description',2);\" ></span><span style=\"color:#666666; margin-bottom:-23px;padding-left:29px\" id='txtProduct"+productNo+"_ins"+i+"_header' onclick=\"hideInsuranceDescription('product"+productNo+"_ins"+i+"_description','product"+productNo+"_insurance"+i+"');return false;\" onmouseover=\"changeColor_description('product"+productNo+"_ins"+i+"_description',1);\"  onMouseOut=\"changeColor_description('product"+productNo+"_ins"+i+"_description',2);\" ></span><span style=\"margin-left:304px;\"><img  id='imgTrashProduct"+productNo+"_insurance"+i+"_des'  src=\"/nl/images/Systeem/abnamroNL/Content/includes/images/System/Includes/gfx/ICO_bin.gif\" onclick=\"removeInsurance_Description('product"+productNo+"_ins"+i+"_description','product"+productNo+"_insurance"+i+"');return false;\" style=\"padding-right:5px;padding-left:2px;\"></img></span></a><div id='txtProduct"+productNo+"_ins"+i+"_description' class=\"selectBox_description\"></div></td></tr></table></td></tr>";
					
			array_Id[k]= 'product'+productNo+'_insurance'+i;
			array_Flag[k]=0;
			k++;
			
			array_Id_des[j]='product'+productNo+'_ins'+i+'_description';
			array_Flag_des[j]=0;
			j++;
			
			document.write(output_tr1);
			document.write(output_tr2);
			
		}
		
	}
	
	function changeColor(id,check_Flag)
	{
		var list_Input = document.getElementById(id).getElementsByTagName('span');
		if(check_Flag ==1)
		{	
			list_Input[0].style.backgroundPosition="0% 33.33%";
			list_Input[1].style.color="#008780";
		}
		else
		{
			list_Input[0].style.backgroundPosition="0% 0%";
			list_Input[1].style.color="#666666";
		}
	}
	
	function changeColor_description(id,check_Flag)
	{
		var list_Input = document.getElementById(id).getElementsByTagName('span');
		if(check_Flag ==1)
		{	
			list_Input[0].style.backgroundPosition="0% 100%";
			list_Input[1].style.color="#008780";
		}
		else
		{
			list_Input[0].style.backgroundPosition="0% 66.6666%";
			list_Input[1].style.color="#666666";
		}
	}
	
	
	function generateInsurances_selectBox(productNo, numberofInsurances){
		for(i=1; i<=numberofInsurances; i++){
		output_row="<tr id='selectBox_product"+productNo+"_insurance"+i+"' ><td><input type='checkbox' class='no_border' onclick=\"countSelectedIns('chkbx_Product"+productNo+"_insurance"+i+"');\" name='checkbox_name"+productNo+"' id='chkbx_Product"+productNo+"_insurance"+i+"');\"><label for=\"chkbx_Product"+productNo+"_insurance"+i+"\" id='lbl_Product"+productNo+"_insurance"+i+"' style=\"padding-left:5px\"> </label></td></tr>"
		
		document.write(output_row);
		}
	}
	
	function countSelectedIns(input_id){
		var chkboxObj = document.getElementById(input_id);
		if(chkboxObj.checked==true){
			count_selectBox--;
		}
		if(chkboxObj.checked==false){
			count_selectBox++;
		}
	}
	
	function showInsurance_selectBox(form_param_branches,id,array){
		setDisabled('IAM_VWForm_Step1', true);
		setDisabled('IAM_VWForm2_Step1', true);
		var mainElement= document.getElementById('main_container');
		var newDiv= document.getElementById('div_SelectBox');
		mainElement.appendChild(newDiv);
		var list_Input = document.getElementById('form_selectBox').getElementsByTagName('input');
		for(i=0;i<list_Input.length;i++)
		{
			list_Input[i].checked=false;
		}
		document.getElementById('div_SelectBox').style.top=document.getElementById('content_container').offsetTop + 0+'px';
		
		unhideComponent('background_selectBox');
		unhideComponent('div_SelectBox');
		
		var node, nodes;
		var div = document.getElementById('form_selectBox');
		if (!div) return;
		nodes = div.getElementsByTagName('*');
		if (!nodes) return;
		
		var i = nodes.length;
		while (i--){
			node = nodes[i];
			if(node.nodeName.toLowerCase() == 'div' ){
				hideComponent(node.id);
			}
			else if(node.nodeName.toLowerCase() == 'tr'){
				if(node.id !=''){
					hideComponent(node.id);
				}
			}
		}
		
		for(i=0; i<array_removedInsurances.length; i++){
			for(l=0;l<array_Id.length;l++){
				if(array_Id[l] ==array_removedInsurances[i]){	
					if(array_Flag[l]==0){
					unhideComponent("selectBox_"+array_removedInsurances[i]);
					unhideComponent('txtHeading_'+array_Id[l].split('_')[0]);
					}
				}
			}
		}
	}

	
	function addInsurancesFromSelectBox(){
		setDisabled('IAM_VWForm_Step1', false);
		setDisabled('IAM_VWForm2_Step1', false);
		for(i=0; i < questionIDs_SelectBox.length ; i++){
			var formInputObj=document.getElementById(questionIDs_SelectBox[i]); 
			if(formInputObj.checked){
				var chkBoxId= questionIDs_SelectBox[i];
				var chkBoxId_substr=chkBoxId[0].substring(6);
				var spanId='lbl_'+chkBoxId_substr; 
				var spanObj=document.getElementById(spanId); 
				var selected_Ins=spanObj.innerHTML; 
				for(j=0; j<insurances_Ids.length; j++){
					if(selected_Ins==insurances_Ids[j][0]){
						var id=insurances_Ids[j][1];
						var No_heading_product=chkBoxId_substr.substring(7,8);
						var heading_product="heading_product"+No_heading_product; 
						unhideComponent(heading_product);
						unhideComponent(id);
						for(l=0;l<array_Id.length;l++){
							if(array_Id[l] == id){	
								array_Flag[l]=1;
							}							
						}
					}
				}
			}
		}
		hideComponent('div_SelectBox');
		hideComponent('background_selectBox');
		if(count_selectBox==0){
			hideComponent('selectBox_link');
		}
	}
	
	function close_selectBox(){
		hideComponent('div_SelectBox');
		setDisabled('IAM_VWForm_Step1', false);
		setDisabled('IAM_VWForm2_Step1', false);
	}
	
	function setDisabled(id, disabled){
		if ( !document.getElementById || !document.getElementsByTagName) return;
		var nodesToDisable = {input :'',  select :'', a :'',span :'',img :''};
		var node, nodes;
		var div = document.getElementById(id);
		if (!div) return;
		nodes = div.getElementsByTagName('*');
		if (!nodes) return;
		
		var i = nodes.length;
		while (i--){
			node = nodes[i];
			if ( node.nodeName && node.nodeName.toLowerCase() in nodesToDisable ){
				if(node.nodeName.toLowerCase() == 'a' ){
				node.id='a_' + i;
				disableAnchor(document.getElementById(node.id), disabled);
				}
				else if(node.nodeName.toLowerCase() == 'span'){
					   if(node.id.substring(3,10)=="Product"){
						disableSpan(document.getElementById(node.id), disabled);
					  }
				}else if(node.nodeName.toLowerCase() == 'img'){
					   if(node.id.substring(8,15)=="Product"){
						disableImgTrash(document.getElementById(node.id), disabled);
					  }
				}
				else{
					node.disabled = disabled;
					node.style.background='#ffffff';
				}
			}
		}
	}

	function disableSpan(obj, disabled){
		if(disabled){
			var onclick = obj.getAttribute("onclick");
			if(onclick && onclick != "" && onclick != null){
				obj.setAttribute('click_bak', onclick);
				obj.setAttribute('onclick','return false;');
			}
			
			var onmouseover=obj.getAttribute("onmouseover");
			if(onmouseover && onmouseover != "" && onmouseover != null){
				obj.setAttribute('mouseover_bak', onmouseover);
				obj.setAttribute('onmouseover','return false;');
			}
		}
		else{
			var onclick_bak = obj.getAttribute("click_bak");
			if(onclick_bak && onclick_bak != "" && onclick_bak != null ){
				obj.setAttribute('onclick', obj.attributes['click_bak'].nodeValue);
			}
			var onmouseover_bak = obj.getAttribute("mouseover_bak");
			if(onmouseover_bak && onmouseover_bak != "" && onmouseover_bak != null ){
				obj.setAttribute('onmouseover', obj.attributes['mouseover_bak'].nodeValue);
			}
		}
	}
	
	function disableImgTrash(obj, disabled){
		if(disabled){
			var onclick_img = obj.getAttribute("onclick");
			if(onclick_img && onclick_img != "" && onclick_img != null){
				obj.setAttribute('click_bak_img', onclick_img);
				obj.setAttribute('onclick','return false;');
				
			}
			
		}
		else{
			var onclick_bak_img = obj.getAttribute("click_bak_img");
			if(onclick_bak_img && onclick_bak_img != "" && onclick_bak_img != null ){
				obj.setAttribute('onclick', obj.attributes['click_bak_img'].nodeValue);
			}
		}
	}
	
	function disableAnchor(obj, disable){
		if(obj.style.display != 'none'){
			if(disable){
				var href = obj.getAttribute("href");
				if(href && href != "" && href != null){
					obj.setAttribute('href_bak', href);
					obj.removeAttribute('href');
					obj.setAttribute('style',"text-decoration:none");
				}
			}
			else{
				var href_bak = obj.getAttribute("href_bak");
				if(href_bak && href_bak != "" && href_bak != null ){
					obj.setAttribute('href', obj.attributes['href_bak'].nodeValue);
					obj.setAttribute('style',"text-decoration:underline");
				}
			}
		}
	} 
	
	function createSessionData(){
		if(getFormParamforBranches()!=undefined)
		{
			param1=getFormParamforBranches()+'&';
			if(getFormParamforBranches() != 'over')
			{
				for(i=1;i<8;i++)
				{
					if(i<5)
					{	
						var obj_radioButton=document.getElementsByName('radioGrp'+i);
						var value_radioButton='';
						for(j=0;j<obj_radioButton.length;j++){
							if(obj_radioButton[j].checked){
								value_radioButton=obj_radioButton[j].value;
							}
						}
						if(value_radioButton == '1')
						{
							param1 += radioParams_Qsts[i-1]+'=ja&';
						}
						else if (value_radioButton == ''){}
						else
						{
							param1 += radioParams_Qsts[i-1]+'=nee&';
						}
					}	
					else
					{
						if(document.getElementById('question'+(i+1)).checked){
							param1 += radioParams_Qsts[i-1]+'=ja&'; 
						}
						else{
							param1 += radioParams_Qsts[i-1]+'=nee&';
						}
					}
				}	
				for(i=0;i<array_Id.length;i++)
				{	
					if((array_Id[i]==listOfFormParams_Insurances[i][0].substring(10))  &&  ((array_Flag[i] == 1)||(array_Flag[i] == 3)))
					{
						param1 += listOfFormParams_Insurances[i][2] +'=ja&';
					}
				}
			}	
		}
	}

	function gotoFormPage(){
		createSessionData();
		location.href=strURL_formPage+'?'+param1;
		return false;	
	}
	function storeInputValues(id)
	{	var selectObject=document.getElementById("selBranch_Step1");
		var chosenOption=selectObject.selectedIndex;
		
		if(id=="a")
		{
		var selectObject=document.getElementById("selBranch_Step1");
		chosenOption=selectObject.selectedIndex;
		}
		if(id=="divQuestion3"){
		radioGrp1Value = "1"+getRadioValue(fo.radioGrp1)+"_";
		}
		if(id=="divQuestion4"){
		radioGrp2Value = "2"+getRadioValue(fo.radioGrp2)+"_";
		}
		if(id=="divQuestion5"){
		radioGrp3Value = "3"+getRadioValue(fo.radioGrp3)+"_";
		}
		if(id=="divQuestion6"){
		radioGrp4Value = "4"+getRadioValue(fo.radioGrp4)+"_";
		}
		if(id=="6" && document.getElementById('question6').checked==true){
		checkBox1Value = "51_";
		}
		else if(id=="6" && document.getElementById('question6').checked==false){
		checkBox1Value = "50_";
		}
		if(id=="7" && document.getElementById('question7').checked==true){
		checkBox2Value = "61_";
		}
		else if(id=="7" && document.getElementById('question7').checked==false){
		checkBox2Value = "60_";
		}
		if(id=="8" && document.getElementById('question8').checked==true){
		checkBox3Value = "71_";
		}
		else if(id=="8" && document.getElementById('question8').checked==false){
		checkBox3Value = "70_";
		}
		window.location.hash =radioGrp1Value+radioGrp2Value+radioGrp3Value+radioGrp4Value+checkBox1Value+checkBox2Value+checkBox3Value+chosenOption;
		
	}
	function fillStoreValues()
	{
		
		if(window.location.hash != '')
		{
			var storedValue = window.location.hash;
			var startIndex=storedValue.indexOf('#');
			var selectedObjectValue = storedValue.substring(startIndex+22);
			selectedObjectValue = parseInt(selectedObjectValue);
			var storedRadioGrp1Value= storedValue.substring(startIndex+1,3);
			var storedRadioGrp2Value= storedValue.substring(startIndex+4,6);
			var storedRadioGrp3Value= storedValue.substring(startIndex+7,9);
			var storedRadioGrp4Value= storedValue.substring(startIndex+10,12);
			var storedCheckBox1Value= storedValue.substring(startIndex+13,15);
			var storedCheckBox2Value= storedValue.substring(startIndex+16,18);
			var storedCheckBox3Value= storedValue.substring(startIndex+19,21);
			
			var selectObject=document.getElementById("selBranch_Step1");
			selectObject.selectedIndex = selectedObjectValue;
			showNextQst_FormforBranches('divQuestion2',getFormParamforBranches());
			if(selectedObjectValue==selectObject.selectedIndex)
			{
				if(storedRadioGrp1Value == "11")
				{
					hashFlag=1;
					unhideComponent('divQuestion2');
					fo.radioGrp1[0].checked = true;
					showNextQst_Form('divQuestion3',getFormParamforQsts('question2a', 2));
				}
				else if(storedRadioGrp1Value == "12")
				{
					hashFlag=1;
					unhideComponent('divQuestion2');
					fo.radioGrp1[1].checked = true;
					showNextQst_Form('divQuestion3',getFormParamforQsts('question2b', 2));
				}
				if(storedRadioGrp2Value == "21")
				{
					hashFlag=1;
					unhideComponent('divQuestion3');
					fo.radioGrp2[0].checked = true;
					showNextQst_Form('divQuestion4',getFormParamforQsts('question3a', 3));
				}
				else if(storedRadioGrp2Value == "22")
				{
					hashFlag=1;
					unhideComponent('divQuestion3');
					fo.radioGrp2[1].checked = true;
					showNextQst_Form('divQuestion4',getFormParamforQsts('question3b', 3));
				}
				if(storedRadioGrp3Value == "31")
				{
					hashFlag=1;
					unhideComponent('divQuestion4');
					fo.radioGrp3[0].checked = true;
					showNextQst_Form('divQuestion5',getFormParamforQsts('question4a', 4));
				}
				else if(storedRadioGrp3Value == "32")
				{
					hashFlag=1;
					unhideComponent('divQuestion4');
					fo.radioGrp3[1].checked = true;
					showNextQst_Form('divQuestion5',getFormParamforQsts('question4b', 4));
				}
				if(storedRadioGrp4Value == "41")
				{
					hashFlag=1;
					unhideComponent('divQuestion5');
					fo.radioGrp4[0].checked = true;
					showNextQst_Form('divQuestion6',getFormParamforQsts('question5a', 5));
				}
				else if(storedRadioGrp4Value == "42")
				{
					hashFlag=1;
					unhideComponent('divQuestion5');
					fo.radioGrp4[1].checked = true;
					showNextQst_Form('divQuestion6',getFormParamforQsts('question5b', 5));
				}
				if(storedCheckBox1Value=="51")
				{
					hashFlag=1;
					unhideComponent('divQuestion6');
					document.getElementById('question6').checked=true;
					showNextQst_Form('',getFormParamforQsts('question6', 6));
				}
				else if(storedCheckBox1Value=="50")
				{
					hashFlag=1;
					document.getElementById('question6').checked=false;
					showNextQst_Form('',getFormParamforQsts('question6', 6));
				}
				if(storedCheckBox2Value=="61")
				{
					hashFlag=1;
					unhideComponent('divQuestion7');
					document.getElementById('question7').checked=true;
					showNextQst_Form('',getFormParamforQsts('question7', 7));
				}
				else if(storedCheckBox2Value=="60")
				{
					hashFlag=1;
					document.getElementById('question7').checked=false;
					showNextQst_Form('',getFormParamforQsts('question7', 7));
				}
				if(storedCheckBox3Value=="71")
				{
					hashFlag=1;
					unhideComponent('divQuestion8');
					document.getElementById('question8').checked=true;
					showNextQst_Form('',getFormParamforQsts('question8', 8));
				}
				else if(storedCheckBox3Value=="70")
				{
					hashFlag=1;
					document.getElementById('question8').checked=false;
					showNextQst_Form('',getFormParamforQsts('question8', 8));
				}
			}
	
		}
	}
