<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="https://ba.pfcd.ca/sitemaps_xsl.xsl"?><urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript">
		jQuery(document).ready(function($){
		    //IGS-1188 -- START
			var desc_rev = '_45_32';
			var desc_emp = '_45_35';
			var desc_inv = '_45_30';
			var desc_int = '_45_31';
			var tract_id = '_45_52';
			var form_id = '45';
			var trac_id = $('#input'+tract_id).val();
			var cp_ids = '_45_50';
			var cp_id = $('#input'+cp_ids).val();
			
			if(form_id == '11' || form_id == '25' || form_id == '26' || form_id == '27' || form_id == '28' || form_id == '33' || form_id == '34' || form_id == '35' || form_id == '36' || form_id == '42' || form_id == '45'){
				var sec_rev = document.getElementById("gfield_description"+desc_rev).innerHTML;
				var sec_rev = sec_rev.replace("tractid", trac_id);
				var sec_rev = sec_rev.replace("cps_id", cp_id);
				document.getElementById("gfield_description"+desc_rev).innerHTML = sec_rev;
				
				var sec_emp = document.getElementById("gfield_description"+desc_emp).innerHTML;
				var sec_emp = sec_emp.replace("tractid", trac_id);
				document.getElementById("gfield_description"+desc_emp).innerHTML = sec_emp;
				
				var sec_inv = document.getElementById("gfield_description"+desc_inv).innerHTML;
    			var sec_inv = sec_inv.replace("tractid", trac_id);
    			var sec_inv = sec_inv.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_inv).innerHTML = sec_inv;
    			
    			var sec_int = document.getElementById("gfield_description"+desc_int).innerHTML;
    			var sec_int = sec_int.replace("tractid", trac_id);
    			var sec_int = sec_int.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_int).innerHTML = sec_int;
			}
			//IGS-1188 -- END
				
			var ip_id = '_45_29';
			var inv_id = '_45_28';
			var invmt_id = '28';
			var intel_id = '29';
			var form_id = '45';
			var page_id = '';
			var rev_id = '';
			var emp_id = '';
			setReadonly();
			function formatDate(date) {
				var d = new Date(date),
					month = '' + (d.getMonth() + 1),
					day = '' + d.getDate(),
					year = d.getFullYear();
				if (month.length < 2) month = '0' + month;
				if (day.length < 2) day = '0' + day;
				return [year, month, day].join('-');
			}
			function setReadonly(){
			    if(form_id == 1 || form_id == 5 || form_id == 6 || form_id == 7 || form_id == 8 || form_id == 10 || form_id == 32 || form_id == 40  || form_id == 44){
					$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						var id = currentElement.closest("div").find("input").val();
						if(id !=''){
						currentElement.closest("div").find("input").prop('disabled', true);
						currentElement.closest("div").find("select").prop('disabled', true);
						}else{
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
						}
						$(currentElement.closest("div").find("input")).each(function(key, val) {
							if(key == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
								//$(this).attr('style','display:none;');
								$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
								if($check_inv_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
								}
								var date_today = new Date();
								var previousMonth = date_today.getMonth() - 1;
								var today = new Date(date_today.getFullYear(), previousMonth, 1);
								var yyyy = today.getFullYear();
								var mm = today.getMonth() + 1; // Months start at 0!
								var dd = today.getDate();
				
								if (dd < 10) dd = '0' + dd;
								if (mm < 10) mm = '0' + mm;
				
								var formattedToday = mm + '/' + dd + '/' + yyyy;
								var value = formatDate(formattedToday);
								//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
							}
						});
					});
					if(form_id != 32){
						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
									//$(this).attr('style','display:none;');
									$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
									if($check_ip_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
									}
									var date_today = new Date();
									var previousMonth = date_today.getMonth() - 1;
									var today = new Date(date_today.getFullYear(), previousMonth, 1);
									var yyyy = today.getFullYear();
									var mm = today.getMonth() + 1; // Months start at 0!
									var dd = today.getDate();

									if (dd < 10) dd = '0' + dd;
									if (mm < 10) mm = '0' + mm;

									var formattedToday = mm + '/' + dd + '/' + yyyy;
									var value = formatDate(formattedToday);
									//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}else{
					if(form_id != 36){
						$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key, val) {
								if(key == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
										if($check_inv_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});

						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
										if($check_ip_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}
			}
					
			//IGS-1225 -- START
			var date_today = new Date();
			var previousMonth = date_today.getMonth() - 1;
			var today = new Date(date_today.getFullYear(), previousMonth, 1);
			var yyyy = today.getFullYear();
			var mm = today.getMonth() + 1; // Months start at 0!
			var dd = today.getDate();
			if (dd < 10) dd = '0' + dd;
			if (mm < 10) mm = '0' + mm;
			var formattedToday = mm + '/' + dd + '/' + yyyy;
			var date_value = formatDate(formattedToday);
			function investmentListFunc(){
				$('#field'+inv_id+' .gfield_list_group').each(function(index) {
				    if(form_id == 36){
						var cellTypeIndex = 2;
						var celldateIndex = 0;
						var cellOtherIndex = 5;
					}else{
						var cellTypeIndex = 3;
						var celldateIndex = 2;
						var cellOtherIndex = 6;
					}
					$(this).closest("div").attr('id', 'inv'+index);
					var investmentTypeSelect = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellTypeIndex);
					var investmentTypedate = $(this).find('.gfield_list_'+invmt_id+'_cell'+celldateIndex);
					var ifOtherInput = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex);
					investmentTypeSelect.attr('id', 'investment_type_' + index);
					investmentTypedate.attr('id', 'investment_date_' + index);
					ifOtherInput.attr('id', 'if_invother_' + index);		
					var other = 0;
					var inves_date = 0;
					var invest_type = $('#investment_type_'+index+' select').val();
				
					if(invest_type == 'Other'){
						$('#if_invother_'+index+' input').css('display', 'block');
					}else{
						$('#if_invother_'+index+' input').css('display', 'none');
					}
					$('#investment_type_'+index).change(function(){
						$('#investment_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	inves_date++;
							//}
						});
						//if(inves_date != 0){
						//	$('#investment_date_'+index+' input').val(date_value);
						//}else{
						//	$('#investment_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_invother_'+index+' input').css('display', 'block');
						}else{
							$('#if_invother_'+index+' input').css('display', 'none');
						}
						other = 0;
						inves_date = 0;
					});
					var inves = 0;

					$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							inves++;
						}
						if(inves > 0){
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
						}
					});
					var inves_chg = 0;
					$('#investment_type_'+index+' select').change(function(){
						$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								inves_chg++;
							}
							if(inves_chg > 0){
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
							}
						});
						inves_chg = 0;
					});
				});
			}
			if(form_id != 18){
				investmentListFunc();
				$('body').on('click', "#field"+inv_id+" .add_list_item", function() {
					investmentListFunc();
				});
			}
			intellactListFunc();
			$('body').on('click', "#field"+ip_id+" .add_list_item", function() {
			    intellactListFunc();
			});
			function intellactListFunc(){
				$('#field'+ip_id+' .gfield_list_group').each(function(index) {
					if(form_id == 36){
						var cellIpTypeIndex = 4;
						var cellIpdateIndex = 0;
						var cellIPOtherIndex = 5;
						var cellCountry = 2;
						var cellCountryOther = 3;
					}else{
						var cellIpTypeIndex = 5;
						var cellIpdateIndex = 2;
						var cellIPOtherIndex = 6;
						var cellCountry = 3;
						var cellCountryOther = 4;
					}
				    $(this).closest("div").attr('id', 'inv'+index);
					//IP Type dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).attr('id', 'intellact_type_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).attr('id', 'if_other_' + index);
					var intellTypedate = $(this).find('.gfield_list_'+intel_id+'_cell'+cellIpdateIndex);
					intellTypedate.attr('id', 'intell_date_' + index);
					
					var intel_type = $('#intellact_type_'+index+' select').val();
					if(intel_type == 'Other'){
						$('#if_other_'+index+' input').css('display', 'block');
					}else{
						$('#if_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					var intellact_date = 0;
					$('#intellact_type_'+index).change(function(){
						$('#intellact_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	intellact_date++;
							//}
						});
						//if(intellact_date != 0){
						//	$('#intell_date_'+index+' input').val(date_value);
						//}else{
						//	$('#intell_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_other_'+index+' input').css('display', 'block');
						}else{
							$('#if_other_'+index+' input').css('display', 'none');
						}
						other = 0; intellact_date = 0;
					});
					var intell = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intell++;
						}
						if(intell > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
						}
					});
					var intell_chg = 0;
					$('#intellact_type_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intell_chg++;
							}
							if(intell_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
							}
						});
						intell_chg = 0;
					});
					//IP Type dependent -- END
					//IP Country dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountry).attr('id', 'country_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountryOther).attr('id', 'cnt_other_' + index);					
					var intcnt_type = $('#country_'+index+' select').val();
					if(intcnt_type == 'Other'){
						$('#cnt_other_'+index+' input').css('display', 'block');
					}else{
						$('#cnt_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					$('#country_'+index).change(function(){
						$('#country_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
						});
						if(other > '0'){
							$('#cnt_other_'+index+' input').css('display', 'block');
						}else{
							$('#cnt_other_'+index+' input').css('display', 'none');
						}
						other = 0;
					});
					var intcnt = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intcnt++;
						}
						if(intcnt > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
						}
					});
					var intcnt_chg = 0;
					$('#country_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intcnt_chg++;
							}
							if(intcnt_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
							}
						});
						intcnt_chg = 0;
					});
					//IP Country dependent -- END
				});
			}
			//IGS-1225 -- END
			function removeReadonly(){
				$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
					var currentElement = $(this);
					currentElement.closest("div").find("input").prop('disabled', false);
					currentElement.closest("div").find("select").prop('disabled', false);
				});
				var form_id = '45';
				if(form_id != 32){
					$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
					});
				}
			}
			$('.add_list_item').click(function(){
			    setReadonly();
			});			
			$('#gform_submit_button_'+form_id+'').click(function(){
				removeReadonly();
			});
			var form_id = '45';
			$("body").prepend('<div id="overlay" class="ui-widget-overlay" style="z-index: 1001; display: none;"></div>');
			$("body").prepend("<div id='PleaseWait' style='display: none;position: fixed;top: 0px;z-index: 30001;left: 50%;top: 50%;'><img src='https://boundlessaccelerator.ca/wp-content/themes/Divi-Child/images/loading.gif'/></div>");
			$('#gform_submit_button_'+form_id+'').click(function(){
				$("#overlay, #PleaseWait").show();
				setTimeout(function () {
                    $("#overlay, #PleaseWait").hide();
                }, 5000);
			});
		});
	</script>
	
<url>
<loc>https://ba.pfcd.ca/traction-survey-sip/</loc>
<lastmod>2026-03-23T06:15:36-04:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/sip-application-form/thank-you/</loc>
<lastmod>2026-02-23T03:44:36-05:00</lastmod></url>	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript">
		jQuery(document).ready(function($){
		    //IGS-1188 -- START
			var desc_rev = '';
			var desc_emp = '';
			var desc_inv = '_44_99';
			var desc_int = '_44_106';
			var tract_id = '';
			var form_id = '44';
			var trac_id = $('#input'+tract_id).val();
			var cp_ids = '_44_209';
			var cp_id = $('#input'+cp_ids).val();
			
			if(form_id == '11' || form_id == '25' || form_id == '26' || form_id == '27' || form_id == '28' || form_id == '33' || form_id == '34' || form_id == '35' || form_id == '36' || form_id == '42' || form_id == '45'){
				var sec_rev = document.getElementById("gfield_description"+desc_rev).innerHTML;
				var sec_rev = sec_rev.replace("tractid", trac_id);
				var sec_rev = sec_rev.replace("cps_id", cp_id);
				document.getElementById("gfield_description"+desc_rev).innerHTML = sec_rev;
				
				var sec_emp = document.getElementById("gfield_description"+desc_emp).innerHTML;
				var sec_emp = sec_emp.replace("tractid", trac_id);
				document.getElementById("gfield_description"+desc_emp).innerHTML = sec_emp;
				
				var sec_inv = document.getElementById("gfield_description"+desc_inv).innerHTML;
    			var sec_inv = sec_inv.replace("tractid", trac_id);
    			var sec_inv = sec_inv.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_inv).innerHTML = sec_inv;
    			
    			var sec_int = document.getElementById("gfield_description"+desc_int).innerHTML;
    			var sec_int = sec_int.replace("tractid", trac_id);
    			var sec_int = sec_int.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_int).innerHTML = sec_int;
			}
			//IGS-1188 -- END
				
			var ip_id = '_44_159';
			var inv_id = '_44_158';
			var invmt_id = '158';
			var intel_id = '159';
			var form_id = '44';
			var page_id = '';
			var rev_id = '';
			var emp_id = '';
			setReadonly();
			function formatDate(date) {
				var d = new Date(date),
					month = '' + (d.getMonth() + 1),
					day = '' + d.getDate(),
					year = d.getFullYear();
				if (month.length < 2) month = '0' + month;
				if (day.length < 2) day = '0' + day;
				return [year, month, day].join('-');
			}
			function setReadonly(){
			    if(form_id == 1 || form_id == 5 || form_id == 6 || form_id == 7 || form_id == 8 || form_id == 10 || form_id == 32 || form_id == 40  || form_id == 44){
					$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						var id = currentElement.closest("div").find("input").val();
						if(id !=''){
						currentElement.closest("div").find("input").prop('disabled', true);
						currentElement.closest("div").find("select").prop('disabled', true);
						}else{
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
						}
						$(currentElement.closest("div").find("input")).each(function(key, val) {
							if(key == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
								//$(this).attr('style','display:none;');
								$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
								if($check_inv_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
								}
								var date_today = new Date();
								var previousMonth = date_today.getMonth() - 1;
								var today = new Date(date_today.getFullYear(), previousMonth, 1);
								var yyyy = today.getFullYear();
								var mm = today.getMonth() + 1; // Months start at 0!
								var dd = today.getDate();
				
								if (dd < 10) dd = '0' + dd;
								if (mm < 10) mm = '0' + mm;
				
								var formattedToday = mm + '/' + dd + '/' + yyyy;
								var value = formatDate(formattedToday);
								//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
							}
						});
					});
					if(form_id != 32){
						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
									//$(this).attr('style','display:none;');
									$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
									if($check_ip_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
									}
									var date_today = new Date();
									var previousMonth = date_today.getMonth() - 1;
									var today = new Date(date_today.getFullYear(), previousMonth, 1);
									var yyyy = today.getFullYear();
									var mm = today.getMonth() + 1; // Months start at 0!
									var dd = today.getDate();

									if (dd < 10) dd = '0' + dd;
									if (mm < 10) mm = '0' + mm;

									var formattedToday = mm + '/' + dd + '/' + yyyy;
									var value = formatDate(formattedToday);
									//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}else{
					if(form_id != 36){
						$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key, val) {
								if(key == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
										if($check_inv_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});

						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
										if($check_ip_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}
			}
					
			//IGS-1225 -- START
			var date_today = new Date();
			var previousMonth = date_today.getMonth() - 1;
			var today = new Date(date_today.getFullYear(), previousMonth, 1);
			var yyyy = today.getFullYear();
			var mm = today.getMonth() + 1; // Months start at 0!
			var dd = today.getDate();
			if (dd < 10) dd = '0' + dd;
			if (mm < 10) mm = '0' + mm;
			var formattedToday = mm + '/' + dd + '/' + yyyy;
			var date_value = formatDate(formattedToday);
			function investmentListFunc(){
				$('#field'+inv_id+' .gfield_list_group').each(function(index) {
				    if(form_id == 36){
						var cellTypeIndex = 2;
						var celldateIndex = 0;
						var cellOtherIndex = 5;
					}else{
						var cellTypeIndex = 3;
						var celldateIndex = 2;
						var cellOtherIndex = 6;
					}
					$(this).closest("div").attr('id', 'inv'+index);
					var investmentTypeSelect = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellTypeIndex);
					var investmentTypedate = $(this).find('.gfield_list_'+invmt_id+'_cell'+celldateIndex);
					var ifOtherInput = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex);
					investmentTypeSelect.attr('id', 'investment_type_' + index);
					investmentTypedate.attr('id', 'investment_date_' + index);
					ifOtherInput.attr('id', 'if_invother_' + index);		
					var other = 0;
					var inves_date = 0;
					var invest_type = $('#investment_type_'+index+' select').val();
				
					if(invest_type == 'Other'){
						$('#if_invother_'+index+' input').css('display', 'block');
					}else{
						$('#if_invother_'+index+' input').css('display', 'none');
					}
					$('#investment_type_'+index).change(function(){
						$('#investment_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	inves_date++;
							//}
						});
						//if(inves_date != 0){
						//	$('#investment_date_'+index+' input').val(date_value);
						//}else{
						//	$('#investment_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_invother_'+index+' input').css('display', 'block');
						}else{
							$('#if_invother_'+index+' input').css('display', 'none');
						}
						other = 0;
						inves_date = 0;
					});
					var inves = 0;

					$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							inves++;
						}
						if(inves > 0){
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
						}
					});
					var inves_chg = 0;
					$('#investment_type_'+index+' select').change(function(){
						$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								inves_chg++;
							}
							if(inves_chg > 0){
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
							}
						});
						inves_chg = 0;
					});
				});
			}
			if(form_id != 18){
				investmentListFunc();
				$('body').on('click', "#field"+inv_id+" .add_list_item", function() {
					investmentListFunc();
				});
			}
			intellactListFunc();
			$('body').on('click', "#field"+ip_id+" .add_list_item", function() {
			    intellactListFunc();
			});
			function intellactListFunc(){
				$('#field'+ip_id+' .gfield_list_group').each(function(index) {
					if(form_id == 36){
						var cellIpTypeIndex = 4;
						var cellIpdateIndex = 0;
						var cellIPOtherIndex = 5;
						var cellCountry = 2;
						var cellCountryOther = 3;
					}else{
						var cellIpTypeIndex = 5;
						var cellIpdateIndex = 2;
						var cellIPOtherIndex = 6;
						var cellCountry = 3;
						var cellCountryOther = 4;
					}
				    $(this).closest("div").attr('id', 'inv'+index);
					//IP Type dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).attr('id', 'intellact_type_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).attr('id', 'if_other_' + index);
					var intellTypedate = $(this).find('.gfield_list_'+intel_id+'_cell'+cellIpdateIndex);
					intellTypedate.attr('id', 'intell_date_' + index);
					
					var intel_type = $('#intellact_type_'+index+' select').val();
					if(intel_type == 'Other'){
						$('#if_other_'+index+' input').css('display', 'block');
					}else{
						$('#if_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					var intellact_date = 0;
					$('#intellact_type_'+index).change(function(){
						$('#intellact_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	intellact_date++;
							//}
						});
						//if(intellact_date != 0){
						//	$('#intell_date_'+index+' input').val(date_value);
						//}else{
						//	$('#intell_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_other_'+index+' input').css('display', 'block');
						}else{
							$('#if_other_'+index+' input').css('display', 'none');
						}
						other = 0; intellact_date = 0;
					});
					var intell = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intell++;
						}
						if(intell > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
						}
					});
					var intell_chg = 0;
					$('#intellact_type_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intell_chg++;
							}
							if(intell_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
							}
						});
						intell_chg = 0;
					});
					//IP Type dependent -- END
					//IP Country dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountry).attr('id', 'country_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountryOther).attr('id', 'cnt_other_' + index);					
					var intcnt_type = $('#country_'+index+' select').val();
					if(intcnt_type == 'Other'){
						$('#cnt_other_'+index+' input').css('display', 'block');
					}else{
						$('#cnt_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					$('#country_'+index).change(function(){
						$('#country_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
						});
						if(other > '0'){
							$('#cnt_other_'+index+' input').css('display', 'block');
						}else{
							$('#cnt_other_'+index+' input').css('display', 'none');
						}
						other = 0;
					});
					var intcnt = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intcnt++;
						}
						if(intcnt > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
						}
					});
					var intcnt_chg = 0;
					$('#country_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intcnt_chg++;
							}
							if(intcnt_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
							}
						});
						intcnt_chg = 0;
					});
					//IP Country dependent -- END
				});
			}
			//IGS-1225 -- END
			function removeReadonly(){
				$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
					var currentElement = $(this);
					currentElement.closest("div").find("input").prop('disabled', false);
					currentElement.closest("div").find("select").prop('disabled', false);
				});
				var form_id = '44';
				if(form_id != 32){
					$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
					});
				}
			}
			$('.add_list_item').click(function(){
			    setReadonly();
			});			
			$('#gform_submit_button_'+form_id+'').click(function(){
				removeReadonly();
			});
			var form_id = '44';
			$("body").prepend('<div id="overlay" class="ui-widget-overlay" style="z-index: 1001; display: none;"></div>');
			$("body").prepend("<div id='PleaseWait' style='display: none;position: fixed;top: 0px;z-index: 30001;left: 50%;top: 50%;'><img src='https://boundlessaccelerator.ca/wp-content/themes/Divi-Child/images/loading.gif'/></div>");
			$('#gform_submit_button_'+form_id+'').click(function(){
				$("#overlay, #PleaseWait").show();
				setTimeout(function () {
                    $("#overlay, #PleaseWait").hide();
                }, 5000);
			});
		});
	</script>
	
<url>
<loc>https://ba.pfcd.ca/sip-application-form/</loc>
<lastmod>2026-02-22T23:31:44-05:00</lastmod></url>	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript">
		jQuery(document).ready(function($){
		    //IGS-1188 -- START
			var desc_rev = '_42_32';
			var desc_emp = '_42_35';
			var desc_inv = '_42_30';
			var desc_int = '_42_31';
			var tract_id = '_42_52';
			var form_id = '42';
			var trac_id = $('#input'+tract_id).val();
			var cp_ids = '_42_50';
			var cp_id = $('#input'+cp_ids).val();
			
			if(form_id == '11' || form_id == '25' || form_id == '26' || form_id == '27' || form_id == '28' || form_id == '33' || form_id == '34' || form_id == '35' || form_id == '36' || form_id == '42' || form_id == '45'){
				var sec_rev = document.getElementById("gfield_description"+desc_rev).innerHTML;
				var sec_rev = sec_rev.replace("tractid", trac_id);
				var sec_rev = sec_rev.replace("cps_id", cp_id);
				document.getElementById("gfield_description"+desc_rev).innerHTML = sec_rev;
				
				var sec_emp = document.getElementById("gfield_description"+desc_emp).innerHTML;
				var sec_emp = sec_emp.replace("tractid", trac_id);
				document.getElementById("gfield_description"+desc_emp).innerHTML = sec_emp;
				
				var sec_inv = document.getElementById("gfield_description"+desc_inv).innerHTML;
    			var sec_inv = sec_inv.replace("tractid", trac_id);
    			var sec_inv = sec_inv.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_inv).innerHTML = sec_inv;
    			
    			var sec_int = document.getElementById("gfield_description"+desc_int).innerHTML;
    			var sec_int = sec_int.replace("tractid", trac_id);
    			var sec_int = sec_int.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_int).innerHTML = sec_int;
			}
			//IGS-1188 -- END
				
			var ip_id = '_42_29';
			var inv_id = '_42_28';
			var invmt_id = '28';
			var intel_id = '29';
			var form_id = '42';
			var page_id = '';
			var rev_id = '';
			var emp_id = '';
			setReadonly();
			function formatDate(date) {
				var d = new Date(date),
					month = '' + (d.getMonth() + 1),
					day = '' + d.getDate(),
					year = d.getFullYear();
				if (month.length < 2) month = '0' + month;
				if (day.length < 2) day = '0' + day;
				return [year, month, day].join('-');
			}
			function setReadonly(){
			    if(form_id == 1 || form_id == 5 || form_id == 6 || form_id == 7 || form_id == 8 || form_id == 10 || form_id == 32 || form_id == 40  || form_id == 44){
					$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						var id = currentElement.closest("div").find("input").val();
						if(id !=''){
						currentElement.closest("div").find("input").prop('disabled', true);
						currentElement.closest("div").find("select").prop('disabled', true);
						}else{
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
						}
						$(currentElement.closest("div").find("input")).each(function(key, val) {
							if(key == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
								//$(this).attr('style','display:none;');
								$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
								if($check_inv_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
								}
								var date_today = new Date();
								var previousMonth = date_today.getMonth() - 1;
								var today = new Date(date_today.getFullYear(), previousMonth, 1);
								var yyyy = today.getFullYear();
								var mm = today.getMonth() + 1; // Months start at 0!
								var dd = today.getDate();
				
								if (dd < 10) dd = '0' + dd;
								if (mm < 10) mm = '0' + mm;
				
								var formattedToday = mm + '/' + dd + '/' + yyyy;
								var value = formatDate(formattedToday);
								//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
							}
						});
					});
					if(form_id != 32){
						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
									//$(this).attr('style','display:none;');
									$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
									if($check_ip_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
									}
									var date_today = new Date();
									var previousMonth = date_today.getMonth() - 1;
									var today = new Date(date_today.getFullYear(), previousMonth, 1);
									var yyyy = today.getFullYear();
									var mm = today.getMonth() + 1; // Months start at 0!
									var dd = today.getDate();

									if (dd < 10) dd = '0' + dd;
									if (mm < 10) mm = '0' + mm;

									var formattedToday = mm + '/' + dd + '/' + yyyy;
									var value = formatDate(formattedToday);
									//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}else{
					if(form_id != 36){
						$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key, val) {
								if(key == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
										if($check_inv_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});

						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
										if($check_ip_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}
			}
					
			//IGS-1225 -- START
			var date_today = new Date();
			var previousMonth = date_today.getMonth() - 1;
			var today = new Date(date_today.getFullYear(), previousMonth, 1);
			var yyyy = today.getFullYear();
			var mm = today.getMonth() + 1; // Months start at 0!
			var dd = today.getDate();
			if (dd < 10) dd = '0' + dd;
			if (mm < 10) mm = '0' + mm;
			var formattedToday = mm + '/' + dd + '/' + yyyy;
			var date_value = formatDate(formattedToday);
			function investmentListFunc(){
				$('#field'+inv_id+' .gfield_list_group').each(function(index) {
				    if(form_id == 36){
						var cellTypeIndex = 2;
						var celldateIndex = 0;
						var cellOtherIndex = 5;
					}else{
						var cellTypeIndex = 3;
						var celldateIndex = 2;
						var cellOtherIndex = 6;
					}
					$(this).closest("div").attr('id', 'inv'+index);
					var investmentTypeSelect = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellTypeIndex);
					var investmentTypedate = $(this).find('.gfield_list_'+invmt_id+'_cell'+celldateIndex);
					var ifOtherInput = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex);
					investmentTypeSelect.attr('id', 'investment_type_' + index);
					investmentTypedate.attr('id', 'investment_date_' + index);
					ifOtherInput.attr('id', 'if_invother_' + index);		
					var other = 0;
					var inves_date = 0;
					var invest_type = $('#investment_type_'+index+' select').val();
				
					if(invest_type == 'Other'){
						$('#if_invother_'+index+' input').css('display', 'block');
					}else{
						$('#if_invother_'+index+' input').css('display', 'none');
					}
					$('#investment_type_'+index).change(function(){
						$('#investment_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	inves_date++;
							//}
						});
						//if(inves_date != 0){
						//	$('#investment_date_'+index+' input').val(date_value);
						//}else{
						//	$('#investment_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_invother_'+index+' input').css('display', 'block');
						}else{
							$('#if_invother_'+index+' input').css('display', 'none');
						}
						other = 0;
						inves_date = 0;
					});
					var inves = 0;

					$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							inves++;
						}
						if(inves > 0){
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
						}
					});
					var inves_chg = 0;
					$('#investment_type_'+index+' select').change(function(){
						$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								inves_chg++;
							}
							if(inves_chg > 0){
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
							}
						});
						inves_chg = 0;
					});
				});
			}
			if(form_id != 18){
				investmentListFunc();
				$('body').on('click', "#field"+inv_id+" .add_list_item", function() {
					investmentListFunc();
				});
			}
			intellactListFunc();
			$('body').on('click', "#field"+ip_id+" .add_list_item", function() {
			    intellactListFunc();
			});
			function intellactListFunc(){
				$('#field'+ip_id+' .gfield_list_group').each(function(index) {
					if(form_id == 36){
						var cellIpTypeIndex = 4;
						var cellIpdateIndex = 0;
						var cellIPOtherIndex = 5;
						var cellCountry = 2;
						var cellCountryOther = 3;
					}else{
						var cellIpTypeIndex = 5;
						var cellIpdateIndex = 2;
						var cellIPOtherIndex = 6;
						var cellCountry = 3;
						var cellCountryOther = 4;
					}
				    $(this).closest("div").attr('id', 'inv'+index);
					//IP Type dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).attr('id', 'intellact_type_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).attr('id', 'if_other_' + index);
					var intellTypedate = $(this).find('.gfield_list_'+intel_id+'_cell'+cellIpdateIndex);
					intellTypedate.attr('id', 'intell_date_' + index);
					
					var intel_type = $('#intellact_type_'+index+' select').val();
					if(intel_type == 'Other'){
						$('#if_other_'+index+' input').css('display', 'block');
					}else{
						$('#if_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					var intellact_date = 0;
					$('#intellact_type_'+index).change(function(){
						$('#intellact_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	intellact_date++;
							//}
						});
						//if(intellact_date != 0){
						//	$('#intell_date_'+index+' input').val(date_value);
						//}else{
						//	$('#intell_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_other_'+index+' input').css('display', 'block');
						}else{
							$('#if_other_'+index+' input').css('display', 'none');
						}
						other = 0; intellact_date = 0;
					});
					var intell = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intell++;
						}
						if(intell > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
						}
					});
					var intell_chg = 0;
					$('#intellact_type_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intell_chg++;
							}
							if(intell_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
							}
						});
						intell_chg = 0;
					});
					//IP Type dependent -- END
					//IP Country dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountry).attr('id', 'country_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountryOther).attr('id', 'cnt_other_' + index);					
					var intcnt_type = $('#country_'+index+' select').val();
					if(intcnt_type == 'Other'){
						$('#cnt_other_'+index+' input').css('display', 'block');
					}else{
						$('#cnt_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					$('#country_'+index).change(function(){
						$('#country_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
						});
						if(other > '0'){
							$('#cnt_other_'+index+' input').css('display', 'block');
						}else{
							$('#cnt_other_'+index+' input').css('display', 'none');
						}
						other = 0;
					});
					var intcnt = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intcnt++;
						}
						if(intcnt > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
						}
					});
					var intcnt_chg = 0;
					$('#country_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intcnt_chg++;
							}
							if(intcnt_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
							}
						});
						intcnt_chg = 0;
					});
					//IP Country dependent -- END
				});
			}
			//IGS-1225 -- END
			function removeReadonly(){
				$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
					var currentElement = $(this);
					currentElement.closest("div").find("input").prop('disabled', false);
					currentElement.closest("div").find("select").prop('disabled', false);
				});
				var form_id = '42';
				if(form_id != 32){
					$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
					});
				}
			}
			$('.add_list_item').click(function(){
			    setReadonly();
			});			
			$('#gform_submit_button_'+form_id+'').click(function(){
				removeReadonly();
			});
			var form_id = '42';
			$("body").prepend('<div id="overlay" class="ui-widget-overlay" style="z-index: 1001; display: none;"></div>');
			$("body").prepend("<div id='PleaseWait' style='display: none;position: fixed;top: 0px;z-index: 30001;left: 50%;top: 50%;'><img src='https://boundlessaccelerator.ca/wp-content/themes/Divi-Child/images/loading.gif'/></div>");
			$('#gform_submit_button_'+form_id+'').click(function(){
				$("#overlay, #PleaseWait").show();
				setTimeout(function () {
                    $("#overlay, #PleaseWait").hide();
                }, 5000);
			});
		});
	</script>
	
<url>
<loc>https://ba.pfcd.ca/traction-survey-business-impact-program/</loc>
<lastmod>2025-07-29T00:20:28-04:00</lastmod></url>	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript">
		jQuery(document).ready(function($){
		    //IGS-1188 -- START
			var desc_rev = '_25_32';
			var desc_emp = '_25_35';
			var desc_inv = '_25_30';
			var desc_int = '_25_31';
			var tract_id = '_25_52';
			var form_id = '25';
			var trac_id = $('#input'+tract_id).val();
			var cp_ids = '_25_50';
			var cp_id = $('#input'+cp_ids).val();
			
			if(form_id == '11' || form_id == '25' || form_id == '26' || form_id == '27' || form_id == '28' || form_id == '33' || form_id == '34' || form_id == '35' || form_id == '36' || form_id == '42' || form_id == '45'){
				var sec_rev = document.getElementById("gfield_description"+desc_rev).innerHTML;
				var sec_rev = sec_rev.replace("tractid", trac_id);
				var sec_rev = sec_rev.replace("cps_id", cp_id);
				document.getElementById("gfield_description"+desc_rev).innerHTML = sec_rev;
				
				var sec_emp = document.getElementById("gfield_description"+desc_emp).innerHTML;
				var sec_emp = sec_emp.replace("tractid", trac_id);
				document.getElementById("gfield_description"+desc_emp).innerHTML = sec_emp;
				
				var sec_inv = document.getElementById("gfield_description"+desc_inv).innerHTML;
    			var sec_inv = sec_inv.replace("tractid", trac_id);
    			var sec_inv = sec_inv.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_inv).innerHTML = sec_inv;
    			
    			var sec_int = document.getElementById("gfield_description"+desc_int).innerHTML;
    			var sec_int = sec_int.replace("tractid", trac_id);
    			var sec_int = sec_int.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_int).innerHTML = sec_int;
			}
			//IGS-1188 -- END
				
			var ip_id = '_25_29';
			var inv_id = '_25_28';
			var invmt_id = '28';
			var intel_id = '29';
			var form_id = '25';
			var page_id = '';
			var rev_id = '';
			var emp_id = '';
			setReadonly();
			function formatDate(date) {
				var d = new Date(date),
					month = '' + (d.getMonth() + 1),
					day = '' + d.getDate(),
					year = d.getFullYear();
				if (month.length < 2) month = '0' + month;
				if (day.length < 2) day = '0' + day;
				return [year, month, day].join('-');
			}
			function setReadonly(){
			    if(form_id == 1 || form_id == 5 || form_id == 6 || form_id == 7 || form_id == 8 || form_id == 10 || form_id == 32 || form_id == 40  || form_id == 44){
					$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						var id = currentElement.closest("div").find("input").val();
						if(id !=''){
						currentElement.closest("div").find("input").prop('disabled', true);
						currentElement.closest("div").find("select").prop('disabled', true);
						}else{
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
						}
						$(currentElement.closest("div").find("input")).each(function(key, val) {
							if(key == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
								//$(this).attr('style','display:none;');
								$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
								if($check_inv_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
								}
								var date_today = new Date();
								var previousMonth = date_today.getMonth() - 1;
								var today = new Date(date_today.getFullYear(), previousMonth, 1);
								var yyyy = today.getFullYear();
								var mm = today.getMonth() + 1; // Months start at 0!
								var dd = today.getDate();
				
								if (dd < 10) dd = '0' + dd;
								if (mm < 10) mm = '0' + mm;
				
								var formattedToday = mm + '/' + dd + '/' + yyyy;
								var value = formatDate(formattedToday);
								//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
							}
						});
					});
					if(form_id != 32){
						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
									//$(this).attr('style','display:none;');
									$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
									if($check_ip_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
									}
									var date_today = new Date();
									var previousMonth = date_today.getMonth() - 1;
									var today = new Date(date_today.getFullYear(), previousMonth, 1);
									var yyyy = today.getFullYear();
									var mm = today.getMonth() + 1; // Months start at 0!
									var dd = today.getDate();

									if (dd < 10) dd = '0' + dd;
									if (mm < 10) mm = '0' + mm;

									var formattedToday = mm + '/' + dd + '/' + yyyy;
									var value = formatDate(formattedToday);
									//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}else{
					if(form_id != 36){
						$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key, val) {
								if(key == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
										if($check_inv_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});

						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
										if($check_ip_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}
			}
					
			//IGS-1225 -- START
			var date_today = new Date();
			var previousMonth = date_today.getMonth() - 1;
			var today = new Date(date_today.getFullYear(), previousMonth, 1);
			var yyyy = today.getFullYear();
			var mm = today.getMonth() + 1; // Months start at 0!
			var dd = today.getDate();
			if (dd < 10) dd = '0' + dd;
			if (mm < 10) mm = '0' + mm;
			var formattedToday = mm + '/' + dd + '/' + yyyy;
			var date_value = formatDate(formattedToday);
			function investmentListFunc(){
				$('#field'+inv_id+' .gfield_list_group').each(function(index) {
				    if(form_id == 36){
						var cellTypeIndex = 2;
						var celldateIndex = 0;
						var cellOtherIndex = 5;
					}else{
						var cellTypeIndex = 3;
						var celldateIndex = 2;
						var cellOtherIndex = 6;
					}
					$(this).closest("div").attr('id', 'inv'+index);
					var investmentTypeSelect = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellTypeIndex);
					var investmentTypedate = $(this).find('.gfield_list_'+invmt_id+'_cell'+celldateIndex);
					var ifOtherInput = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex);
					investmentTypeSelect.attr('id', 'investment_type_' + index);
					investmentTypedate.attr('id', 'investment_date_' + index);
					ifOtherInput.attr('id', 'if_invother_' + index);		
					var other = 0;
					var inves_date = 0;
					var invest_type = $('#investment_type_'+index+' select').val();
				
					if(invest_type == 'Other'){
						$('#if_invother_'+index+' input').css('display', 'block');
					}else{
						$('#if_invother_'+index+' input').css('display', 'none');
					}
					$('#investment_type_'+index).change(function(){
						$('#investment_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	inves_date++;
							//}
						});
						//if(inves_date != 0){
						//	$('#investment_date_'+index+' input').val(date_value);
						//}else{
						//	$('#investment_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_invother_'+index+' input').css('display', 'block');
						}else{
							$('#if_invother_'+index+' input').css('display', 'none');
						}
						other = 0;
						inves_date = 0;
					});
					var inves = 0;

					$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							inves++;
						}
						if(inves > 0){
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
						}
					});
					var inves_chg = 0;
					$('#investment_type_'+index+' select').change(function(){
						$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								inves_chg++;
							}
							if(inves_chg > 0){
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
							}
						});
						inves_chg = 0;
					});
				});
			}
			if(form_id != 18){
				investmentListFunc();
				$('body').on('click', "#field"+inv_id+" .add_list_item", function() {
					investmentListFunc();
				});
			}
			intellactListFunc();
			$('body').on('click', "#field"+ip_id+" .add_list_item", function() {
			    intellactListFunc();
			});
			function intellactListFunc(){
				$('#field'+ip_id+' .gfield_list_group').each(function(index) {
					if(form_id == 36){
						var cellIpTypeIndex = 4;
						var cellIpdateIndex = 0;
						var cellIPOtherIndex = 5;
						var cellCountry = 2;
						var cellCountryOther = 3;
					}else{
						var cellIpTypeIndex = 5;
						var cellIpdateIndex = 2;
						var cellIPOtherIndex = 6;
						var cellCountry = 3;
						var cellCountryOther = 4;
					}
				    $(this).closest("div").attr('id', 'inv'+index);
					//IP Type dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).attr('id', 'intellact_type_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).attr('id', 'if_other_' + index);
					var intellTypedate = $(this).find('.gfield_list_'+intel_id+'_cell'+cellIpdateIndex);
					intellTypedate.attr('id', 'intell_date_' + index);
					
					var intel_type = $('#intellact_type_'+index+' select').val();
					if(intel_type == 'Other'){
						$('#if_other_'+index+' input').css('display', 'block');
					}else{
						$('#if_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					var intellact_date = 0;
					$('#intellact_type_'+index).change(function(){
						$('#intellact_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	intellact_date++;
							//}
						});
						//if(intellact_date != 0){
						//	$('#intell_date_'+index+' input').val(date_value);
						//}else{
						//	$('#intell_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_other_'+index+' input').css('display', 'block');
						}else{
							$('#if_other_'+index+' input').css('display', 'none');
						}
						other = 0; intellact_date = 0;
					});
					var intell = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intell++;
						}
						if(intell > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
						}
					});
					var intell_chg = 0;
					$('#intellact_type_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intell_chg++;
							}
							if(intell_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
							}
						});
						intell_chg = 0;
					});
					//IP Type dependent -- END
					//IP Country dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountry).attr('id', 'country_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountryOther).attr('id', 'cnt_other_' + index);					
					var intcnt_type = $('#country_'+index+' select').val();
					if(intcnt_type == 'Other'){
						$('#cnt_other_'+index+' input').css('display', 'block');
					}else{
						$('#cnt_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					$('#country_'+index).change(function(){
						$('#country_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
						});
						if(other > '0'){
							$('#cnt_other_'+index+' input').css('display', 'block');
						}else{
							$('#cnt_other_'+index+' input').css('display', 'none');
						}
						other = 0;
					});
					var intcnt = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intcnt++;
						}
						if(intcnt > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
						}
					});
					var intcnt_chg = 0;
					$('#country_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intcnt_chg++;
							}
							if(intcnt_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
							}
						});
						intcnt_chg = 0;
					});
					//IP Country dependent -- END
				});
			}
			//IGS-1225 -- END
			function removeReadonly(){
				$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
					var currentElement = $(this);
					currentElement.closest("div").find("input").prop('disabled', false);
					currentElement.closest("div").find("select").prop('disabled', false);
				});
				var form_id = '25';
				if(form_id != 32){
					$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
					});
				}
			}
			$('.add_list_item').click(function(){
			    setReadonly();
			});			
			$('#gform_submit_button_'+form_id+'').click(function(){
				removeReadonly();
			});
			var form_id = '25';
			$("body").prepend('<div id="overlay" class="ui-widget-overlay" style="z-index: 1001; display: none;"></div>');
			$("body").prepend("<div id='PleaseWait' style='display: none;position: fixed;top: 0px;z-index: 30001;left: 50%;top: 50%;'><img src='https://boundlessaccelerator.ca/wp-content/themes/Divi-Child/images/loading.gif'/></div>");
			$('#gform_submit_button_'+form_id+'').click(function(){
				$("#overlay, #PleaseWait").show();
				setTimeout(function () {
                    $("#overlay, #PleaseWait").hide();
                }, 5000);
			});
		});
	</script>
	
<url>
<loc>https://ba.pfcd.ca/traction-survey-rhyze-up/</loc>
<lastmod>2025-07-18T04:52:19-04:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/programs/business-impact-program/</loc>
<lastmod>2025-05-06T01:56:07-04:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/business-impact-program/</loc>
<lastmod>2025-05-06T01:53:20-04:00</lastmod></url>	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript">
		jQuery(document).ready(function($){
		    //IGS-1188 -- START
			var desc_rev = '';
			var desc_emp = '';
			var desc_inv = '_40_99';
			var desc_int = '_40_106';
			var tract_id = '';
			var form_id = '40';
			var trac_id = $('#input'+tract_id).val();
			var cp_ids = '_40_216';
			var cp_id = $('#input'+cp_ids).val();
			
			if(form_id == '11' || form_id == '25' || form_id == '26' || form_id == '27' || form_id == '28' || form_id == '33' || form_id == '34' || form_id == '35' || form_id == '36' || form_id == '42' || form_id == '45'){
				var sec_rev = document.getElementById("gfield_description"+desc_rev).innerHTML;
				var sec_rev = sec_rev.replace("tractid", trac_id);
				var sec_rev = sec_rev.replace("cps_id", cp_id);
				document.getElementById("gfield_description"+desc_rev).innerHTML = sec_rev;
				
				var sec_emp = document.getElementById("gfield_description"+desc_emp).innerHTML;
				var sec_emp = sec_emp.replace("tractid", trac_id);
				document.getElementById("gfield_description"+desc_emp).innerHTML = sec_emp;
				
				var sec_inv = document.getElementById("gfield_description"+desc_inv).innerHTML;
    			var sec_inv = sec_inv.replace("tractid", trac_id);
    			var sec_inv = sec_inv.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_inv).innerHTML = sec_inv;
    			
    			var sec_int = document.getElementById("gfield_description"+desc_int).innerHTML;
    			var sec_int = sec_int.replace("tractid", trac_id);
    			var sec_int = sec_int.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_int).innerHTML = sec_int;
			}
			//IGS-1188 -- END
				
			var ip_id = '_40_156';
			var inv_id = '_40_155';
			var invmt_id = '155';
			var intel_id = '156';
			var form_id = '40';
			var page_id = '';
			var rev_id = '';
			var emp_id = '';
			setReadonly();
			function formatDate(date) {
				var d = new Date(date),
					month = '' + (d.getMonth() + 1),
					day = '' + d.getDate(),
					year = d.getFullYear();
				if (month.length < 2) month = '0' + month;
				if (day.length < 2) day = '0' + day;
				return [year, month, day].join('-');
			}
			function setReadonly(){
			    if(form_id == 1 || form_id == 5 || form_id == 6 || form_id == 7 || form_id == 8 || form_id == 10 || form_id == 32 || form_id == 40  || form_id == 44){
					$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						var id = currentElement.closest("div").find("input").val();
						if(id !=''){
						currentElement.closest("div").find("input").prop('disabled', true);
						currentElement.closest("div").find("select").prop('disabled', true);
						}else{
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
						}
						$(currentElement.closest("div").find("input")).each(function(key, val) {
							if(key == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
								//$(this).attr('style','display:none;');
								$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
								if($check_inv_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
								}
								var date_today = new Date();
								var previousMonth = date_today.getMonth() - 1;
								var today = new Date(date_today.getFullYear(), previousMonth, 1);
								var yyyy = today.getFullYear();
								var mm = today.getMonth() + 1; // Months start at 0!
								var dd = today.getDate();
				
								if (dd < 10) dd = '0' + dd;
								if (mm < 10) mm = '0' + mm;
				
								var formattedToday = mm + '/' + dd + '/' + yyyy;
								var value = formatDate(formattedToday);
								//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
							}
						});
					});
					if(form_id != 32){
						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
									//$(this).attr('style','display:none;');
									$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
									if($check_ip_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
									}
									var date_today = new Date();
									var previousMonth = date_today.getMonth() - 1;
									var today = new Date(date_today.getFullYear(), previousMonth, 1);
									var yyyy = today.getFullYear();
									var mm = today.getMonth() + 1; // Months start at 0!
									var dd = today.getDate();

									if (dd < 10) dd = '0' + dd;
									if (mm < 10) mm = '0' + mm;

									var formattedToday = mm + '/' + dd + '/' + yyyy;
									var value = formatDate(formattedToday);
									//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}else{
					if(form_id != 36){
						$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key, val) {
								if(key == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
										if($check_inv_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});

						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
										if($check_ip_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}
			}
					
			//IGS-1225 -- START
			var date_today = new Date();
			var previousMonth = date_today.getMonth() - 1;
			var today = new Date(date_today.getFullYear(), previousMonth, 1);
			var yyyy = today.getFullYear();
			var mm = today.getMonth() + 1; // Months start at 0!
			var dd = today.getDate();
			if (dd < 10) dd = '0' + dd;
			if (mm < 10) mm = '0' + mm;
			var formattedToday = mm + '/' + dd + '/' + yyyy;
			var date_value = formatDate(formattedToday);
			function investmentListFunc(){
				$('#field'+inv_id+' .gfield_list_group').each(function(index) {
				    if(form_id == 36){
						var cellTypeIndex = 2;
						var celldateIndex = 0;
						var cellOtherIndex = 5;
					}else{
						var cellTypeIndex = 3;
						var celldateIndex = 2;
						var cellOtherIndex = 6;
					}
					$(this).closest("div").attr('id', 'inv'+index);
					var investmentTypeSelect = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellTypeIndex);
					var investmentTypedate = $(this).find('.gfield_list_'+invmt_id+'_cell'+celldateIndex);
					var ifOtherInput = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex);
					investmentTypeSelect.attr('id', 'investment_type_' + index);
					investmentTypedate.attr('id', 'investment_date_' + index);
					ifOtherInput.attr('id', 'if_invother_' + index);		
					var other = 0;
					var inves_date = 0;
					var invest_type = $('#investment_type_'+index+' select').val();
				
					if(invest_type == 'Other'){
						$('#if_invother_'+index+' input').css('display', 'block');
					}else{
						$('#if_invother_'+index+' input').css('display', 'none');
					}
					$('#investment_type_'+index).change(function(){
						$('#investment_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	inves_date++;
							//}
						});
						//if(inves_date != 0){
						//	$('#investment_date_'+index+' input').val(date_value);
						//}else{
						//	$('#investment_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_invother_'+index+' input').css('display', 'block');
						}else{
							$('#if_invother_'+index+' input').css('display', 'none');
						}
						other = 0;
						inves_date = 0;
					});
					var inves = 0;

					$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							inves++;
						}
						if(inves > 0){
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
						}
					});
					var inves_chg = 0;
					$('#investment_type_'+index+' select').change(function(){
						$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								inves_chg++;
							}
							if(inves_chg > 0){
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
							}
						});
						inves_chg = 0;
					});
				});
			}
			if(form_id != 18){
				investmentListFunc();
				$('body').on('click', "#field"+inv_id+" .add_list_item", function() {
					investmentListFunc();
				});
			}
			intellactListFunc();
			$('body').on('click', "#field"+ip_id+" .add_list_item", function() {
			    intellactListFunc();
			});
			function intellactListFunc(){
				$('#field'+ip_id+' .gfield_list_group').each(function(index) {
					if(form_id == 36){
						var cellIpTypeIndex = 4;
						var cellIpdateIndex = 0;
						var cellIPOtherIndex = 5;
						var cellCountry = 2;
						var cellCountryOther = 3;
					}else{
						var cellIpTypeIndex = 5;
						var cellIpdateIndex = 2;
						var cellIPOtherIndex = 6;
						var cellCountry = 3;
						var cellCountryOther = 4;
					}
				    $(this).closest("div").attr('id', 'inv'+index);
					//IP Type dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).attr('id', 'intellact_type_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).attr('id', 'if_other_' + index);
					var intellTypedate = $(this).find('.gfield_list_'+intel_id+'_cell'+cellIpdateIndex);
					intellTypedate.attr('id', 'intell_date_' + index);
					
					var intel_type = $('#intellact_type_'+index+' select').val();
					if(intel_type == 'Other'){
						$('#if_other_'+index+' input').css('display', 'block');
					}else{
						$('#if_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					var intellact_date = 0;
					$('#intellact_type_'+index).change(function(){
						$('#intellact_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	intellact_date++;
							//}
						});
						//if(intellact_date != 0){
						//	$('#intell_date_'+index+' input').val(date_value);
						//}else{
						//	$('#intell_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_other_'+index+' input').css('display', 'block');
						}else{
							$('#if_other_'+index+' input').css('display', 'none');
						}
						other = 0; intellact_date = 0;
					});
					var intell = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intell++;
						}
						if(intell > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
						}
					});
					var intell_chg = 0;
					$('#intellact_type_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intell_chg++;
							}
							if(intell_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
							}
						});
						intell_chg = 0;
					});
					//IP Type dependent -- END
					//IP Country dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountry).attr('id', 'country_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountryOther).attr('id', 'cnt_other_' + index);					
					var intcnt_type = $('#country_'+index+' select').val();
					if(intcnt_type == 'Other'){
						$('#cnt_other_'+index+' input').css('display', 'block');
					}else{
						$('#cnt_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					$('#country_'+index).change(function(){
						$('#country_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
						});
						if(other > '0'){
							$('#cnt_other_'+index+' input').css('display', 'block');
						}else{
							$('#cnt_other_'+index+' input').css('display', 'none');
						}
						other = 0;
					});
					var intcnt = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intcnt++;
						}
						if(intcnt > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
						}
					});
					var intcnt_chg = 0;
					$('#country_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intcnt_chg++;
							}
							if(intcnt_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
							}
						});
						intcnt_chg = 0;
					});
					//IP Country dependent -- END
				});
			}
			//IGS-1225 -- END
			function removeReadonly(){
				$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
					var currentElement = $(this);
					currentElement.closest("div").find("input").prop('disabled', false);
					currentElement.closest("div").find("select").prop('disabled', false);
				});
				var form_id = '40';
				if(form_id != 32){
					$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
					});
				}
			}
			$('.add_list_item').click(function(){
			    setReadonly();
			});			
			$('#gform_submit_button_'+form_id+'').click(function(){
				removeReadonly();
			});
			var form_id = '40';
			$("body").prepend('<div id="overlay" class="ui-widget-overlay" style="z-index: 1001; display: none;"></div>');
			$("body").prepend("<div id='PleaseWait' style='display: none;position: fixed;top: 0px;z-index: 30001;left: 50%;top: 50%;'><img src='https://boundlessaccelerator.ca/wp-content/themes/Divi-Child/images/loading.gif'/></div>");
			$('#gform_submit_button_'+form_id+'').click(function(){
				$("#overlay, #PleaseWait").show();
				setTimeout(function () {
                    $("#overlay, #PleaseWait").hide();
                }, 5000);
			});
		});
	</script>
	
<url>
<loc>https://ba.pfcd.ca/business-impact-program-form/</loc>
<lastmod>2025-04-14T05:38:41-04:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/business-impact-program-form/thank-you/</loc>
<lastmod>2025-04-13T02:15:28-04:00</lastmod></url>	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript">
		jQuery(document).ready(function($){
		    //IGS-1188 -- START
			var desc_rev = '_36_9';
			var desc_emp = '_36_21';
			var desc_inv = '_36_6';
			var desc_int = '_36_73';
			var tract_id = '_36_81';
			var form_id = '36';
			var trac_id = $('#input'+tract_id).val();
			var cp_ids = '_36_81';
			var cp_id = $('#input'+cp_ids).val();
			
			if(form_id == '11' || form_id == '25' || form_id == '26' || form_id == '27' || form_id == '28' || form_id == '33' || form_id == '34' || form_id == '35' || form_id == '36' || form_id == '42' || form_id == '45'){
				var sec_rev = document.getElementById("gfield_description"+desc_rev).innerHTML;
				var sec_rev = sec_rev.replace("tractid", trac_id);
				var sec_rev = sec_rev.replace("cps_id", cp_id);
				document.getElementById("gfield_description"+desc_rev).innerHTML = sec_rev;
				
				var sec_emp = document.getElementById("gfield_description"+desc_emp).innerHTML;
				var sec_emp = sec_emp.replace("tractid", trac_id);
				document.getElementById("gfield_description"+desc_emp).innerHTML = sec_emp;
				
				var sec_inv = document.getElementById("gfield_description"+desc_inv).innerHTML;
    			var sec_inv = sec_inv.replace("tractid", trac_id);
    			var sec_inv = sec_inv.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_inv).innerHTML = sec_inv;
    			
    			var sec_int = document.getElementById("gfield_description"+desc_int).innerHTML;
    			var sec_int = sec_int.replace("tractid", trac_id);
    			var sec_int = sec_int.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_int).innerHTML = sec_int;
			}
			//IGS-1188 -- END
				
			var ip_id = '_36_74';
			var inv_id = '_36_7';
			var invmt_id = '7';
			var intel_id = '74';
			var form_id = '36';
			var page_id = '';
			var rev_id = '';
			var emp_id = '';
			setReadonly();
			function formatDate(date) {
				var d = new Date(date),
					month = '' + (d.getMonth() + 1),
					day = '' + d.getDate(),
					year = d.getFullYear();
				if (month.length < 2) month = '0' + month;
				if (day.length < 2) day = '0' + day;
				return [year, month, day].join('-');
			}
			function setReadonly(){
			    if(form_id == 1 || form_id == 5 || form_id == 6 || form_id == 7 || form_id == 8 || form_id == 10 || form_id == 32 || form_id == 40  || form_id == 44){
					$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						var id = currentElement.closest("div").find("input").val();
						if(id !=''){
						currentElement.closest("div").find("input").prop('disabled', true);
						currentElement.closest("div").find("select").prop('disabled', true);
						}else{
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
						}
						$(currentElement.closest("div").find("input")).each(function(key, val) {
							if(key == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
								//$(this).attr('style','display:none;');
								$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
								if($check_inv_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
								}
								var date_today = new Date();
								var previousMonth = date_today.getMonth() - 1;
								var today = new Date(date_today.getFullYear(), previousMonth, 1);
								var yyyy = today.getFullYear();
								var mm = today.getMonth() + 1; // Months start at 0!
								var dd = today.getDate();
				
								if (dd < 10) dd = '0' + dd;
								if (mm < 10) mm = '0' + mm;
				
								var formattedToday = mm + '/' + dd + '/' + yyyy;
								var value = formatDate(formattedToday);
								//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
							}
						});
					});
					if(form_id != 32){
						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
									//$(this).attr('style','display:none;');
									$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
									if($check_ip_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
									}
									var date_today = new Date();
									var previousMonth = date_today.getMonth() - 1;
									var today = new Date(date_today.getFullYear(), previousMonth, 1);
									var yyyy = today.getFullYear();
									var mm = today.getMonth() + 1; // Months start at 0!
									var dd = today.getDate();

									if (dd < 10) dd = '0' + dd;
									if (mm < 10) mm = '0' + mm;

									var formattedToday = mm + '/' + dd + '/' + yyyy;
									var value = formatDate(formattedToday);
									//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}else{
					if(form_id != 36){
						$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key, val) {
								if(key == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
										if($check_inv_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});

						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
										if($check_ip_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}
			}
					
			//IGS-1225 -- START
			var date_today = new Date();
			var previousMonth = date_today.getMonth() - 1;
			var today = new Date(date_today.getFullYear(), previousMonth, 1);
			var yyyy = today.getFullYear();
			var mm = today.getMonth() + 1; // Months start at 0!
			var dd = today.getDate();
			if (dd < 10) dd = '0' + dd;
			if (mm < 10) mm = '0' + mm;
			var formattedToday = mm + '/' + dd + '/' + yyyy;
			var date_value = formatDate(formattedToday);
			function investmentListFunc(){
				$('#field'+inv_id+' .gfield_list_group').each(function(index) {
				    if(form_id == 36){
						var cellTypeIndex = 2;
						var celldateIndex = 0;
						var cellOtherIndex = 5;
					}else{
						var cellTypeIndex = 3;
						var celldateIndex = 2;
						var cellOtherIndex = 6;
					}
					$(this).closest("div").attr('id', 'inv'+index);
					var investmentTypeSelect = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellTypeIndex);
					var investmentTypedate = $(this).find('.gfield_list_'+invmt_id+'_cell'+celldateIndex);
					var ifOtherInput = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex);
					investmentTypeSelect.attr('id', 'investment_type_' + index);
					investmentTypedate.attr('id', 'investment_date_' + index);
					ifOtherInput.attr('id', 'if_invother_' + index);		
					var other = 0;
					var inves_date = 0;
					var invest_type = $('#investment_type_'+index+' select').val();
				
					if(invest_type == 'Other'){
						$('#if_invother_'+index+' input').css('display', 'block');
					}else{
						$('#if_invother_'+index+' input').css('display', 'none');
					}
					$('#investment_type_'+index).change(function(){
						$('#investment_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	inves_date++;
							//}
						});
						//if(inves_date != 0){
						//	$('#investment_date_'+index+' input').val(date_value);
						//}else{
						//	$('#investment_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_invother_'+index+' input').css('display', 'block');
						}else{
							$('#if_invother_'+index+' input').css('display', 'none');
						}
						other = 0;
						inves_date = 0;
					});
					var inves = 0;

					$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							inves++;
						}
						if(inves > 0){
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
						}
					});
					var inves_chg = 0;
					$('#investment_type_'+index+' select').change(function(){
						$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								inves_chg++;
							}
							if(inves_chg > 0){
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
							}
						});
						inves_chg = 0;
					});
				});
			}
			if(form_id != 18){
				investmentListFunc();
				$('body').on('click', "#field"+inv_id+" .add_list_item", function() {
					investmentListFunc();
				});
			}
			intellactListFunc();
			$('body').on('click', "#field"+ip_id+" .add_list_item", function() {
			    intellactListFunc();
			});
			function intellactListFunc(){
				$('#field'+ip_id+' .gfield_list_group').each(function(index) {
					if(form_id == 36){
						var cellIpTypeIndex = 4;
						var cellIpdateIndex = 0;
						var cellIPOtherIndex = 5;
						var cellCountry = 2;
						var cellCountryOther = 3;
					}else{
						var cellIpTypeIndex = 5;
						var cellIpdateIndex = 2;
						var cellIPOtherIndex = 6;
						var cellCountry = 3;
						var cellCountryOther = 4;
					}
				    $(this).closest("div").attr('id', 'inv'+index);
					//IP Type dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).attr('id', 'intellact_type_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).attr('id', 'if_other_' + index);
					var intellTypedate = $(this).find('.gfield_list_'+intel_id+'_cell'+cellIpdateIndex);
					intellTypedate.attr('id', 'intell_date_' + index);
					
					var intel_type = $('#intellact_type_'+index+' select').val();
					if(intel_type == 'Other'){
						$('#if_other_'+index+' input').css('display', 'block');
					}else{
						$('#if_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					var intellact_date = 0;
					$('#intellact_type_'+index).change(function(){
						$('#intellact_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	intellact_date++;
							//}
						});
						//if(intellact_date != 0){
						//	$('#intell_date_'+index+' input').val(date_value);
						//}else{
						//	$('#intell_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_other_'+index+' input').css('display', 'block');
						}else{
							$('#if_other_'+index+' input').css('display', 'none');
						}
						other = 0; intellact_date = 0;
					});
					var intell = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intell++;
						}
						if(intell > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
						}
					});
					var intell_chg = 0;
					$('#intellact_type_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intell_chg++;
							}
							if(intell_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
							}
						});
						intell_chg = 0;
					});
					//IP Type dependent -- END
					//IP Country dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountry).attr('id', 'country_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountryOther).attr('id', 'cnt_other_' + index);					
					var intcnt_type = $('#country_'+index+' select').val();
					if(intcnt_type == 'Other'){
						$('#cnt_other_'+index+' input').css('display', 'block');
					}else{
						$('#cnt_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					$('#country_'+index).change(function(){
						$('#country_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
						});
						if(other > '0'){
							$('#cnt_other_'+index+' input').css('display', 'block');
						}else{
							$('#cnt_other_'+index+' input').css('display', 'none');
						}
						other = 0;
					});
					var intcnt = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intcnt++;
						}
						if(intcnt > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
						}
					});
					var intcnt_chg = 0;
					$('#country_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intcnt_chg++;
							}
							if(intcnt_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
							}
						});
						intcnt_chg = 0;
					});
					//IP Country dependent -- END
				});
			}
			//IGS-1225 -- END
			function removeReadonly(){
				$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
					var currentElement = $(this);
					currentElement.closest("div").find("input").prop('disabled', false);
					currentElement.closest("div").find("select").prop('disabled', false);
				});
				var form_id = '36';
				if(form_id != 32){
					$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
					});
				}
			}
			$('.add_list_item').click(function(){
			    setReadonly();
			});			
			$('#gform_submit_button_'+form_id+'').click(function(){
				removeReadonly();
			});
			var form_id = '36';
			$("body").prepend('<div id="overlay" class="ui-widget-overlay" style="z-index: 1001; display: none;"></div>');
			$("body").prepend("<div id='PleaseWait' style='display: none;position: fixed;top: 0px;z-index: 30001;left: 50%;top: 50%;'><img src='https://boundlessaccelerator.ca/wp-content/themes/Divi-Child/images/loading.gif'/></div>");
			$('#gform_submit_button_'+form_id+'').click(function(){
				$("#overlay, #PleaseWait").show();
				setTimeout(function () {
                    $("#overlay, #PleaseWait").hide();
                }, 5000);
			});
		});
	</script>
	
<url>
<loc>https://ba.pfcd.ca/annual-survey/</loc>
<lastmod>2025-04-11T05:37:19-04:00</lastmod></url>	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript">
		jQuery(document).ready(function($){
		    //IGS-1188 -- START
			var desc_rev = '_33_32';
			var desc_emp = '_33_35';
			var desc_inv = '_33_30';
			var desc_int = '_33_31';
			var tract_id = '_33_52';
			var form_id = '33';
			var trac_id = $('#input'+tract_id).val();
			var cp_ids = '_33_50';
			var cp_id = $('#input'+cp_ids).val();
			
			if(form_id == '11' || form_id == '25' || form_id == '26' || form_id == '27' || form_id == '28' || form_id == '33' || form_id == '34' || form_id == '35' || form_id == '36' || form_id == '42' || form_id == '45'){
				var sec_rev = document.getElementById("gfield_description"+desc_rev).innerHTML;
				var sec_rev = sec_rev.replace("tractid", trac_id);
				var sec_rev = sec_rev.replace("cps_id", cp_id);
				document.getElementById("gfield_description"+desc_rev).innerHTML = sec_rev;
				
				var sec_emp = document.getElementById("gfield_description"+desc_emp).innerHTML;
				var sec_emp = sec_emp.replace("tractid", trac_id);
				document.getElementById("gfield_description"+desc_emp).innerHTML = sec_emp;
				
				var sec_inv = document.getElementById("gfield_description"+desc_inv).innerHTML;
    			var sec_inv = sec_inv.replace("tractid", trac_id);
    			var sec_inv = sec_inv.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_inv).innerHTML = sec_inv;
    			
    			var sec_int = document.getElementById("gfield_description"+desc_int).innerHTML;
    			var sec_int = sec_int.replace("tractid", trac_id);
    			var sec_int = sec_int.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_int).innerHTML = sec_int;
			}
			//IGS-1188 -- END
				
			var ip_id = '_33_29';
			var inv_id = '_33_28';
			var invmt_id = '28';
			var intel_id = '29';
			var form_id = '33';
			var page_id = '';
			var rev_id = '';
			var emp_id = '';
			setReadonly();
			function formatDate(date) {
				var d = new Date(date),
					month = '' + (d.getMonth() + 1),
					day = '' + d.getDate(),
					year = d.getFullYear();
				if (month.length < 2) month = '0' + month;
				if (day.length < 2) day = '0' + day;
				return [year, month, day].join('-');
			}
			function setReadonly(){
			    if(form_id == 1 || form_id == 5 || form_id == 6 || form_id == 7 || form_id == 8 || form_id == 10 || form_id == 32 || form_id == 40  || form_id == 44){
					$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						var id = currentElement.closest("div").find("input").val();
						if(id !=''){
						currentElement.closest("div").find("input").prop('disabled', true);
						currentElement.closest("div").find("select").prop('disabled', true);
						}else{
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
						}
						$(currentElement.closest("div").find("input")).each(function(key, val) {
							if(key == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
								//$(this).attr('style','display:none;');
								$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
								if($check_inv_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
								}
								var date_today = new Date();
								var previousMonth = date_today.getMonth() - 1;
								var today = new Date(date_today.getFullYear(), previousMonth, 1);
								var yyyy = today.getFullYear();
								var mm = today.getMonth() + 1; // Months start at 0!
								var dd = today.getDate();
				
								if (dd < 10) dd = '0' + dd;
								if (mm < 10) mm = '0' + mm;
				
								var formattedToday = mm + '/' + dd + '/' + yyyy;
								var value = formatDate(formattedToday);
								//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
							}
						});
					});
					if(form_id != 32){
						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
									//$(this).attr('style','display:none;');
									$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
									if($check_ip_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
									}
									var date_today = new Date();
									var previousMonth = date_today.getMonth() - 1;
									var today = new Date(date_today.getFullYear(), previousMonth, 1);
									var yyyy = today.getFullYear();
									var mm = today.getMonth() + 1; // Months start at 0!
									var dd = today.getDate();

									if (dd < 10) dd = '0' + dd;
									if (mm < 10) mm = '0' + mm;

									var formattedToday = mm + '/' + dd + '/' + yyyy;
									var value = formatDate(formattedToday);
									//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}else{
					if(form_id != 36){
						$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key, val) {
								if(key == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
										if($check_inv_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});

						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
										if($check_ip_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}
			}
					
			//IGS-1225 -- START
			var date_today = new Date();
			var previousMonth = date_today.getMonth() - 1;
			var today = new Date(date_today.getFullYear(), previousMonth, 1);
			var yyyy = today.getFullYear();
			var mm = today.getMonth() + 1; // Months start at 0!
			var dd = today.getDate();
			if (dd < 10) dd = '0' + dd;
			if (mm < 10) mm = '0' + mm;
			var formattedToday = mm + '/' + dd + '/' + yyyy;
			var date_value = formatDate(formattedToday);
			function investmentListFunc(){
				$('#field'+inv_id+' .gfield_list_group').each(function(index) {
				    if(form_id == 36){
						var cellTypeIndex = 2;
						var celldateIndex = 0;
						var cellOtherIndex = 5;
					}else{
						var cellTypeIndex = 3;
						var celldateIndex = 2;
						var cellOtherIndex = 6;
					}
					$(this).closest("div").attr('id', 'inv'+index);
					var investmentTypeSelect = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellTypeIndex);
					var investmentTypedate = $(this).find('.gfield_list_'+invmt_id+'_cell'+celldateIndex);
					var ifOtherInput = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex);
					investmentTypeSelect.attr('id', 'investment_type_' + index);
					investmentTypedate.attr('id', 'investment_date_' + index);
					ifOtherInput.attr('id', 'if_invother_' + index);		
					var other = 0;
					var inves_date = 0;
					var invest_type = $('#investment_type_'+index+' select').val();
				
					if(invest_type == 'Other'){
						$('#if_invother_'+index+' input').css('display', 'block');
					}else{
						$('#if_invother_'+index+' input').css('display', 'none');
					}
					$('#investment_type_'+index).change(function(){
						$('#investment_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	inves_date++;
							//}
						});
						//if(inves_date != 0){
						//	$('#investment_date_'+index+' input').val(date_value);
						//}else{
						//	$('#investment_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_invother_'+index+' input').css('display', 'block');
						}else{
							$('#if_invother_'+index+' input').css('display', 'none');
						}
						other = 0;
						inves_date = 0;
					});
					var inves = 0;

					$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							inves++;
						}
						if(inves > 0){
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
						}
					});
					var inves_chg = 0;
					$('#investment_type_'+index+' select').change(function(){
						$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								inves_chg++;
							}
							if(inves_chg > 0){
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
							}
						});
						inves_chg = 0;
					});
				});
			}
			if(form_id != 18){
				investmentListFunc();
				$('body').on('click', "#field"+inv_id+" .add_list_item", function() {
					investmentListFunc();
				});
			}
			intellactListFunc();
			$('body').on('click', "#field"+ip_id+" .add_list_item", function() {
			    intellactListFunc();
			});
			function intellactListFunc(){
				$('#field'+ip_id+' .gfield_list_group').each(function(index) {
					if(form_id == 36){
						var cellIpTypeIndex = 4;
						var cellIpdateIndex = 0;
						var cellIPOtherIndex = 5;
						var cellCountry = 2;
						var cellCountryOther = 3;
					}else{
						var cellIpTypeIndex = 5;
						var cellIpdateIndex = 2;
						var cellIPOtherIndex = 6;
						var cellCountry = 3;
						var cellCountryOther = 4;
					}
				    $(this).closest("div").attr('id', 'inv'+index);
					//IP Type dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).attr('id', 'intellact_type_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).attr('id', 'if_other_' + index);
					var intellTypedate = $(this).find('.gfield_list_'+intel_id+'_cell'+cellIpdateIndex);
					intellTypedate.attr('id', 'intell_date_' + index);
					
					var intel_type = $('#intellact_type_'+index+' select').val();
					if(intel_type == 'Other'){
						$('#if_other_'+index+' input').css('display', 'block');
					}else{
						$('#if_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					var intellact_date = 0;
					$('#intellact_type_'+index).change(function(){
						$('#intellact_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	intellact_date++;
							//}
						});
						//if(intellact_date != 0){
						//	$('#intell_date_'+index+' input').val(date_value);
						//}else{
						//	$('#intell_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_other_'+index+' input').css('display', 'block');
						}else{
							$('#if_other_'+index+' input').css('display', 'none');
						}
						other = 0; intellact_date = 0;
					});
					var intell = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intell++;
						}
						if(intell > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
						}
					});
					var intell_chg = 0;
					$('#intellact_type_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intell_chg++;
							}
							if(intell_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
							}
						});
						intell_chg = 0;
					});
					//IP Type dependent -- END
					//IP Country dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountry).attr('id', 'country_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountryOther).attr('id', 'cnt_other_' + index);					
					var intcnt_type = $('#country_'+index+' select').val();
					if(intcnt_type == 'Other'){
						$('#cnt_other_'+index+' input').css('display', 'block');
					}else{
						$('#cnt_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					$('#country_'+index).change(function(){
						$('#country_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
						});
						if(other > '0'){
							$('#cnt_other_'+index+' input').css('display', 'block');
						}else{
							$('#cnt_other_'+index+' input').css('display', 'none');
						}
						other = 0;
					});
					var intcnt = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intcnt++;
						}
						if(intcnt > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
						}
					});
					var intcnt_chg = 0;
					$('#country_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intcnt_chg++;
							}
							if(intcnt_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
							}
						});
						intcnt_chg = 0;
					});
					//IP Country dependent -- END
				});
			}
			//IGS-1225 -- END
			function removeReadonly(){
				$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
					var currentElement = $(this);
					currentElement.closest("div").find("input").prop('disabled', false);
					currentElement.closest("div").find("select").prop('disabled', false);
				});
				var form_id = '33';
				if(form_id != 32){
					$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
					});
				}
			}
			$('.add_list_item').click(function(){
			    setReadonly();
			});			
			$('#gform_submit_button_'+form_id+'').click(function(){
				removeReadonly();
			});
			var form_id = '33';
			$("body").prepend('<div id="overlay" class="ui-widget-overlay" style="z-index: 1001; display: none;"></div>');
			$("body").prepend("<div id='PleaseWait' style='display: none;position: fixed;top: 0px;z-index: 30001;left: 50%;top: 50%;'><img src='https://boundlessaccelerator.ca/wp-content/themes/Divi-Child/images/loading.gif'/></div>");
			$('#gform_submit_button_'+form_id+'').click(function(){
				$("#overlay, #PleaseWait").show();
				setTimeout(function () {
                    $("#overlay, #PleaseWait").hide();
                }, 5000);
			});
		});
	</script>
	
<url>
<loc>https://ba.pfcd.ca/traction-survey-quantum-drive/</loc>
<lastmod>2024-05-01T04:56:38-04:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/quantum-drive-application-form/</loc>
<lastmod>2024-02-21T10:20:25-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/quantum-drive-application-form/thank-you/</loc>
<lastmod>2024-02-19T06:05:07-05:00</lastmod></url>	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript">
		jQuery(document).ready(function($){
		    //IGS-1188 -- START
			var desc_rev = '_11_32';
			var desc_emp = '_11_35';
			var desc_inv = '_11_30';
			var desc_int = '_11_31';
			var tract_id = '_11_52';
			var form_id = '11';
			var trac_id = $('#input'+tract_id).val();
			var cp_ids = '_11_50';
			var cp_id = $('#input'+cp_ids).val();
			
			if(form_id == '11' || form_id == '25' || form_id == '26' || form_id == '27' || form_id == '28' || form_id == '33' || form_id == '34' || form_id == '35' || form_id == '36' || form_id == '42' || form_id == '45'){
				var sec_rev = document.getElementById("gfield_description"+desc_rev).innerHTML;
				var sec_rev = sec_rev.replace("tractid", trac_id);
				var sec_rev = sec_rev.replace("cps_id", cp_id);
				document.getElementById("gfield_description"+desc_rev).innerHTML = sec_rev;
				
				var sec_emp = document.getElementById("gfield_description"+desc_emp).innerHTML;
				var sec_emp = sec_emp.replace("tractid", trac_id);
				document.getElementById("gfield_description"+desc_emp).innerHTML = sec_emp;
				
				var sec_inv = document.getElementById("gfield_description"+desc_inv).innerHTML;
    			var sec_inv = sec_inv.replace("tractid", trac_id);
    			var sec_inv = sec_inv.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_inv).innerHTML = sec_inv;
    			
    			var sec_int = document.getElementById("gfield_description"+desc_int).innerHTML;
    			var sec_int = sec_int.replace("tractid", trac_id);
    			var sec_int = sec_int.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_int).innerHTML = sec_int;
			}
			//IGS-1188 -- END
				
			var ip_id = '_11_29';
			var inv_id = '_11_28';
			var invmt_id = '28';
			var intel_id = '29';
			var form_id = '11';
			var page_id = '';
			var rev_id = '';
			var emp_id = '';
			setReadonly();
			function formatDate(date) {
				var d = new Date(date),
					month = '' + (d.getMonth() + 1),
					day = '' + d.getDate(),
					year = d.getFullYear();
				if (month.length < 2) month = '0' + month;
				if (day.length < 2) day = '0' + day;
				return [year, month, day].join('-');
			}
			function setReadonly(){
			    if(form_id == 1 || form_id == 5 || form_id == 6 || form_id == 7 || form_id == 8 || form_id == 10 || form_id == 32 || form_id == 40  || form_id == 44){
					$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						var id = currentElement.closest("div").find("input").val();
						if(id !=''){
						currentElement.closest("div").find("input").prop('disabled', true);
						currentElement.closest("div").find("select").prop('disabled', true);
						}else{
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
						}
						$(currentElement.closest("div").find("input")).each(function(key, val) {
							if(key == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
								//$(this).attr('style','display:none;');
								$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
								if($check_inv_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
								}
								var date_today = new Date();
								var previousMonth = date_today.getMonth() - 1;
								var today = new Date(date_today.getFullYear(), previousMonth, 1);
								var yyyy = today.getFullYear();
								var mm = today.getMonth() + 1; // Months start at 0!
								var dd = today.getDate();
				
								if (dd < 10) dd = '0' + dd;
								if (mm < 10) mm = '0' + mm;
				
								var formattedToday = mm + '/' + dd + '/' + yyyy;
								var value = formatDate(formattedToday);
								//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
							}
						});
					});
					if(form_id != 32){
						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
									//$(this).attr('style','display:none;');
									$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
									if($check_ip_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
									}
									var date_today = new Date();
									var previousMonth = date_today.getMonth() - 1;
									var today = new Date(date_today.getFullYear(), previousMonth, 1);
									var yyyy = today.getFullYear();
									var mm = today.getMonth() + 1; // Months start at 0!
									var dd = today.getDate();

									if (dd < 10) dd = '0' + dd;
									if (mm < 10) mm = '0' + mm;

									var formattedToday = mm + '/' + dd + '/' + yyyy;
									var value = formatDate(formattedToday);
									//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}else{
					if(form_id != 36){
						$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key, val) {
								if(key == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
										if($check_inv_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});

						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
										if($check_ip_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}
			}
					
			//IGS-1225 -- START
			var date_today = new Date();
			var previousMonth = date_today.getMonth() - 1;
			var today = new Date(date_today.getFullYear(), previousMonth, 1);
			var yyyy = today.getFullYear();
			var mm = today.getMonth() + 1; // Months start at 0!
			var dd = today.getDate();
			if (dd < 10) dd = '0' + dd;
			if (mm < 10) mm = '0' + mm;
			var formattedToday = mm + '/' + dd + '/' + yyyy;
			var date_value = formatDate(formattedToday);
			function investmentListFunc(){
				$('#field'+inv_id+' .gfield_list_group').each(function(index) {
				    if(form_id == 36){
						var cellTypeIndex = 2;
						var celldateIndex = 0;
						var cellOtherIndex = 5;
					}else{
						var cellTypeIndex = 3;
						var celldateIndex = 2;
						var cellOtherIndex = 6;
					}
					$(this).closest("div").attr('id', 'inv'+index);
					var investmentTypeSelect = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellTypeIndex);
					var investmentTypedate = $(this).find('.gfield_list_'+invmt_id+'_cell'+celldateIndex);
					var ifOtherInput = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex);
					investmentTypeSelect.attr('id', 'investment_type_' + index);
					investmentTypedate.attr('id', 'investment_date_' + index);
					ifOtherInput.attr('id', 'if_invother_' + index);		
					var other = 0;
					var inves_date = 0;
					var invest_type = $('#investment_type_'+index+' select').val();
				
					if(invest_type == 'Other'){
						$('#if_invother_'+index+' input').css('display', 'block');
					}else{
						$('#if_invother_'+index+' input').css('display', 'none');
					}
					$('#investment_type_'+index).change(function(){
						$('#investment_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	inves_date++;
							//}
						});
						//if(inves_date != 0){
						//	$('#investment_date_'+index+' input').val(date_value);
						//}else{
						//	$('#investment_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_invother_'+index+' input').css('display', 'block');
						}else{
							$('#if_invother_'+index+' input').css('display', 'none');
						}
						other = 0;
						inves_date = 0;
					});
					var inves = 0;

					$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							inves++;
						}
						if(inves > 0){
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
						}
					});
					var inves_chg = 0;
					$('#investment_type_'+index+' select').change(function(){
						$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								inves_chg++;
							}
							if(inves_chg > 0){
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
							}
						});
						inves_chg = 0;
					});
				});
			}
			if(form_id != 18){
				investmentListFunc();
				$('body').on('click', "#field"+inv_id+" .add_list_item", function() {
					investmentListFunc();
				});
			}
			intellactListFunc();
			$('body').on('click', "#field"+ip_id+" .add_list_item", function() {
			    intellactListFunc();
			});
			function intellactListFunc(){
				$('#field'+ip_id+' .gfield_list_group').each(function(index) {
					if(form_id == 36){
						var cellIpTypeIndex = 4;
						var cellIpdateIndex = 0;
						var cellIPOtherIndex = 5;
						var cellCountry = 2;
						var cellCountryOther = 3;
					}else{
						var cellIpTypeIndex = 5;
						var cellIpdateIndex = 2;
						var cellIPOtherIndex = 6;
						var cellCountry = 3;
						var cellCountryOther = 4;
					}
				    $(this).closest("div").attr('id', 'inv'+index);
					//IP Type dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).attr('id', 'intellact_type_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).attr('id', 'if_other_' + index);
					var intellTypedate = $(this).find('.gfield_list_'+intel_id+'_cell'+cellIpdateIndex);
					intellTypedate.attr('id', 'intell_date_' + index);
					
					var intel_type = $('#intellact_type_'+index+' select').val();
					if(intel_type == 'Other'){
						$('#if_other_'+index+' input').css('display', 'block');
					}else{
						$('#if_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					var intellact_date = 0;
					$('#intellact_type_'+index).change(function(){
						$('#intellact_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	intellact_date++;
							//}
						});
						//if(intellact_date != 0){
						//	$('#intell_date_'+index+' input').val(date_value);
						//}else{
						//	$('#intell_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_other_'+index+' input').css('display', 'block');
						}else{
							$('#if_other_'+index+' input').css('display', 'none');
						}
						other = 0; intellact_date = 0;
					});
					var intell = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intell++;
						}
						if(intell > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
						}
					});
					var intell_chg = 0;
					$('#intellact_type_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intell_chg++;
							}
							if(intell_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
							}
						});
						intell_chg = 0;
					});
					//IP Type dependent -- END
					//IP Country dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountry).attr('id', 'country_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountryOther).attr('id', 'cnt_other_' + index);					
					var intcnt_type = $('#country_'+index+' select').val();
					if(intcnt_type == 'Other'){
						$('#cnt_other_'+index+' input').css('display', 'block');
					}else{
						$('#cnt_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					$('#country_'+index).change(function(){
						$('#country_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
						});
						if(other > '0'){
							$('#cnt_other_'+index+' input').css('display', 'block');
						}else{
							$('#cnt_other_'+index+' input').css('display', 'none');
						}
						other = 0;
					});
					var intcnt = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intcnt++;
						}
						if(intcnt > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
						}
					});
					var intcnt_chg = 0;
					$('#country_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intcnt_chg++;
							}
							if(intcnt_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
							}
						});
						intcnt_chg = 0;
					});
					//IP Country dependent -- END
				});
			}
			//IGS-1225 -- END
			function removeReadonly(){
				$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
					var currentElement = $(this);
					currentElement.closest("div").find("input").prop('disabled', false);
					currentElement.closest("div").find("select").prop('disabled', false);
				});
				var form_id = '11';
				if(form_id != 32){
					$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
					});
				}
			}
			$('.add_list_item').click(function(){
			    setReadonly();
			});			
			$('#gform_submit_button_'+form_id+'').click(function(){
				removeReadonly();
			});
			var form_id = '11';
			$("body").prepend('<div id="overlay" class="ui-widget-overlay" style="z-index: 1001; display: none;"></div>');
			$("body").prepend("<div id='PleaseWait' style='display: none;position: fixed;top: 0px;z-index: 30001;left: 50%;top: 50%;'><img src='https://boundlessaccelerator.ca/wp-content/themes/Divi-Child/images/loading.gif'/></div>");
			$('#gform_submit_button_'+form_id+'').click(function(){
				$("#overlay, #PleaseWait").show();
				setTimeout(function () {
                    $("#overlay, #PleaseWait").hide();
                }, 5000);
			});
		});
	</script>
	
<url>
<loc>https://ba.pfcd.ca/traction-survey-start-up/</loc>
<lastmod>2024-02-16T06:42:53-05:00</lastmod></url>	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript">
		jQuery(document).ready(function($){
		    //IGS-1188 -- START
			var desc_rev = '';
			var desc_emp = '';
			var desc_inv = '_8_99';
			var desc_int = '_8_106';
			var tract_id = '';
			var form_id = '8';
			var trac_id = $('#input'+tract_id).val();
			var cp_ids = '_8_216';
			var cp_id = $('#input'+cp_ids).val();
			
			if(form_id == '11' || form_id == '25' || form_id == '26' || form_id == '27' || form_id == '28' || form_id == '33' || form_id == '34' || form_id == '35' || form_id == '36' || form_id == '42' || form_id == '45'){
				var sec_rev = document.getElementById("gfield_description"+desc_rev).innerHTML;
				var sec_rev = sec_rev.replace("tractid", trac_id);
				var sec_rev = sec_rev.replace("cps_id", cp_id);
				document.getElementById("gfield_description"+desc_rev).innerHTML = sec_rev;
				
				var sec_emp = document.getElementById("gfield_description"+desc_emp).innerHTML;
				var sec_emp = sec_emp.replace("tractid", trac_id);
				document.getElementById("gfield_description"+desc_emp).innerHTML = sec_emp;
				
				var sec_inv = document.getElementById("gfield_description"+desc_inv).innerHTML;
    			var sec_inv = sec_inv.replace("tractid", trac_id);
    			var sec_inv = sec_inv.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_inv).innerHTML = sec_inv;
    			
    			var sec_int = document.getElementById("gfield_description"+desc_int).innerHTML;
    			var sec_int = sec_int.replace("tractid", trac_id);
    			var sec_int = sec_int.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_int).innerHTML = sec_int;
			}
			//IGS-1188 -- END
				
			var ip_id = '_8_156';
			var inv_id = '_8_155';
			var invmt_id = '155';
			var intel_id = '156';
			var form_id = '8';
			var page_id = '';
			var rev_id = '';
			var emp_id = '';
			setReadonly();
			function formatDate(date) {
				var d = new Date(date),
					month = '' + (d.getMonth() + 1),
					day = '' + d.getDate(),
					year = d.getFullYear();
				if (month.length < 2) month = '0' + month;
				if (day.length < 2) day = '0' + day;
				return [year, month, day].join('-');
			}
			function setReadonly(){
			    if(form_id == 1 || form_id == 5 || form_id == 6 || form_id == 7 || form_id == 8 || form_id == 10 || form_id == 32 || form_id == 40  || form_id == 44){
					$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						var id = currentElement.closest("div").find("input").val();
						if(id !=''){
						currentElement.closest("div").find("input").prop('disabled', true);
						currentElement.closest("div").find("select").prop('disabled', true);
						}else{
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
						}
						$(currentElement.closest("div").find("input")).each(function(key, val) {
							if(key == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
								//$(this).attr('style','display:none;');
								$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
								if($check_inv_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
								}
								var date_today = new Date();
								var previousMonth = date_today.getMonth() - 1;
								var today = new Date(date_today.getFullYear(), previousMonth, 1);
								var yyyy = today.getFullYear();
								var mm = today.getMonth() + 1; // Months start at 0!
								var dd = today.getDate();
				
								if (dd < 10) dd = '0' + dd;
								if (mm < 10) mm = '0' + mm;
				
								var formattedToday = mm + '/' + dd + '/' + yyyy;
								var value = formatDate(formattedToday);
								//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
							}
						});
					});
					if(form_id != 32){
						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
									//$(this).attr('style','display:none;');
									$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
									if($check_ip_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
									}
									var date_today = new Date();
									var previousMonth = date_today.getMonth() - 1;
									var today = new Date(date_today.getFullYear(), previousMonth, 1);
									var yyyy = today.getFullYear();
									var mm = today.getMonth() + 1; // Months start at 0!
									var dd = today.getDate();

									if (dd < 10) dd = '0' + dd;
									if (mm < 10) mm = '0' + mm;

									var formattedToday = mm + '/' + dd + '/' + yyyy;
									var value = formatDate(formattedToday);
									//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}else{
					if(form_id != 36){
						$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key, val) {
								if(key == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
										if($check_inv_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});

						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
										if($check_ip_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}
			}
					
			//IGS-1225 -- START
			var date_today = new Date();
			var previousMonth = date_today.getMonth() - 1;
			var today = new Date(date_today.getFullYear(), previousMonth, 1);
			var yyyy = today.getFullYear();
			var mm = today.getMonth() + 1; // Months start at 0!
			var dd = today.getDate();
			if (dd < 10) dd = '0' + dd;
			if (mm < 10) mm = '0' + mm;
			var formattedToday = mm + '/' + dd + '/' + yyyy;
			var date_value = formatDate(formattedToday);
			function investmentListFunc(){
				$('#field'+inv_id+' .gfield_list_group').each(function(index) {
				    if(form_id == 36){
						var cellTypeIndex = 2;
						var celldateIndex = 0;
						var cellOtherIndex = 5;
					}else{
						var cellTypeIndex = 3;
						var celldateIndex = 2;
						var cellOtherIndex = 6;
					}
					$(this).closest("div").attr('id', 'inv'+index);
					var investmentTypeSelect = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellTypeIndex);
					var investmentTypedate = $(this).find('.gfield_list_'+invmt_id+'_cell'+celldateIndex);
					var ifOtherInput = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex);
					investmentTypeSelect.attr('id', 'investment_type_' + index);
					investmentTypedate.attr('id', 'investment_date_' + index);
					ifOtherInput.attr('id', 'if_invother_' + index);		
					var other = 0;
					var inves_date = 0;
					var invest_type = $('#investment_type_'+index+' select').val();
				
					if(invest_type == 'Other'){
						$('#if_invother_'+index+' input').css('display', 'block');
					}else{
						$('#if_invother_'+index+' input').css('display', 'none');
					}
					$('#investment_type_'+index).change(function(){
						$('#investment_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	inves_date++;
							//}
						});
						//if(inves_date != 0){
						//	$('#investment_date_'+index+' input').val(date_value);
						//}else{
						//	$('#investment_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_invother_'+index+' input').css('display', 'block');
						}else{
							$('#if_invother_'+index+' input').css('display', 'none');
						}
						other = 0;
						inves_date = 0;
					});
					var inves = 0;

					$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							inves++;
						}
						if(inves > 0){
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
						}
					});
					var inves_chg = 0;
					$('#investment_type_'+index+' select').change(function(){
						$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								inves_chg++;
							}
							if(inves_chg > 0){
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
							}
						});
						inves_chg = 0;
					});
				});
			}
			if(form_id != 18){
				investmentListFunc();
				$('body').on('click', "#field"+inv_id+" .add_list_item", function() {
					investmentListFunc();
				});
			}
			intellactListFunc();
			$('body').on('click', "#field"+ip_id+" .add_list_item", function() {
			    intellactListFunc();
			});
			function intellactListFunc(){
				$('#field'+ip_id+' .gfield_list_group').each(function(index) {
					if(form_id == 36){
						var cellIpTypeIndex = 4;
						var cellIpdateIndex = 0;
						var cellIPOtherIndex = 5;
						var cellCountry = 2;
						var cellCountryOther = 3;
					}else{
						var cellIpTypeIndex = 5;
						var cellIpdateIndex = 2;
						var cellIPOtherIndex = 6;
						var cellCountry = 3;
						var cellCountryOther = 4;
					}
				    $(this).closest("div").attr('id', 'inv'+index);
					//IP Type dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).attr('id', 'intellact_type_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).attr('id', 'if_other_' + index);
					var intellTypedate = $(this).find('.gfield_list_'+intel_id+'_cell'+cellIpdateIndex);
					intellTypedate.attr('id', 'intell_date_' + index);
					
					var intel_type = $('#intellact_type_'+index+' select').val();
					if(intel_type == 'Other'){
						$('#if_other_'+index+' input').css('display', 'block');
					}else{
						$('#if_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					var intellact_date = 0;
					$('#intellact_type_'+index).change(function(){
						$('#intellact_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	intellact_date++;
							//}
						});
						//if(intellact_date != 0){
						//	$('#intell_date_'+index+' input').val(date_value);
						//}else{
						//	$('#intell_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_other_'+index+' input').css('display', 'block');
						}else{
							$('#if_other_'+index+' input').css('display', 'none');
						}
						other = 0; intellact_date = 0;
					});
					var intell = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intell++;
						}
						if(intell > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
						}
					});
					var intell_chg = 0;
					$('#intellact_type_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intell_chg++;
							}
							if(intell_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
							}
						});
						intell_chg = 0;
					});
					//IP Type dependent -- END
					//IP Country dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountry).attr('id', 'country_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountryOther).attr('id', 'cnt_other_' + index);					
					var intcnt_type = $('#country_'+index+' select').val();
					if(intcnt_type == 'Other'){
						$('#cnt_other_'+index+' input').css('display', 'block');
					}else{
						$('#cnt_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					$('#country_'+index).change(function(){
						$('#country_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
						});
						if(other > '0'){
							$('#cnt_other_'+index+' input').css('display', 'block');
						}else{
							$('#cnt_other_'+index+' input').css('display', 'none');
						}
						other = 0;
					});
					var intcnt = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intcnt++;
						}
						if(intcnt > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
						}
					});
					var intcnt_chg = 0;
					$('#country_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intcnt_chg++;
							}
							if(intcnt_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
							}
						});
						intcnt_chg = 0;
					});
					//IP Country dependent -- END
				});
			}
			//IGS-1225 -- END
			function removeReadonly(){
				$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
					var currentElement = $(this);
					currentElement.closest("div").find("input").prop('disabled', false);
					currentElement.closest("div").find("select").prop('disabled', false);
				});
				var form_id = '8';
				if(form_id != 32){
					$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
					});
				}
			}
			$('.add_list_item').click(function(){
			    setReadonly();
			});			
			$('#gform_submit_button_'+form_id+'').click(function(){
				removeReadonly();
			});
			var form_id = '8';
			$("body").prepend('<div id="overlay" class="ui-widget-overlay" style="z-index: 1001; display: none;"></div>');
			$("body").prepend("<div id='PleaseWait' style='display: none;position: fixed;top: 0px;z-index: 30001;left: 50%;top: 50%;'><img src='https://boundlessaccelerator.ca/wp-content/themes/Divi-Child/images/loading.gif'/></div>");
			$('#gform_submit_button_'+form_id+'').click(function(){
				$("#overlay, #PleaseWait").show();
				setTimeout(function () {
                    $("#overlay, #PleaseWait").hide();
                }, 5000);
			});
		});
	</script>
	
<url>
<loc>https://ba.pfcd.ca/start-up-program-form/</loc>
<lastmod>2024-02-16T01:07:05-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/security-check-for-survey-link/</loc>
<lastmod>2024-02-09T06:06:45-05:00</lastmod></url>	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript">
		jQuery(document).ready(function($){
		    //IGS-1188 -- START
			var desc_rev = '_28_20';
			var desc_emp = '_28_23';
			var desc_inv = '_28_15';
			var desc_int = '_28_17';
			var tract_id = '_28_45';
			var form_id = '28';
			var trac_id = $('#input'+tract_id).val();
			var cp_ids = '_28_44';
			var cp_id = $('#input'+cp_ids).val();
			
			if(form_id == '11' || form_id == '25' || form_id == '26' || form_id == '27' || form_id == '28' || form_id == '33' || form_id == '34' || form_id == '35' || form_id == '36' || form_id == '42' || form_id == '45'){
				var sec_rev = document.getElementById("gfield_description"+desc_rev).innerHTML;
				var sec_rev = sec_rev.replace("tractid", trac_id);
				var sec_rev = sec_rev.replace("cps_id", cp_id);
				document.getElementById("gfield_description"+desc_rev).innerHTML = sec_rev;
				
				var sec_emp = document.getElementById("gfield_description"+desc_emp).innerHTML;
				var sec_emp = sec_emp.replace("tractid", trac_id);
				document.getElementById("gfield_description"+desc_emp).innerHTML = sec_emp;
				
				var sec_inv = document.getElementById("gfield_description"+desc_inv).innerHTML;
    			var sec_inv = sec_inv.replace("tractid", trac_id);
    			var sec_inv = sec_inv.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_inv).innerHTML = sec_inv;
    			
    			var sec_int = document.getElementById("gfield_description"+desc_int).innerHTML;
    			var sec_int = sec_int.replace("tractid", trac_id);
    			var sec_int = sec_int.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_int).innerHTML = sec_int;
			}
			//IGS-1188 -- END
				
			var ip_id = '_28_18';
			var inv_id = '_28_16';
			var invmt_id = '16';
			var intel_id = '18';
			var form_id = '28';
			var page_id = '';
			var rev_id = '';
			var emp_id = '';
			setReadonly();
			function formatDate(date) {
				var d = new Date(date),
					month = '' + (d.getMonth() + 1),
					day = '' + d.getDate(),
					year = d.getFullYear();
				if (month.length < 2) month = '0' + month;
				if (day.length < 2) day = '0' + day;
				return [year, month, day].join('-');
			}
			function setReadonly(){
			    if(form_id == 1 || form_id == 5 || form_id == 6 || form_id == 7 || form_id == 8 || form_id == 10 || form_id == 32 || form_id == 40  || form_id == 44){
					$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						var id = currentElement.closest("div").find("input").val();
						if(id !=''){
						currentElement.closest("div").find("input").prop('disabled', true);
						currentElement.closest("div").find("select").prop('disabled', true);
						}else{
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
						}
						$(currentElement.closest("div").find("input")).each(function(key, val) {
							if(key == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
								//$(this).attr('style','display:none;');
								$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
								if($check_inv_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
								}
								var date_today = new Date();
								var previousMonth = date_today.getMonth() - 1;
								var today = new Date(date_today.getFullYear(), previousMonth, 1);
								var yyyy = today.getFullYear();
								var mm = today.getMonth() + 1; // Months start at 0!
								var dd = today.getDate();
				
								if (dd < 10) dd = '0' + dd;
								if (mm < 10) mm = '0' + mm;
				
								var formattedToday = mm + '/' + dd + '/' + yyyy;
								var value = formatDate(formattedToday);
								//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
							}
						});
					});
					if(form_id != 32){
						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
									//$(this).attr('style','display:none;');
									$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
									if($check_ip_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
									}
									var date_today = new Date();
									var previousMonth = date_today.getMonth() - 1;
									var today = new Date(date_today.getFullYear(), previousMonth, 1);
									var yyyy = today.getFullYear();
									var mm = today.getMonth() + 1; // Months start at 0!
									var dd = today.getDate();

									if (dd < 10) dd = '0' + dd;
									if (mm < 10) mm = '0' + mm;

									var formattedToday = mm + '/' + dd + '/' + yyyy;
									var value = formatDate(formattedToday);
									//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}else{
					if(form_id != 36){
						$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key, val) {
								if(key == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
										if($check_inv_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});

						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
										if($check_ip_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}
			}
					
			//IGS-1225 -- START
			var date_today = new Date();
			var previousMonth = date_today.getMonth() - 1;
			var today = new Date(date_today.getFullYear(), previousMonth, 1);
			var yyyy = today.getFullYear();
			var mm = today.getMonth() + 1; // Months start at 0!
			var dd = today.getDate();
			if (dd < 10) dd = '0' + dd;
			if (mm < 10) mm = '0' + mm;
			var formattedToday = mm + '/' + dd + '/' + yyyy;
			var date_value = formatDate(formattedToday);
			function investmentListFunc(){
				$('#field'+inv_id+' .gfield_list_group').each(function(index) {
				    if(form_id == 36){
						var cellTypeIndex = 2;
						var celldateIndex = 0;
						var cellOtherIndex = 5;
					}else{
						var cellTypeIndex = 3;
						var celldateIndex = 2;
						var cellOtherIndex = 6;
					}
					$(this).closest("div").attr('id', 'inv'+index);
					var investmentTypeSelect = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellTypeIndex);
					var investmentTypedate = $(this).find('.gfield_list_'+invmt_id+'_cell'+celldateIndex);
					var ifOtherInput = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex);
					investmentTypeSelect.attr('id', 'investment_type_' + index);
					investmentTypedate.attr('id', 'investment_date_' + index);
					ifOtherInput.attr('id', 'if_invother_' + index);		
					var other = 0;
					var inves_date = 0;
					var invest_type = $('#investment_type_'+index+' select').val();
				
					if(invest_type == 'Other'){
						$('#if_invother_'+index+' input').css('display', 'block');
					}else{
						$('#if_invother_'+index+' input').css('display', 'none');
					}
					$('#investment_type_'+index).change(function(){
						$('#investment_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	inves_date++;
							//}
						});
						//if(inves_date != 0){
						//	$('#investment_date_'+index+' input').val(date_value);
						//}else{
						//	$('#investment_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_invother_'+index+' input').css('display', 'block');
						}else{
							$('#if_invother_'+index+' input').css('display', 'none');
						}
						other = 0;
						inves_date = 0;
					});
					var inves = 0;

					$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							inves++;
						}
						if(inves > 0){
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
						}
					});
					var inves_chg = 0;
					$('#investment_type_'+index+' select').change(function(){
						$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								inves_chg++;
							}
							if(inves_chg > 0){
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
							}
						});
						inves_chg = 0;
					});
				});
			}
			if(form_id != 18){
				investmentListFunc();
				$('body').on('click', "#field"+inv_id+" .add_list_item", function() {
					investmentListFunc();
				});
			}
			intellactListFunc();
			$('body').on('click', "#field"+ip_id+" .add_list_item", function() {
			    intellactListFunc();
			});
			function intellactListFunc(){
				$('#field'+ip_id+' .gfield_list_group').each(function(index) {
					if(form_id == 36){
						var cellIpTypeIndex = 4;
						var cellIpdateIndex = 0;
						var cellIPOtherIndex = 5;
						var cellCountry = 2;
						var cellCountryOther = 3;
					}else{
						var cellIpTypeIndex = 5;
						var cellIpdateIndex = 2;
						var cellIPOtherIndex = 6;
						var cellCountry = 3;
						var cellCountryOther = 4;
					}
				    $(this).closest("div").attr('id', 'inv'+index);
					//IP Type dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).attr('id', 'intellact_type_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).attr('id', 'if_other_' + index);
					var intellTypedate = $(this).find('.gfield_list_'+intel_id+'_cell'+cellIpdateIndex);
					intellTypedate.attr('id', 'intell_date_' + index);
					
					var intel_type = $('#intellact_type_'+index+' select').val();
					if(intel_type == 'Other'){
						$('#if_other_'+index+' input').css('display', 'block');
					}else{
						$('#if_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					var intellact_date = 0;
					$('#intellact_type_'+index).change(function(){
						$('#intellact_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	intellact_date++;
							//}
						});
						//if(intellact_date != 0){
						//	$('#intell_date_'+index+' input').val(date_value);
						//}else{
						//	$('#intell_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_other_'+index+' input').css('display', 'block');
						}else{
							$('#if_other_'+index+' input').css('display', 'none');
						}
						other = 0; intellact_date = 0;
					});
					var intell = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intell++;
						}
						if(intell > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
						}
					});
					var intell_chg = 0;
					$('#intellact_type_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intell_chg++;
							}
							if(intell_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
							}
						});
						intell_chg = 0;
					});
					//IP Type dependent -- END
					//IP Country dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountry).attr('id', 'country_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountryOther).attr('id', 'cnt_other_' + index);					
					var intcnt_type = $('#country_'+index+' select').val();
					if(intcnt_type == 'Other'){
						$('#cnt_other_'+index+' input').css('display', 'block');
					}else{
						$('#cnt_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					$('#country_'+index).change(function(){
						$('#country_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
						});
						if(other > '0'){
							$('#cnt_other_'+index+' input').css('display', 'block');
						}else{
							$('#cnt_other_'+index+' input').css('display', 'none');
						}
						other = 0;
					});
					var intcnt = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intcnt++;
						}
						if(intcnt > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
						}
					});
					var intcnt_chg = 0;
					$('#country_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intcnt_chg++;
							}
							if(intcnt_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
							}
						});
						intcnt_chg = 0;
					});
					//IP Country dependent -- END
				});
			}
			//IGS-1225 -- END
			function removeReadonly(){
				$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
					var currentElement = $(this);
					currentElement.closest("div").find("input").prop('disabled', false);
					currentElement.closest("div").find("select").prop('disabled', false);
				});
				var form_id = '28';
				if(form_id != 32){
					$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
					});
				}
			}
			$('.add_list_item').click(function(){
			    setReadonly();
			});			
			$('#gform_submit_button_'+form_id+'').click(function(){
				removeReadonly();
			});
			var form_id = '28';
			$("body").prepend('<div id="overlay" class="ui-widget-overlay" style="z-index: 1001; display: none;"></div>');
			$("body").prepend("<div id='PleaseWait' style='display: none;position: fixed;top: 0px;z-index: 30001;left: 50%;top: 50%;'><img src='https://boundlessaccelerator.ca/wp-content/themes/Divi-Child/images/loading.gif'/></div>");
			$('#gform_submit_button_'+form_id+'').click(function(){
				$("#overlay, #PleaseWait").show();
				setTimeout(function () {
                    $("#overlay, #PleaseWait").hide();
                }, 5000);
			});
		});
	</script>
	
<url>
<loc>https://ba.pfcd.ca/traction-survey-i-d-e-a-fund/</loc>
<lastmod>2024-01-25T09:07:45-05:00</lastmod></url>	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript">
		jQuery(document).ready(function($){
		    //IGS-1188 -- START
			var desc_rev = '_27_20';
			var desc_emp = '_27_23';
			var desc_inv = '_27_15';
			var desc_int = '_27_17';
			var tract_id = '_27_33';
			var form_id = '27';
			var trac_id = $('#input'+tract_id).val();
			var cp_ids = '_27_32';
			var cp_id = $('#input'+cp_ids).val();
			
			if(form_id == '11' || form_id == '25' || form_id == '26' || form_id == '27' || form_id == '28' || form_id == '33' || form_id == '34' || form_id == '35' || form_id == '36' || form_id == '42' || form_id == '45'){
				var sec_rev = document.getElementById("gfield_description"+desc_rev).innerHTML;
				var sec_rev = sec_rev.replace("tractid", trac_id);
				var sec_rev = sec_rev.replace("cps_id", cp_id);
				document.getElementById("gfield_description"+desc_rev).innerHTML = sec_rev;
				
				var sec_emp = document.getElementById("gfield_description"+desc_emp).innerHTML;
				var sec_emp = sec_emp.replace("tractid", trac_id);
				document.getElementById("gfield_description"+desc_emp).innerHTML = sec_emp;
				
				var sec_inv = document.getElementById("gfield_description"+desc_inv).innerHTML;
    			var sec_inv = sec_inv.replace("tractid", trac_id);
    			var sec_inv = sec_inv.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_inv).innerHTML = sec_inv;
    			
    			var sec_int = document.getElementById("gfield_description"+desc_int).innerHTML;
    			var sec_int = sec_int.replace("tractid", trac_id);
    			var sec_int = sec_int.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_int).innerHTML = sec_int;
			}
			//IGS-1188 -- END
				
			var ip_id = '_27_18';
			var inv_id = '_27_16';
			var invmt_id = '16';
			var intel_id = '18';
			var form_id = '27';
			var page_id = '';
			var rev_id = '';
			var emp_id = '';
			setReadonly();
			function formatDate(date) {
				var d = new Date(date),
					month = '' + (d.getMonth() + 1),
					day = '' + d.getDate(),
					year = d.getFullYear();
				if (month.length < 2) month = '0' + month;
				if (day.length < 2) day = '0' + day;
				return [year, month, day].join('-');
			}
			function setReadonly(){
			    if(form_id == 1 || form_id == 5 || form_id == 6 || form_id == 7 || form_id == 8 || form_id == 10 || form_id == 32 || form_id == 40  || form_id == 44){
					$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						var id = currentElement.closest("div").find("input").val();
						if(id !=''){
						currentElement.closest("div").find("input").prop('disabled', true);
						currentElement.closest("div").find("select").prop('disabled', true);
						}else{
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
						}
						$(currentElement.closest("div").find("input")).each(function(key, val) {
							if(key == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
								//$(this).attr('style','display:none;');
								$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
								if($check_inv_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
								}
								var date_today = new Date();
								var previousMonth = date_today.getMonth() - 1;
								var today = new Date(date_today.getFullYear(), previousMonth, 1);
								var yyyy = today.getFullYear();
								var mm = today.getMonth() + 1; // Months start at 0!
								var dd = today.getDate();
				
								if (dd < 10) dd = '0' + dd;
								if (mm < 10) mm = '0' + mm;
				
								var formattedToday = mm + '/' + dd + '/' + yyyy;
								var value = formatDate(formattedToday);
								//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
							}
						});
					});
					if(form_id != 32){
						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
									//$(this).attr('style','display:none;');
									$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
									if($check_ip_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
									}
									var date_today = new Date();
									var previousMonth = date_today.getMonth() - 1;
									var today = new Date(date_today.getFullYear(), previousMonth, 1);
									var yyyy = today.getFullYear();
									var mm = today.getMonth() + 1; // Months start at 0!
									var dd = today.getDate();

									if (dd < 10) dd = '0' + dd;
									if (mm < 10) mm = '0' + mm;

									var formattedToday = mm + '/' + dd + '/' + yyyy;
									var value = formatDate(formattedToday);
									//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}else{
					if(form_id != 36){
						$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key, val) {
								if(key == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
										if($check_inv_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});

						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
										if($check_ip_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}
			}
					
			//IGS-1225 -- START
			var date_today = new Date();
			var previousMonth = date_today.getMonth() - 1;
			var today = new Date(date_today.getFullYear(), previousMonth, 1);
			var yyyy = today.getFullYear();
			var mm = today.getMonth() + 1; // Months start at 0!
			var dd = today.getDate();
			if (dd < 10) dd = '0' + dd;
			if (mm < 10) mm = '0' + mm;
			var formattedToday = mm + '/' + dd + '/' + yyyy;
			var date_value = formatDate(formattedToday);
			function investmentListFunc(){
				$('#field'+inv_id+' .gfield_list_group').each(function(index) {
				    if(form_id == 36){
						var cellTypeIndex = 2;
						var celldateIndex = 0;
						var cellOtherIndex = 5;
					}else{
						var cellTypeIndex = 3;
						var celldateIndex = 2;
						var cellOtherIndex = 6;
					}
					$(this).closest("div").attr('id', 'inv'+index);
					var investmentTypeSelect = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellTypeIndex);
					var investmentTypedate = $(this).find('.gfield_list_'+invmt_id+'_cell'+celldateIndex);
					var ifOtherInput = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex);
					investmentTypeSelect.attr('id', 'investment_type_' + index);
					investmentTypedate.attr('id', 'investment_date_' + index);
					ifOtherInput.attr('id', 'if_invother_' + index);		
					var other = 0;
					var inves_date = 0;
					var invest_type = $('#investment_type_'+index+' select').val();
				
					if(invest_type == 'Other'){
						$('#if_invother_'+index+' input').css('display', 'block');
					}else{
						$('#if_invother_'+index+' input').css('display', 'none');
					}
					$('#investment_type_'+index).change(function(){
						$('#investment_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	inves_date++;
							//}
						});
						//if(inves_date != 0){
						//	$('#investment_date_'+index+' input').val(date_value);
						//}else{
						//	$('#investment_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_invother_'+index+' input').css('display', 'block');
						}else{
							$('#if_invother_'+index+' input').css('display', 'none');
						}
						other = 0;
						inves_date = 0;
					});
					var inves = 0;

					$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							inves++;
						}
						if(inves > 0){
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
						}
					});
					var inves_chg = 0;
					$('#investment_type_'+index+' select').change(function(){
						$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								inves_chg++;
							}
							if(inves_chg > 0){
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
							}
						});
						inves_chg = 0;
					});
				});
			}
			if(form_id != 18){
				investmentListFunc();
				$('body').on('click', "#field"+inv_id+" .add_list_item", function() {
					investmentListFunc();
				});
			}
			intellactListFunc();
			$('body').on('click', "#field"+ip_id+" .add_list_item", function() {
			    intellactListFunc();
			});
			function intellactListFunc(){
				$('#field'+ip_id+' .gfield_list_group').each(function(index) {
					if(form_id == 36){
						var cellIpTypeIndex = 4;
						var cellIpdateIndex = 0;
						var cellIPOtherIndex = 5;
						var cellCountry = 2;
						var cellCountryOther = 3;
					}else{
						var cellIpTypeIndex = 5;
						var cellIpdateIndex = 2;
						var cellIPOtherIndex = 6;
						var cellCountry = 3;
						var cellCountryOther = 4;
					}
				    $(this).closest("div").attr('id', 'inv'+index);
					//IP Type dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).attr('id', 'intellact_type_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).attr('id', 'if_other_' + index);
					var intellTypedate = $(this).find('.gfield_list_'+intel_id+'_cell'+cellIpdateIndex);
					intellTypedate.attr('id', 'intell_date_' + index);
					
					var intel_type = $('#intellact_type_'+index+' select').val();
					if(intel_type == 'Other'){
						$('#if_other_'+index+' input').css('display', 'block');
					}else{
						$('#if_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					var intellact_date = 0;
					$('#intellact_type_'+index).change(function(){
						$('#intellact_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	intellact_date++;
							//}
						});
						//if(intellact_date != 0){
						//	$('#intell_date_'+index+' input').val(date_value);
						//}else{
						//	$('#intell_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_other_'+index+' input').css('display', 'block');
						}else{
							$('#if_other_'+index+' input').css('display', 'none');
						}
						other = 0; intellact_date = 0;
					});
					var intell = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intell++;
						}
						if(intell > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
						}
					});
					var intell_chg = 0;
					$('#intellact_type_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intell_chg++;
							}
							if(intell_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
							}
						});
						intell_chg = 0;
					});
					//IP Type dependent -- END
					//IP Country dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountry).attr('id', 'country_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountryOther).attr('id', 'cnt_other_' + index);					
					var intcnt_type = $('#country_'+index+' select').val();
					if(intcnt_type == 'Other'){
						$('#cnt_other_'+index+' input').css('display', 'block');
					}else{
						$('#cnt_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					$('#country_'+index).change(function(){
						$('#country_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
						});
						if(other > '0'){
							$('#cnt_other_'+index+' input').css('display', 'block');
						}else{
							$('#cnt_other_'+index+' input').css('display', 'none');
						}
						other = 0;
					});
					var intcnt = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intcnt++;
						}
						if(intcnt > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
						}
					});
					var intcnt_chg = 0;
					$('#country_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intcnt_chg++;
							}
							if(intcnt_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
							}
						});
						intcnt_chg = 0;
					});
					//IP Country dependent -- END
				});
			}
			//IGS-1225 -- END
			function removeReadonly(){
				$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
					var currentElement = $(this);
					currentElement.closest("div").find("input").prop('disabled', false);
					currentElement.closest("div").find("select").prop('disabled', false);
				});
				var form_id = '27';
				if(form_id != 32){
					$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
					});
				}
			}
			$('.add_list_item').click(function(){
			    setReadonly();
			});			
			$('#gform_submit_button_'+form_id+'').click(function(){
				removeReadonly();
			});
			var form_id = '27';
			$("body").prepend('<div id="overlay" class="ui-widget-overlay" style="z-index: 1001; display: none;"></div>');
			$("body").prepend("<div id='PleaseWait' style='display: none;position: fixed;top: 0px;z-index: 30001;left: 50%;top: 50%;'><img src='https://boundlessaccelerator.ca/wp-content/themes/Divi-Child/images/loading.gif'/></div>");
			$('#gform_submit_button_'+form_id+'').click(function(){
				$("#overlay, #PleaseWait").show();
				setTimeout(function () {
                    $("#overlay, #PleaseWait").hide();
                }, 5000);
			});
		});
	</script>
	
<url>
<loc>https://ba.pfcd.ca/traction-survey-coil/</loc>
<lastmod>2024-01-25T09:06:42-05:00</lastmod></url>	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript">
		jQuery(document).ready(function($){
		    //IGS-1188 -- START
			var desc_rev = '_26_20';
			var desc_emp = '_26_23';
			var desc_inv = '_26_15';
			var desc_int = '_26_17';
			var tract_id = '_26_32';
			var form_id = '26';
			var trac_id = $('#input'+tract_id).val();
			var cp_ids = '_26_30';
			var cp_id = $('#input'+cp_ids).val();
			
			if(form_id == '11' || form_id == '25' || form_id == '26' || form_id == '27' || form_id == '28' || form_id == '33' || form_id == '34' || form_id == '35' || form_id == '36' || form_id == '42' || form_id == '45'){
				var sec_rev = document.getElementById("gfield_description"+desc_rev).innerHTML;
				var sec_rev = sec_rev.replace("tractid", trac_id);
				var sec_rev = sec_rev.replace("cps_id", cp_id);
				document.getElementById("gfield_description"+desc_rev).innerHTML = sec_rev;
				
				var sec_emp = document.getElementById("gfield_description"+desc_emp).innerHTML;
				var sec_emp = sec_emp.replace("tractid", trac_id);
				document.getElementById("gfield_description"+desc_emp).innerHTML = sec_emp;
				
				var sec_inv = document.getElementById("gfield_description"+desc_inv).innerHTML;
    			var sec_inv = sec_inv.replace("tractid", trac_id);
    			var sec_inv = sec_inv.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_inv).innerHTML = sec_inv;
    			
    			var sec_int = document.getElementById("gfield_description"+desc_int).innerHTML;
    			var sec_int = sec_int.replace("tractid", trac_id);
    			var sec_int = sec_int.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_int).innerHTML = sec_int;
			}
			//IGS-1188 -- END
				
			var ip_id = '_26_18';
			var inv_id = '_26_16';
			var invmt_id = '16';
			var intel_id = '18';
			var form_id = '26';
			var page_id = '';
			var rev_id = '';
			var emp_id = '';
			setReadonly();
			function formatDate(date) {
				var d = new Date(date),
					month = '' + (d.getMonth() + 1),
					day = '' + d.getDate(),
					year = d.getFullYear();
				if (month.length < 2) month = '0' + month;
				if (day.length < 2) day = '0' + day;
				return [year, month, day].join('-');
			}
			function setReadonly(){
			    if(form_id == 1 || form_id == 5 || form_id == 6 || form_id == 7 || form_id == 8 || form_id == 10 || form_id == 32 || form_id == 40  || form_id == 44){
					$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						var id = currentElement.closest("div").find("input").val();
						if(id !=''){
						currentElement.closest("div").find("input").prop('disabled', true);
						currentElement.closest("div").find("select").prop('disabled', true);
						}else{
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
						}
						$(currentElement.closest("div").find("input")).each(function(key, val) {
							if(key == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
								//$(this).attr('style','display:none;');
								$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
								if($check_inv_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
								}
								var date_today = new Date();
								var previousMonth = date_today.getMonth() - 1;
								var today = new Date(date_today.getFullYear(), previousMonth, 1);
								var yyyy = today.getFullYear();
								var mm = today.getMonth() + 1; // Months start at 0!
								var dd = today.getDate();
				
								if (dd < 10) dd = '0' + dd;
								if (mm < 10) mm = '0' + mm;
				
								var formattedToday = mm + '/' + dd + '/' + yyyy;
								var value = formatDate(formattedToday);
								//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
							}
						});
					});
					if(form_id != 32){
						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
									//$(this).attr('style','display:none;');
									$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
									if($check_ip_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
									}
									var date_today = new Date();
									var previousMonth = date_today.getMonth() - 1;
									var today = new Date(date_today.getFullYear(), previousMonth, 1);
									var yyyy = today.getFullYear();
									var mm = today.getMonth() + 1; // Months start at 0!
									var dd = today.getDate();

									if (dd < 10) dd = '0' + dd;
									if (mm < 10) mm = '0' + mm;

									var formattedToday = mm + '/' + dd + '/' + yyyy;
									var value = formatDate(formattedToday);
									//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}else{
					if(form_id != 36){
						$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key, val) {
								if(key == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
										if($check_inv_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});

						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
										if($check_ip_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}
			}
					
			//IGS-1225 -- START
			var date_today = new Date();
			var previousMonth = date_today.getMonth() - 1;
			var today = new Date(date_today.getFullYear(), previousMonth, 1);
			var yyyy = today.getFullYear();
			var mm = today.getMonth() + 1; // Months start at 0!
			var dd = today.getDate();
			if (dd < 10) dd = '0' + dd;
			if (mm < 10) mm = '0' + mm;
			var formattedToday = mm + '/' + dd + '/' + yyyy;
			var date_value = formatDate(formattedToday);
			function investmentListFunc(){
				$('#field'+inv_id+' .gfield_list_group').each(function(index) {
				    if(form_id == 36){
						var cellTypeIndex = 2;
						var celldateIndex = 0;
						var cellOtherIndex = 5;
					}else{
						var cellTypeIndex = 3;
						var celldateIndex = 2;
						var cellOtherIndex = 6;
					}
					$(this).closest("div").attr('id', 'inv'+index);
					var investmentTypeSelect = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellTypeIndex);
					var investmentTypedate = $(this).find('.gfield_list_'+invmt_id+'_cell'+celldateIndex);
					var ifOtherInput = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex);
					investmentTypeSelect.attr('id', 'investment_type_' + index);
					investmentTypedate.attr('id', 'investment_date_' + index);
					ifOtherInput.attr('id', 'if_invother_' + index);		
					var other = 0;
					var inves_date = 0;
					var invest_type = $('#investment_type_'+index+' select').val();
				
					if(invest_type == 'Other'){
						$('#if_invother_'+index+' input').css('display', 'block');
					}else{
						$('#if_invother_'+index+' input').css('display', 'none');
					}
					$('#investment_type_'+index).change(function(){
						$('#investment_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	inves_date++;
							//}
						});
						//if(inves_date != 0){
						//	$('#investment_date_'+index+' input').val(date_value);
						//}else{
						//	$('#investment_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_invother_'+index+' input').css('display', 'block');
						}else{
							$('#if_invother_'+index+' input').css('display', 'none');
						}
						other = 0;
						inves_date = 0;
					});
					var inves = 0;

					$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							inves++;
						}
						if(inves > 0){
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
						}
					});
					var inves_chg = 0;
					$('#investment_type_'+index+' select').change(function(){
						$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								inves_chg++;
							}
							if(inves_chg > 0){
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
							}
						});
						inves_chg = 0;
					});
				});
			}
			if(form_id != 18){
				investmentListFunc();
				$('body').on('click', "#field"+inv_id+" .add_list_item", function() {
					investmentListFunc();
				});
			}
			intellactListFunc();
			$('body').on('click', "#field"+ip_id+" .add_list_item", function() {
			    intellactListFunc();
			});
			function intellactListFunc(){
				$('#field'+ip_id+' .gfield_list_group').each(function(index) {
					if(form_id == 36){
						var cellIpTypeIndex = 4;
						var cellIpdateIndex = 0;
						var cellIPOtherIndex = 5;
						var cellCountry = 2;
						var cellCountryOther = 3;
					}else{
						var cellIpTypeIndex = 5;
						var cellIpdateIndex = 2;
						var cellIPOtherIndex = 6;
						var cellCountry = 3;
						var cellCountryOther = 4;
					}
				    $(this).closest("div").attr('id', 'inv'+index);
					//IP Type dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).attr('id', 'intellact_type_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).attr('id', 'if_other_' + index);
					var intellTypedate = $(this).find('.gfield_list_'+intel_id+'_cell'+cellIpdateIndex);
					intellTypedate.attr('id', 'intell_date_' + index);
					
					var intel_type = $('#intellact_type_'+index+' select').val();
					if(intel_type == 'Other'){
						$('#if_other_'+index+' input').css('display', 'block');
					}else{
						$('#if_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					var intellact_date = 0;
					$('#intellact_type_'+index).change(function(){
						$('#intellact_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	intellact_date++;
							//}
						});
						//if(intellact_date != 0){
						//	$('#intell_date_'+index+' input').val(date_value);
						//}else{
						//	$('#intell_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_other_'+index+' input').css('display', 'block');
						}else{
							$('#if_other_'+index+' input').css('display', 'none');
						}
						other = 0; intellact_date = 0;
					});
					var intell = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intell++;
						}
						if(intell > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
						}
					});
					var intell_chg = 0;
					$('#intellact_type_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intell_chg++;
							}
							if(intell_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
							}
						});
						intell_chg = 0;
					});
					//IP Type dependent -- END
					//IP Country dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountry).attr('id', 'country_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountryOther).attr('id', 'cnt_other_' + index);					
					var intcnt_type = $('#country_'+index+' select').val();
					if(intcnt_type == 'Other'){
						$('#cnt_other_'+index+' input').css('display', 'block');
					}else{
						$('#cnt_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					$('#country_'+index).change(function(){
						$('#country_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
						});
						if(other > '0'){
							$('#cnt_other_'+index+' input').css('display', 'block');
						}else{
							$('#cnt_other_'+index+' input').css('display', 'none');
						}
						other = 0;
					});
					var intcnt = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intcnt++;
						}
						if(intcnt > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
						}
					});
					var intcnt_chg = 0;
					$('#country_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intcnt_chg++;
							}
							if(intcnt_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
							}
						});
						intcnt_chg = 0;
					});
					//IP Country dependent -- END
				});
			}
			//IGS-1225 -- END
			function removeReadonly(){
				$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
					var currentElement = $(this);
					currentElement.closest("div").find("input").prop('disabled', false);
					currentElement.closest("div").find("select").prop('disabled', false);
				});
				var form_id = '26';
				if(form_id != 32){
					$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
					});
				}
			}
			$('.add_list_item').click(function(){
			    setReadonly();
			});			
			$('#gform_submit_button_'+form_id+'').click(function(){
				removeReadonly();
			});
			var form_id = '26';
			$("body").prepend('<div id="overlay" class="ui-widget-overlay" style="z-index: 1001; display: none;"></div>');
			$("body").prepend("<div id='PleaseWait' style='display: none;position: fixed;top: 0px;z-index: 30001;left: 50%;top: 50%;'><img src='https://boundlessaccelerator.ca/wp-content/themes/Divi-Child/images/loading.gif'/></div>");
			$('#gform_submit_button_'+form_id+'').click(function(){
				$("#overlay, #PleaseWait").show();
				setTimeout(function () {
                    $("#overlay, #PleaseWait").hide();
                }, 5000);
			});
		});
	</script>
	
<url>
<loc>https://ba.pfcd.ca/traction-survey-rhyze-venture/</loc>
<lastmod>2024-01-25T09:05:53-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/survey-has-been-sent/</loc>
<lastmod>2024-01-25T08:01:01-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/traction-survey-start-up/thank-you-2/</loc>
<lastmod>2024-01-25T07:58:06-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/perk-partners/</loc>
<lastmod>2024-01-18T10:57:39-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/become-a-client/</loc>
<lastmod>2024-01-04T14:15:21-05:00</lastmod>
<image:image>
<image:loc><![CDATA[https://ba.pfcd.ca/wp-content/uploads/2023/09/EXPORT-STOCK-IMAGES1.jpg]]></image:loc>
</image:image></url>
<url>
<loc>https://ba.pfcd.ca/about/meet-our-experts/</loc>
<lastmod>2024-01-04T14:06:05-05:00</lastmod>
<image:image>
<image:loc><![CDATA[https://ba.pfcd.ca/wp-content/uploads/2023/11/BBC-1.jpg]]></image:loc>
</image:image></url>
<url>
<loc>https://ba.pfcd.ca/about/</loc>
<lastmod>2024-01-04T13:57:52-05:00</lastmod>
<image:image>
<image:loc><![CDATA[https://ba.pfcd.ca/wp-content/uploads/2023/11/BA-Launch-Press-Release-Graphic-16x10-1.jpg]]></image:loc>
</image:image></url>
<url>
<loc>https://ba.pfcd.ca/programs/rhyze-up/</loc>
<lastmod>2024-01-03T10:52:33-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/rhyze-up-accelerator-form/thank-you/</loc>
<lastmod>2023-12-19T14:51:32-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/</loc>
<lastmod>2023-12-11T11:08:33-05:00</lastmod>
<image:image>
<image:loc><![CDATA[https://boundlessaccelerator.ca/wp-content/uploads/2023/10/Boundless-Start-Up-Program_Logo.svg]]></image:loc>
</image:image>
<image:image>
<image:loc><![CDATA[https://boundlessaccelerator.ca/wp-content/uploads/2023/09/Rhyze-Up-300x179.png]]></image:loc>
</image:image>
<image:image>
<image:loc><![CDATA[https://boundlessaccelerator.ca/wp-content/uploads/2023/09/COIL_Activate-300x80.png]]></image:loc>
</image:image>
<image:image>
<image:loc><![CDATA[https://boundlessaccelerator.ca/wp-content/uploads/2023/09/Idea-Fund-300x116.png]]></image:loc>
</image:image>
<image:image>
<image:loc><![CDATA[https://boundlessaccelerator.ca/wp-content/uploads/2023/10/Quantum-Drive-Logo-300x100.webp]]></image:loc>
</image:image>
<image:image>
<image:loc><![CDATA[https://boundlessaccelerator.ca/wp-content/uploads/2023/10/VCR_Logo_H_LogoOnly-300x221.webp]]></image:loc>
</image:image>
<image:image>
<image:loc><![CDATA[https://ba.pfcd.ca//wp-content/uploads/2023/11/Ian-Leis_Ward1BrewingCo-150x150.jpg]]></image:loc>
</image:image>
<image:image>
<image:loc><![CDATA[https://ba.pfcd.ca//wp-content/uploads/2023/11/Melissa-Lloyd_Doodle-Lovely-150x150.jpg]]></image:loc>
</image:image>
<image:image>
<image:loc><![CDATA[https://ba.pfcd.ca//wp-content/uploads/2023/11/Kayli-Dale_Friendlier-150x150.jpg]]></image:loc>
</image:image>
<image:image>
<image:loc><![CDATA[https://ba.pfcd.ca//wp-content/uploads/2023/11/Sarah-Laing_MCAT-150x150.jpg]]></image:loc>
</image:image>
<image:image>
<image:loc><![CDATA[https://ba.pfcd.ca//wp-content/uploads/2023/11/David-Mazur-Goulet_Heartbeet-Farms-150x150.jpg]]></image:loc>
</image:image></url>
<url>
<loc>https://ba.pfcd.ca/coworking-3/</loc>
<lastmod>2023-11-23T16:44:49-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/coworking/</loc>
<lastmod>2023-11-21T16:38:19-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/contact/</loc>
<lastmod>2023-11-21T15:23:09-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/boundless-business-consulting/</loc>
<lastmod>2023-11-17T16:38:38-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/fast-lane-form/thank-you/</loc>
<lastmod>2023-11-17T15:30:55-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/start-up-program-form/thank-you/</loc>
<lastmod>2023-11-17T15:22:16-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/programs/coil-activate/</loc>
<lastmod>2023-11-15T10:30:38-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/programs/idea-fund/</loc>
<lastmod>2023-11-09T17:01:06-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/events/</loc>
<lastmod>2023-11-09T16:42:54-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/programs/quantum-drive/</loc>
<lastmod>2023-11-07T16:25:24-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/programs/startup-program/</loc>
<lastmod>2023-11-07T15:59:09-05:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/start-up-program-application-form/</loc>
<lastmod>2023-11-02T07:33:22-04:00</lastmod></url>	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript">
		jQuery(document).ready(function($){
		    //IGS-1188 -- START
			var desc_rev = '';
			var desc_emp = '';
			var desc_inv = '_10_99';
			var desc_int = '_10_106';
			var tract_id = '';
			var form_id = '10';
			var trac_id = $('#input'+tract_id).val();
			var cp_ids = '_10_209';
			var cp_id = $('#input'+cp_ids).val();
			
			if(form_id == '11' || form_id == '25' || form_id == '26' || form_id == '27' || form_id == '28' || form_id == '33' || form_id == '34' || form_id == '35' || form_id == '36' || form_id == '42' || form_id == '45'){
				var sec_rev = document.getElementById("gfield_description"+desc_rev).innerHTML;
				var sec_rev = sec_rev.replace("tractid", trac_id);
				var sec_rev = sec_rev.replace("cps_id", cp_id);
				document.getElementById("gfield_description"+desc_rev).innerHTML = sec_rev;
				
				var sec_emp = document.getElementById("gfield_description"+desc_emp).innerHTML;
				var sec_emp = sec_emp.replace("tractid", trac_id);
				document.getElementById("gfield_description"+desc_emp).innerHTML = sec_emp;
				
				var sec_inv = document.getElementById("gfield_description"+desc_inv).innerHTML;
    			var sec_inv = sec_inv.replace("tractid", trac_id);
    			var sec_inv = sec_inv.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_inv).innerHTML = sec_inv;
    			
    			var sec_int = document.getElementById("gfield_description"+desc_int).innerHTML;
    			var sec_int = sec_int.replace("tractid", trac_id);
    			var sec_int = sec_int.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_int).innerHTML = sec_int;
			}
			//IGS-1188 -- END
				
			var ip_id = '_10_159';
			var inv_id = '_10_158';
			var invmt_id = '158';
			var intel_id = '159';
			var form_id = '10';
			var page_id = '';
			var rev_id = '';
			var emp_id = '';
			setReadonly();
			function formatDate(date) {
				var d = new Date(date),
					month = '' + (d.getMonth() + 1),
					day = '' + d.getDate(),
					year = d.getFullYear();
				if (month.length < 2) month = '0' + month;
				if (day.length < 2) day = '0' + day;
				return [year, month, day].join('-');
			}
			function setReadonly(){
			    if(form_id == 1 || form_id == 5 || form_id == 6 || form_id == 7 || form_id == 8 || form_id == 10 || form_id == 32 || form_id == 40  || form_id == 44){
					$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						var id = currentElement.closest("div").find("input").val();
						if(id !=''){
						currentElement.closest("div").find("input").prop('disabled', true);
						currentElement.closest("div").find("select").prop('disabled', true);
						}else{
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
						}
						$(currentElement.closest("div").find("input")).each(function(key, val) {
							if(key == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
								//$(this).attr('style','display:none;');
								$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
								if($check_inv_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
								}
								var date_today = new Date();
								var previousMonth = date_today.getMonth() - 1;
								var today = new Date(date_today.getFullYear(), previousMonth, 1);
								var yyyy = today.getFullYear();
								var mm = today.getMonth() + 1; // Months start at 0!
								var dd = today.getDate();
				
								if (dd < 10) dd = '0' + dd;
								if (mm < 10) mm = '0' + mm;
				
								var formattedToday = mm + '/' + dd + '/' + yyyy;
								var value = formatDate(formattedToday);
								//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
							}
						});
					});
					if(form_id != 32){
						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
									//$(this).attr('style','display:none;');
									$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
									if($check_ip_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
									}
									var date_today = new Date();
									var previousMonth = date_today.getMonth() - 1;
									var today = new Date(date_today.getFullYear(), previousMonth, 1);
									var yyyy = today.getFullYear();
									var mm = today.getMonth() + 1; // Months start at 0!
									var dd = today.getDate();

									if (dd < 10) dd = '0' + dd;
									if (mm < 10) mm = '0' + mm;

									var formattedToday = mm + '/' + dd + '/' + yyyy;
									var value = formatDate(formattedToday);
									//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}else{
					if(form_id != 36){
						$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key, val) {
								if(key == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
										if($check_inv_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});

						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
										if($check_ip_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}
			}
					
			//IGS-1225 -- START
			var date_today = new Date();
			var previousMonth = date_today.getMonth() - 1;
			var today = new Date(date_today.getFullYear(), previousMonth, 1);
			var yyyy = today.getFullYear();
			var mm = today.getMonth() + 1; // Months start at 0!
			var dd = today.getDate();
			if (dd < 10) dd = '0' + dd;
			if (mm < 10) mm = '0' + mm;
			var formattedToday = mm + '/' + dd + '/' + yyyy;
			var date_value = formatDate(formattedToday);
			function investmentListFunc(){
				$('#field'+inv_id+' .gfield_list_group').each(function(index) {
				    if(form_id == 36){
						var cellTypeIndex = 2;
						var celldateIndex = 0;
						var cellOtherIndex = 5;
					}else{
						var cellTypeIndex = 3;
						var celldateIndex = 2;
						var cellOtherIndex = 6;
					}
					$(this).closest("div").attr('id', 'inv'+index);
					var investmentTypeSelect = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellTypeIndex);
					var investmentTypedate = $(this).find('.gfield_list_'+invmt_id+'_cell'+celldateIndex);
					var ifOtherInput = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex);
					investmentTypeSelect.attr('id', 'investment_type_' + index);
					investmentTypedate.attr('id', 'investment_date_' + index);
					ifOtherInput.attr('id', 'if_invother_' + index);		
					var other = 0;
					var inves_date = 0;
					var invest_type = $('#investment_type_'+index+' select').val();
				
					if(invest_type == 'Other'){
						$('#if_invother_'+index+' input').css('display', 'block');
					}else{
						$('#if_invother_'+index+' input').css('display', 'none');
					}
					$('#investment_type_'+index).change(function(){
						$('#investment_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	inves_date++;
							//}
						});
						//if(inves_date != 0){
						//	$('#investment_date_'+index+' input').val(date_value);
						//}else{
						//	$('#investment_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_invother_'+index+' input').css('display', 'block');
						}else{
							$('#if_invother_'+index+' input').css('display', 'none');
						}
						other = 0;
						inves_date = 0;
					});
					var inves = 0;

					$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							inves++;
						}
						if(inves > 0){
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
						}
					});
					var inves_chg = 0;
					$('#investment_type_'+index+' select').change(function(){
						$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								inves_chg++;
							}
							if(inves_chg > 0){
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
							}
						});
						inves_chg = 0;
					});
				});
			}
			if(form_id != 18){
				investmentListFunc();
				$('body').on('click', "#field"+inv_id+" .add_list_item", function() {
					investmentListFunc();
				});
			}
			intellactListFunc();
			$('body').on('click', "#field"+ip_id+" .add_list_item", function() {
			    intellactListFunc();
			});
			function intellactListFunc(){
				$('#field'+ip_id+' .gfield_list_group').each(function(index) {
					if(form_id == 36){
						var cellIpTypeIndex = 4;
						var cellIpdateIndex = 0;
						var cellIPOtherIndex = 5;
						var cellCountry = 2;
						var cellCountryOther = 3;
					}else{
						var cellIpTypeIndex = 5;
						var cellIpdateIndex = 2;
						var cellIPOtherIndex = 6;
						var cellCountry = 3;
						var cellCountryOther = 4;
					}
				    $(this).closest("div").attr('id', 'inv'+index);
					//IP Type dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).attr('id', 'intellact_type_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).attr('id', 'if_other_' + index);
					var intellTypedate = $(this).find('.gfield_list_'+intel_id+'_cell'+cellIpdateIndex);
					intellTypedate.attr('id', 'intell_date_' + index);
					
					var intel_type = $('#intellact_type_'+index+' select').val();
					if(intel_type == 'Other'){
						$('#if_other_'+index+' input').css('display', 'block');
					}else{
						$('#if_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					var intellact_date = 0;
					$('#intellact_type_'+index).change(function(){
						$('#intellact_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	intellact_date++;
							//}
						});
						//if(intellact_date != 0){
						//	$('#intell_date_'+index+' input').val(date_value);
						//}else{
						//	$('#intell_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_other_'+index+' input').css('display', 'block');
						}else{
							$('#if_other_'+index+' input').css('display', 'none');
						}
						other = 0; intellact_date = 0;
					});
					var intell = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intell++;
						}
						if(intell > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
						}
					});
					var intell_chg = 0;
					$('#intellact_type_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intell_chg++;
							}
							if(intell_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
							}
						});
						intell_chg = 0;
					});
					//IP Type dependent -- END
					//IP Country dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountry).attr('id', 'country_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountryOther).attr('id', 'cnt_other_' + index);					
					var intcnt_type = $('#country_'+index+' select').val();
					if(intcnt_type == 'Other'){
						$('#cnt_other_'+index+' input').css('display', 'block');
					}else{
						$('#cnt_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					$('#country_'+index).change(function(){
						$('#country_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
						});
						if(other > '0'){
							$('#cnt_other_'+index+' input').css('display', 'block');
						}else{
							$('#cnt_other_'+index+' input').css('display', 'none');
						}
						other = 0;
					});
					var intcnt = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intcnt++;
						}
						if(intcnt > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
						}
					});
					var intcnt_chg = 0;
					$('#country_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intcnt_chg++;
							}
							if(intcnt_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
							}
						});
						intcnt_chg = 0;
					});
					//IP Country dependent -- END
				});
			}
			//IGS-1225 -- END
			function removeReadonly(){
				$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
					var currentElement = $(this);
					currentElement.closest("div").find("input").prop('disabled', false);
					currentElement.closest("div").find("select").prop('disabled', false);
				});
				var form_id = '10';
				if(form_id != 32){
					$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
					});
				}
			}
			$('.add_list_item').click(function(){
			    setReadonly();
			});			
			$('#gform_submit_button_'+form_id+'').click(function(){
				removeReadonly();
			});
			var form_id = '10';
			$("body").prepend('<div id="overlay" class="ui-widget-overlay" style="z-index: 1001; display: none;"></div>');
			$("body").prepend("<div id='PleaseWait' style='display: none;position: fixed;top: 0px;z-index: 30001;left: 50%;top: 50%;'><img src='https://boundlessaccelerator.ca/wp-content/themes/Divi-Child/images/loading.gif'/></div>");
			$('#gform_submit_button_'+form_id+'').click(function(){
				$("#overlay, #PleaseWait").show();
				setTimeout(function () {
                    $("#overlay, #PleaseWait").hide();
                }, 5000);
			});
		});
	</script>
	
<url>
<loc>https://ba.pfcd.ca/coil-application-form/</loc>
<lastmod>2023-11-02T02:25:13-04:00</lastmod></url>	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript">
		jQuery(document).ready(function($){
		    //IGS-1188 -- START
			var desc_rev = '';
			var desc_emp = '';
			var desc_inv = '_5_99';
			var desc_int = '_5_106';
			var tract_id = '';
			var form_id = '5';
			var trac_id = $('#input'+tract_id).val();
			var cp_ids = '_5_209';
			var cp_id = $('#input'+cp_ids).val();
			
			if(form_id == '11' || form_id == '25' || form_id == '26' || form_id == '27' || form_id == '28' || form_id == '33' || form_id == '34' || form_id == '35' || form_id == '36' || form_id == '42' || form_id == '45'){
				var sec_rev = document.getElementById("gfield_description"+desc_rev).innerHTML;
				var sec_rev = sec_rev.replace("tractid", trac_id);
				var sec_rev = sec_rev.replace("cps_id", cp_id);
				document.getElementById("gfield_description"+desc_rev).innerHTML = sec_rev;
				
				var sec_emp = document.getElementById("gfield_description"+desc_emp).innerHTML;
				var sec_emp = sec_emp.replace("tractid", trac_id);
				document.getElementById("gfield_description"+desc_emp).innerHTML = sec_emp;
				
				var sec_inv = document.getElementById("gfield_description"+desc_inv).innerHTML;
    			var sec_inv = sec_inv.replace("tractid", trac_id);
    			var sec_inv = sec_inv.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_inv).innerHTML = sec_inv;
    			
    			var sec_int = document.getElementById("gfield_description"+desc_int).innerHTML;
    			var sec_int = sec_int.replace("tractid", trac_id);
    			var sec_int = sec_int.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_int).innerHTML = sec_int;
			}
			//IGS-1188 -- END
				
			var ip_id = '_5_159';
			var inv_id = '_5_158';
			var invmt_id = '158';
			var intel_id = '159';
			var form_id = '5';
			var page_id = '';
			var rev_id = '';
			var emp_id = '';
			setReadonly();
			function formatDate(date) {
				var d = new Date(date),
					month = '' + (d.getMonth() + 1),
					day = '' + d.getDate(),
					year = d.getFullYear();
				if (month.length < 2) month = '0' + month;
				if (day.length < 2) day = '0' + day;
				return [year, month, day].join('-');
			}
			function setReadonly(){
			    if(form_id == 1 || form_id == 5 || form_id == 6 || form_id == 7 || form_id == 8 || form_id == 10 || form_id == 32 || form_id == 40  || form_id == 44){
					$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						var id = currentElement.closest("div").find("input").val();
						if(id !=''){
						currentElement.closest("div").find("input").prop('disabled', true);
						currentElement.closest("div").find("select").prop('disabled', true);
						}else{
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
						}
						$(currentElement.closest("div").find("input")).each(function(key, val) {
							if(key == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
								//$(this).attr('style','display:none;');
								$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
								if($check_inv_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
								}
								var date_today = new Date();
								var previousMonth = date_today.getMonth() - 1;
								var today = new Date(date_today.getFullYear(), previousMonth, 1);
								var yyyy = today.getFullYear();
								var mm = today.getMonth() + 1; // Months start at 0!
								var dd = today.getDate();
				
								if (dd < 10) dd = '0' + dd;
								if (mm < 10) mm = '0' + mm;
				
								var formattedToday = mm + '/' + dd + '/' + yyyy;
								var value = formatDate(formattedToday);
								//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
							}
						});
					});
					if(form_id != 32){
						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
									//$(this).attr('style','display:none;');
									$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
									if($check_ip_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
									}
									var date_today = new Date();
									var previousMonth = date_today.getMonth() - 1;
									var today = new Date(date_today.getFullYear(), previousMonth, 1);
									var yyyy = today.getFullYear();
									var mm = today.getMonth() + 1; // Months start at 0!
									var dd = today.getDate();

									if (dd < 10) dd = '0' + dd;
									if (mm < 10) mm = '0' + mm;

									var formattedToday = mm + '/' + dd + '/' + yyyy;
									var value = formatDate(formattedToday);
									//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}else{
					if(form_id != 36){
						$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key, val) {
								if(key == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
										if($check_inv_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});

						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
										if($check_ip_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}
			}
					
			//IGS-1225 -- START
			var date_today = new Date();
			var previousMonth = date_today.getMonth() - 1;
			var today = new Date(date_today.getFullYear(), previousMonth, 1);
			var yyyy = today.getFullYear();
			var mm = today.getMonth() + 1; // Months start at 0!
			var dd = today.getDate();
			if (dd < 10) dd = '0' + dd;
			if (mm < 10) mm = '0' + mm;
			var formattedToday = mm + '/' + dd + '/' + yyyy;
			var date_value = formatDate(formattedToday);
			function investmentListFunc(){
				$('#field'+inv_id+' .gfield_list_group').each(function(index) {
				    if(form_id == 36){
						var cellTypeIndex = 2;
						var celldateIndex = 0;
						var cellOtherIndex = 5;
					}else{
						var cellTypeIndex = 3;
						var celldateIndex = 2;
						var cellOtherIndex = 6;
					}
					$(this).closest("div").attr('id', 'inv'+index);
					var investmentTypeSelect = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellTypeIndex);
					var investmentTypedate = $(this).find('.gfield_list_'+invmt_id+'_cell'+celldateIndex);
					var ifOtherInput = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex);
					investmentTypeSelect.attr('id', 'investment_type_' + index);
					investmentTypedate.attr('id', 'investment_date_' + index);
					ifOtherInput.attr('id', 'if_invother_' + index);		
					var other = 0;
					var inves_date = 0;
					var invest_type = $('#investment_type_'+index+' select').val();
				
					if(invest_type == 'Other'){
						$('#if_invother_'+index+' input').css('display', 'block');
					}else{
						$('#if_invother_'+index+' input').css('display', 'none');
					}
					$('#investment_type_'+index).change(function(){
						$('#investment_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	inves_date++;
							//}
						});
						//if(inves_date != 0){
						//	$('#investment_date_'+index+' input').val(date_value);
						//}else{
						//	$('#investment_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_invother_'+index+' input').css('display', 'block');
						}else{
							$('#if_invother_'+index+' input').css('display', 'none');
						}
						other = 0;
						inves_date = 0;
					});
					var inves = 0;

					$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							inves++;
						}
						if(inves > 0){
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
						}
					});
					var inves_chg = 0;
					$('#investment_type_'+index+' select').change(function(){
						$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								inves_chg++;
							}
							if(inves_chg > 0){
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
							}
						});
						inves_chg = 0;
					});
				});
			}
			if(form_id != 18){
				investmentListFunc();
				$('body').on('click', "#field"+inv_id+" .add_list_item", function() {
					investmentListFunc();
				});
			}
			intellactListFunc();
			$('body').on('click', "#field"+ip_id+" .add_list_item", function() {
			    intellactListFunc();
			});
			function intellactListFunc(){
				$('#field'+ip_id+' .gfield_list_group').each(function(index) {
					if(form_id == 36){
						var cellIpTypeIndex = 4;
						var cellIpdateIndex = 0;
						var cellIPOtherIndex = 5;
						var cellCountry = 2;
						var cellCountryOther = 3;
					}else{
						var cellIpTypeIndex = 5;
						var cellIpdateIndex = 2;
						var cellIPOtherIndex = 6;
						var cellCountry = 3;
						var cellCountryOther = 4;
					}
				    $(this).closest("div").attr('id', 'inv'+index);
					//IP Type dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).attr('id', 'intellact_type_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).attr('id', 'if_other_' + index);
					var intellTypedate = $(this).find('.gfield_list_'+intel_id+'_cell'+cellIpdateIndex);
					intellTypedate.attr('id', 'intell_date_' + index);
					
					var intel_type = $('#intellact_type_'+index+' select').val();
					if(intel_type == 'Other'){
						$('#if_other_'+index+' input').css('display', 'block');
					}else{
						$('#if_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					var intellact_date = 0;
					$('#intellact_type_'+index).change(function(){
						$('#intellact_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	intellact_date++;
							//}
						});
						//if(intellact_date != 0){
						//	$('#intell_date_'+index+' input').val(date_value);
						//}else{
						//	$('#intell_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_other_'+index+' input').css('display', 'block');
						}else{
							$('#if_other_'+index+' input').css('display', 'none');
						}
						other = 0; intellact_date = 0;
					});
					var intell = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intell++;
						}
						if(intell > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
						}
					});
					var intell_chg = 0;
					$('#intellact_type_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intell_chg++;
							}
							if(intell_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
							}
						});
						intell_chg = 0;
					});
					//IP Type dependent -- END
					//IP Country dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountry).attr('id', 'country_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountryOther).attr('id', 'cnt_other_' + index);					
					var intcnt_type = $('#country_'+index+' select').val();
					if(intcnt_type == 'Other'){
						$('#cnt_other_'+index+' input').css('display', 'block');
					}else{
						$('#cnt_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					$('#country_'+index).change(function(){
						$('#country_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
						});
						if(other > '0'){
							$('#cnt_other_'+index+' input').css('display', 'block');
						}else{
							$('#cnt_other_'+index+' input').css('display', 'none');
						}
						other = 0;
					});
					var intcnt = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intcnt++;
						}
						if(intcnt > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
						}
					});
					var intcnt_chg = 0;
					$('#country_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intcnt_chg++;
							}
							if(intcnt_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
							}
						});
						intcnt_chg = 0;
					});
					//IP Country dependent -- END
				});
			}
			//IGS-1225 -- END
			function removeReadonly(){
				$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
					var currentElement = $(this);
					currentElement.closest("div").find("input").prop('disabled', false);
					currentElement.closest("div").find("select").prop('disabled', false);
				});
				var form_id = '5';
				if(form_id != 32){
					$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
					});
				}
			}
			$('.add_list_item').click(function(){
			    setReadonly();
			});			
			$('#gform_submit_button_'+form_id+'').click(function(){
				removeReadonly();
			});
			var form_id = '5';
			$("body").prepend('<div id="overlay" class="ui-widget-overlay" style="z-index: 1001; display: none;"></div>');
			$("body").prepend("<div id='PleaseWait' style='display: none;position: fixed;top: 0px;z-index: 30001;left: 50%;top: 50%;'><img src='https://boundlessaccelerator.ca/wp-content/themes/Divi-Child/images/loading.gif'/></div>");
			$('#gform_submit_button_'+form_id+'').click(function(){
				$("#overlay, #PleaseWait").show();
				setTimeout(function () {
                    $("#overlay, #PleaseWait").hide();
                }, 5000);
			});
		});
	</script>
	
<url>
<loc>https://ba.pfcd.ca/rhyze-up-accelerator-form/</loc>
<lastmod>2023-11-02T02:23:29-04:00</lastmod></url>	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript">
		jQuery(document).ready(function($){
		    //IGS-1188 -- START
			var desc_rev = '';
			var desc_emp = '';
			var desc_inv = '_6_99';
			var desc_int = '_6_106';
			var tract_id = '';
			var form_id = '6';
			var trac_id = $('#input'+tract_id).val();
			var cp_ids = '_6_245';
			var cp_id = $('#input'+cp_ids).val();
			
			if(form_id == '11' || form_id == '25' || form_id == '26' || form_id == '27' || form_id == '28' || form_id == '33' || form_id == '34' || form_id == '35' || form_id == '36' || form_id == '42' || form_id == '45'){
				var sec_rev = document.getElementById("gfield_description"+desc_rev).innerHTML;
				var sec_rev = sec_rev.replace("tractid", trac_id);
				var sec_rev = sec_rev.replace("cps_id", cp_id);
				document.getElementById("gfield_description"+desc_rev).innerHTML = sec_rev;
				
				var sec_emp = document.getElementById("gfield_description"+desc_emp).innerHTML;
				var sec_emp = sec_emp.replace("tractid", trac_id);
				document.getElementById("gfield_description"+desc_emp).innerHTML = sec_emp;
				
				var sec_inv = document.getElementById("gfield_description"+desc_inv).innerHTML;
    			var sec_inv = sec_inv.replace("tractid", trac_id);
    			var sec_inv = sec_inv.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_inv).innerHTML = sec_inv;
    			
    			var sec_int = document.getElementById("gfield_description"+desc_int).innerHTML;
    			var sec_int = sec_int.replace("tractid", trac_id);
    			var sec_int = sec_int.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_int).innerHTML = sec_int;
			}
			//IGS-1188 -- END
				
			var ip_id = '_6_159';
			var inv_id = '_6_158';
			var invmt_id = '158';
			var intel_id = '159';
			var form_id = '6';
			var page_id = '';
			var rev_id = '';
			var emp_id = '';
			setReadonly();
			function formatDate(date) {
				var d = new Date(date),
					month = '' + (d.getMonth() + 1),
					day = '' + d.getDate(),
					year = d.getFullYear();
				if (month.length < 2) month = '0' + month;
				if (day.length < 2) day = '0' + day;
				return [year, month, day].join('-');
			}
			function setReadonly(){
			    if(form_id == 1 || form_id == 5 || form_id == 6 || form_id == 7 || form_id == 8 || form_id == 10 || form_id == 32 || form_id == 40  || form_id == 44){
					$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						var id = currentElement.closest("div").find("input").val();
						if(id !=''){
						currentElement.closest("div").find("input").prop('disabled', true);
						currentElement.closest("div").find("select").prop('disabled', true);
						}else{
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
						}
						$(currentElement.closest("div").find("input")).each(function(key, val) {
							if(key == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
								//$(this).attr('style','display:none;');
								$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
								if($check_inv_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
								}
								var date_today = new Date();
								var previousMonth = date_today.getMonth() - 1;
								var today = new Date(date_today.getFullYear(), previousMonth, 1);
								var yyyy = today.getFullYear();
								var mm = today.getMonth() + 1; // Months start at 0!
								var dd = today.getDate();
				
								if (dd < 10) dd = '0' + dd;
								if (mm < 10) mm = '0' + mm;
				
								var formattedToday = mm + '/' + dd + '/' + yyyy;
								var value = formatDate(formattedToday);
								//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
							}
						});
					});
					if(form_id != 32){
						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
									//$(this).attr('style','display:none;');
									$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
									if($check_ip_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
									}
									var date_today = new Date();
									var previousMonth = date_today.getMonth() - 1;
									var today = new Date(date_today.getFullYear(), previousMonth, 1);
									var yyyy = today.getFullYear();
									var mm = today.getMonth() + 1; // Months start at 0!
									var dd = today.getDate();

									if (dd < 10) dd = '0' + dd;
									if (mm < 10) mm = '0' + mm;

									var formattedToday = mm + '/' + dd + '/' + yyyy;
									var value = formatDate(formattedToday);
									//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}else{
					if(form_id != 36){
						$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key, val) {
								if(key == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
										if($check_inv_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});

						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
										if($check_ip_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}
			}
					
			//IGS-1225 -- START
			var date_today = new Date();
			var previousMonth = date_today.getMonth() - 1;
			var today = new Date(date_today.getFullYear(), previousMonth, 1);
			var yyyy = today.getFullYear();
			var mm = today.getMonth() + 1; // Months start at 0!
			var dd = today.getDate();
			if (dd < 10) dd = '0' + dd;
			if (mm < 10) mm = '0' + mm;
			var formattedToday = mm + '/' + dd + '/' + yyyy;
			var date_value = formatDate(formattedToday);
			function investmentListFunc(){
				$('#field'+inv_id+' .gfield_list_group').each(function(index) {
				    if(form_id == 36){
						var cellTypeIndex = 2;
						var celldateIndex = 0;
						var cellOtherIndex = 5;
					}else{
						var cellTypeIndex = 3;
						var celldateIndex = 2;
						var cellOtherIndex = 6;
					}
					$(this).closest("div").attr('id', 'inv'+index);
					var investmentTypeSelect = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellTypeIndex);
					var investmentTypedate = $(this).find('.gfield_list_'+invmt_id+'_cell'+celldateIndex);
					var ifOtherInput = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex);
					investmentTypeSelect.attr('id', 'investment_type_' + index);
					investmentTypedate.attr('id', 'investment_date_' + index);
					ifOtherInput.attr('id', 'if_invother_' + index);		
					var other = 0;
					var inves_date = 0;
					var invest_type = $('#investment_type_'+index+' select').val();
				
					if(invest_type == 'Other'){
						$('#if_invother_'+index+' input').css('display', 'block');
					}else{
						$('#if_invother_'+index+' input').css('display', 'none');
					}
					$('#investment_type_'+index).change(function(){
						$('#investment_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	inves_date++;
							//}
						});
						//if(inves_date != 0){
						//	$('#investment_date_'+index+' input').val(date_value);
						//}else{
						//	$('#investment_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_invother_'+index+' input').css('display', 'block');
						}else{
							$('#if_invother_'+index+' input').css('display', 'none');
						}
						other = 0;
						inves_date = 0;
					});
					var inves = 0;

					$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							inves++;
						}
						if(inves > 0){
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
						}
					});
					var inves_chg = 0;
					$('#investment_type_'+index+' select').change(function(){
						$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								inves_chg++;
							}
							if(inves_chg > 0){
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
							}
						});
						inves_chg = 0;
					});
				});
			}
			if(form_id != 18){
				investmentListFunc();
				$('body').on('click', "#field"+inv_id+" .add_list_item", function() {
					investmentListFunc();
				});
			}
			intellactListFunc();
			$('body').on('click', "#field"+ip_id+" .add_list_item", function() {
			    intellactListFunc();
			});
			function intellactListFunc(){
				$('#field'+ip_id+' .gfield_list_group').each(function(index) {
					if(form_id == 36){
						var cellIpTypeIndex = 4;
						var cellIpdateIndex = 0;
						var cellIPOtherIndex = 5;
						var cellCountry = 2;
						var cellCountryOther = 3;
					}else{
						var cellIpTypeIndex = 5;
						var cellIpdateIndex = 2;
						var cellIPOtherIndex = 6;
						var cellCountry = 3;
						var cellCountryOther = 4;
					}
				    $(this).closest("div").attr('id', 'inv'+index);
					//IP Type dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).attr('id', 'intellact_type_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).attr('id', 'if_other_' + index);
					var intellTypedate = $(this).find('.gfield_list_'+intel_id+'_cell'+cellIpdateIndex);
					intellTypedate.attr('id', 'intell_date_' + index);
					
					var intel_type = $('#intellact_type_'+index+' select').val();
					if(intel_type == 'Other'){
						$('#if_other_'+index+' input').css('display', 'block');
					}else{
						$('#if_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					var intellact_date = 0;
					$('#intellact_type_'+index).change(function(){
						$('#intellact_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	intellact_date++;
							//}
						});
						//if(intellact_date != 0){
						//	$('#intell_date_'+index+' input').val(date_value);
						//}else{
						//	$('#intell_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_other_'+index+' input').css('display', 'block');
						}else{
							$('#if_other_'+index+' input').css('display', 'none');
						}
						other = 0; intellact_date = 0;
					});
					var intell = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intell++;
						}
						if(intell > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
						}
					});
					var intell_chg = 0;
					$('#intellact_type_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intell_chg++;
							}
							if(intell_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
							}
						});
						intell_chg = 0;
					});
					//IP Type dependent -- END
					//IP Country dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountry).attr('id', 'country_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountryOther).attr('id', 'cnt_other_' + index);					
					var intcnt_type = $('#country_'+index+' select').val();
					if(intcnt_type == 'Other'){
						$('#cnt_other_'+index+' input').css('display', 'block');
					}else{
						$('#cnt_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					$('#country_'+index).change(function(){
						$('#country_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
						});
						if(other > '0'){
							$('#cnt_other_'+index+' input').css('display', 'block');
						}else{
							$('#cnt_other_'+index+' input').css('display', 'none');
						}
						other = 0;
					});
					var intcnt = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intcnt++;
						}
						if(intcnt > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
						}
					});
					var intcnt_chg = 0;
					$('#country_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intcnt_chg++;
							}
							if(intcnt_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
							}
						});
						intcnt_chg = 0;
					});
					//IP Country dependent -- END
				});
			}
			//IGS-1225 -- END
			function removeReadonly(){
				$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
					var currentElement = $(this);
					currentElement.closest("div").find("input").prop('disabled', false);
					currentElement.closest("div").find("select").prop('disabled', false);
				});
				var form_id = '6';
				if(form_id != 32){
					$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
					});
				}
			}
			$('.add_list_item').click(function(){
			    setReadonly();
			});			
			$('#gform_submit_button_'+form_id+'').click(function(){
				removeReadonly();
			});
			var form_id = '6';
			$("body").prepend('<div id="overlay" class="ui-widget-overlay" style="z-index: 1001; display: none;"></div>');
			$("body").prepend("<div id='PleaseWait' style='display: none;position: fixed;top: 0px;z-index: 30001;left: 50%;top: 50%;'><img src='https://boundlessaccelerator.ca/wp-content/themes/Divi-Child/images/loading.gif'/></div>");
			$('#gform_submit_button_'+form_id+'').click(function(){
				$("#overlay, #PleaseWait").show();
				setTimeout(function () {
                    $("#overlay, #PleaseWait").hide();
                }, 5000);
			});
		});
	</script>
	
<url>
<loc>https://ba.pfcd.ca/rhyze-ventures-form/</loc>
<lastmod>2023-11-02T02:22:05-04:00</lastmod></url>	<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
	<script type="text/javascript">
		jQuery(document).ready(function($){
		    //IGS-1188 -- START
			var desc_rev = '';
			var desc_emp = '';
			var desc_inv = '_7_99';
			var desc_int = '_7_106';
			var tract_id = '';
			var form_id = '7';
			var trac_id = $('#input'+tract_id).val();
			var cp_ids = '_7_251';
			var cp_id = $('#input'+cp_ids).val();
			
			if(form_id == '11' || form_id == '25' || form_id == '26' || form_id == '27' || form_id == '28' || form_id == '33' || form_id == '34' || form_id == '35' || form_id == '36' || form_id == '42' || form_id == '45'){
				var sec_rev = document.getElementById("gfield_description"+desc_rev).innerHTML;
				var sec_rev = sec_rev.replace("tractid", trac_id);
				var sec_rev = sec_rev.replace("cps_id", cp_id);
				document.getElementById("gfield_description"+desc_rev).innerHTML = sec_rev;
				
				var sec_emp = document.getElementById("gfield_description"+desc_emp).innerHTML;
				var sec_emp = sec_emp.replace("tractid", trac_id);
				document.getElementById("gfield_description"+desc_emp).innerHTML = sec_emp;
				
				var sec_inv = document.getElementById("gfield_description"+desc_inv).innerHTML;
    			var sec_inv = sec_inv.replace("tractid", trac_id);
    			var sec_inv = sec_inv.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_inv).innerHTML = sec_inv;
    			
    			var sec_int = document.getElementById("gfield_description"+desc_int).innerHTML;
    			var sec_int = sec_int.replace("tractid", trac_id);
    			var sec_int = sec_int.replace("cps_id", cp_id);
    			document.getElementById("gfield_description"+desc_int).innerHTML = sec_int;
			}
			//IGS-1188 -- END
				
			var ip_id = '_7_159';
			var inv_id = '_7_158';
			var invmt_id = '158';
			var intel_id = '159';
			var form_id = '7';
			var page_id = '';
			var rev_id = '';
			var emp_id = '';
			setReadonly();
			function formatDate(date) {
				var d = new Date(date),
					month = '' + (d.getMonth() + 1),
					day = '' + d.getDate(),
					year = d.getFullYear();
				if (month.length < 2) month = '0' + month;
				if (day.length < 2) day = '0' + day;
				return [year, month, day].join('-');
			}
			function setReadonly(){
			    if(form_id == 1 || form_id == 5 || form_id == 6 || form_id == 7 || form_id == 8 || form_id == 10 || form_id == 32 || form_id == 40  || form_id == 44){
					$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						var id = currentElement.closest("div").find("input").val();
						if(id !=''){
						currentElement.closest("div").find("input").prop('disabled', true);
						currentElement.closest("div").find("select").prop('disabled', true);
						}else{
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
						}
						$(currentElement.closest("div").find("input")).each(function(key, val) {
							if(key == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
								//$(this).attr('style','display:none;');
								$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
								if($check_inv_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
								}
								var date_today = new Date();
								var previousMonth = date_today.getMonth() - 1;
								var today = new Date(date_today.getFullYear(), previousMonth, 1);
								var yyyy = today.getFullYear();
								var mm = today.getMonth() + 1; // Months start at 0!
								var dd = today.getDate();
				
								if (dd < 10) dd = '0' + dd;
								if (mm < 10) mm = '0' + mm;
				
								var formattedToday = mm + '/' + dd + '/' + yyyy;
								var value = formatDate(formattedToday);
								//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
							}
						});
					});
					if(form_id != 32){
						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
								var value = formatDate($(this).val());
								$(this).attr('type', 'date');
								$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
								$(this).attr('style','display:block;');
								//$(this).val(value);
								if(id == ''){
									//$(this).attr('style','display:none;');
									$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
									if($check_ip_id == ''){
									//$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
									}
									var date_today = new Date();
									var previousMonth = date_today.getMonth() - 1;
									var today = new Date(date_today.getFullYear(), previousMonth, 1);
									var yyyy = today.getFullYear();
									var mm = today.getMonth() + 1; // Months start at 0!
									var dd = today.getDate();

									if (dd < 10) dd = '0' + dd;
									if (mm < 10) mm = '0' + mm;

									var formattedToday = mm + '/' + dd + '/' + yyyy;
									var value = formatDate(formattedToday);
									//$(this).val(value);
								}
								//currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}else{
					if(form_id != 36){
						$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key, val) {
								if(key == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_inv_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="inv_id"]').find('input').val();
										if($check_inv_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});

						$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
							var currentElement = $(this);
							var id = currentElement.closest("div").find("input").val();
							if(id !=''){
								currentElement.closest("div").find("input").prop('disabled', true);
								currentElement.closest("div").find("select").prop('disabled', true);
							}else{
								currentElement.closest("div").find("input").prop('disabled', false);
								currentElement.closest("div").find("select").prop('disabled', false);
							}
							$(currentElement.closest("div").find("input")).each(function(key1, val1) {
								if(key1 == 1){
									var value = formatDate($(this).val());
									$(this).attr('type', 'date');
									$(this).attr('style','border: 1px solid #bbb;color: #4e4e4e;background-color: #fff;');
									$(this).attr('style','display:block;');
									$(this).val(value);
									if(id == ''){
										$(this).attr('style','display:none;');
										$check_ip_id = $('.gfield_list_container').children('div.gfield_list_groups').children('div').children('div[data-label="ip_id"]').find('input').val();
										if($check_ip_id == ''){
											$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("Date")').attr('style','visibility:hidden;');
										}
										var date_today = new Date();
										var previousMonth = date_today.getMonth() - 1;
										var today = new Date(date_today.getFullYear(), previousMonth, 1);
										var yyyy = today.getFullYear();
										var mm = today.getMonth() + 1; // Months start at 0!
										var dd = today.getDate();

										if (dd < 10) dd = '0' + dd;
										if (mm < 10) mm = '0' + mm;

										var formattedToday = mm + '/' + dd + '/' + yyyy;
										var value = formatDate(formattedToday);
										// $(this).val(value);
									}
									currentElement.closest("div").find("input[type=\"date\"]").prop('readOnly', true);
								}
							});
						});
					}
				}
			}
					
			//IGS-1225 -- START
			var date_today = new Date();
			var previousMonth = date_today.getMonth() - 1;
			var today = new Date(date_today.getFullYear(), previousMonth, 1);
			var yyyy = today.getFullYear();
			var mm = today.getMonth() + 1; // Months start at 0!
			var dd = today.getDate();
			if (dd < 10) dd = '0' + dd;
			if (mm < 10) mm = '0' + mm;
			var formattedToday = mm + '/' + dd + '/' + yyyy;
			var date_value = formatDate(formattedToday);
			function investmentListFunc(){
				$('#field'+inv_id+' .gfield_list_group').each(function(index) {
				    if(form_id == 36){
						var cellTypeIndex = 2;
						var celldateIndex = 0;
						var cellOtherIndex = 5;
					}else{
						var cellTypeIndex = 3;
						var celldateIndex = 2;
						var cellOtherIndex = 6;
					}
					$(this).closest("div").attr('id', 'inv'+index);
					var investmentTypeSelect = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellTypeIndex);
					var investmentTypedate = $(this).find('.gfield_list_'+invmt_id+'_cell'+celldateIndex);
					var ifOtherInput = $(this).find('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex);
					investmentTypeSelect.attr('id', 'investment_type_' + index);
					investmentTypedate.attr('id', 'investment_date_' + index);
					ifOtherInput.attr('id', 'if_invother_' + index);		
					var other = 0;
					var inves_date = 0;
					var invest_type = $('#investment_type_'+index+' select').val();
				
					if(invest_type == 'Other'){
						$('#if_invother_'+index+' input').css('display', 'block');
					}else{
						$('#if_invother_'+index+' input').css('display', 'none');
					}
					$('#investment_type_'+index).change(function(){
						$('#investment_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	inves_date++;
							//}
						});
						//if(inves_date != 0){
						//	$('#investment_date_'+index+' input').val(date_value);
						//}else{
						//	$('#investment_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_invother_'+index+' input').css('display', 'block');
						}else{
							$('#if_invother_'+index+' input').css('display', 'none');
						}
						other = 0;
						inves_date = 0;
					});
					var inves = 0;

					$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							inves++;
						}
						if(inves > 0){
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
						}
					});
					var inves_chg = 0;
					$('#investment_type_'+index+' select').change(function(){
						$('.gfield_list_'+invmt_id+'_cell'+ cellTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								inves_chg++;
							}
							if(inves_chg > 0){
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+invmt_id+'_cell'+cellOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other")').attr('style','display:none;');
							}
						});
						inves_chg = 0;
					});
				});
			}
			if(form_id != 18){
				investmentListFunc();
				$('body').on('click', "#field"+inv_id+" .add_list_item", function() {
					investmentListFunc();
				});
			}
			intellactListFunc();
			$('body').on('click', "#field"+ip_id+" .add_list_item", function() {
			    intellactListFunc();
			});
			function intellactListFunc(){
				$('#field'+ip_id+' .gfield_list_group').each(function(index) {
					if(form_id == 36){
						var cellIpTypeIndex = 4;
						var cellIpdateIndex = 0;
						var cellIPOtherIndex = 5;
						var cellCountry = 2;
						var cellCountryOther = 3;
					}else{
						var cellIpTypeIndex = 5;
						var cellIpdateIndex = 2;
						var cellIPOtherIndex = 6;
						var cellCountry = 3;
						var cellCountryOther = 4;
					}
				    $(this).closest("div").attr('id', 'inv'+index);
					//IP Type dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).attr('id', 'intellact_type_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).attr('id', 'if_other_' + index);
					var intellTypedate = $(this).find('.gfield_list_'+intel_id+'_cell'+cellIpdateIndex);
					intellTypedate.attr('id', 'intell_date_' + index);
					
					var intel_type = $('#intellact_type_'+index+' select').val();
					if(intel_type == 'Other'){
						$('#if_other_'+index+' input').css('display', 'block');
					}else{
						$('#if_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					var intellact_date = 0;
					$('#intellact_type_'+index).change(function(){
						$('#intellact_type_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
							//if(selectedValue != ''){
							//	intellact_date++;
							//}
						});
						//if(intellact_date != 0){
						//	$('#intell_date_'+index+' input').val(date_value);
						//}else{
						//	$('#intell_date_'+index+' input').val('');
						//}
						if(other > '0'){
							$('#if_other_'+index+' input').css('display', 'block');
						}else{
							$('#if_other_'+index+' input').css('display', 'none');
						}
						other = 0; intellact_date = 0;
					});
					var intell = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intell++;
						}
						if(intell > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
						}
					});
					var intell_chg = 0;
					$('#intellact_type_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellIpTypeIndex).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intell_chg++;
							}
							if(intell_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellIPOtherIndex).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other (IP Type)")').attr('style','display:none;');
							}
						});
						intell_chg = 0;
					});
					//IP Type dependent -- END
					//IP Country dependent -- START
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountry).attr('id', 'country_' + index);
					$(this).find('.gfield_list_'+intel_id+'_cell'+cellCountryOther).attr('id', 'cnt_other_' + index);					
					var intcnt_type = $('#country_'+index+' select').val();
					if(intcnt_type == 'Other'){
						$('#cnt_other_'+index+' input').css('display', 'block');
					}else{
						$('#cnt_other_'+index+' input').css('display', 'none');
					}
					var other = 0;
					$('#country_'+index).change(function(){
						$('#country_'+index+' select').each(function(index) {
							var selectedValue = $(this).val();
							if(selectedValue == 'Other'){
								other++;
							}
						});
						if(other > '0'){
							$('#cnt_other_'+index+' input').css('display', 'block');
						}else{
							$('#cnt_other_'+index+' input').css('display', 'none');
						}
						other = 0;
					});
					var intcnt = 0;
					$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
						var inves_val = $(this).find("select").val();
						if(inves_val == 'Other'){
							intcnt++;
						}
						if(intcnt > 0){
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
						}else{
							$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
							$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
						}
					});
					var intcnt_chg = 0;
					$('#country_'+index+' select').change(function(){
						$('.gfield_list_'+intel_id+'_cell'+cellCountry).each(function(index) {
							var inves_vals = $(this).find("select").val();
							if(inves_vals == 'Other'){
								intcnt_chg++;
							}
							if(intcnt_chg > 0){
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'block');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:block;');
							}else{
								$('.gfield_list_'+intel_id+'_cell'+cellCountryOther).css('display', 'none');
								$(this).closest('.gfield_list_container').find('.gfield_list_header').children('div:contains("If Other(Country)")').attr('style','display:none;');
							}
						});
						intcnt_chg = 0;
					});
					//IP Country dependent -- END
				});
			}
			//IGS-1225 -- END
			function removeReadonly(){
				$('#field'+ip_id+' .gfield_list_groups .gfield_list_group').each(function() {
					var currentElement = $(this);
					currentElement.closest("div").find("input").prop('disabled', false);
					currentElement.closest("div").find("select").prop('disabled', false);
				});
				var form_id = '7';
				if(form_id != 32){
					$('#field'+inv_id+' .gfield_list_groups .gfield_list_group').each(function() {
						var currentElement = $(this);
						currentElement.closest("div").find("input").prop('disabled', false);
						currentElement.closest("div").find("select").prop('disabled', false);
					});
				}
			}
			$('.add_list_item').click(function(){
			    setReadonly();
			});			
			$('#gform_submit_button_'+form_id+'').click(function(){
				removeReadonly();
			});
			var form_id = '7';
			$("body").prepend('<div id="overlay" class="ui-widget-overlay" style="z-index: 1001; display: none;"></div>');
			$("body").prepend("<div id='PleaseWait' style='display: none;position: fixed;top: 0px;z-index: 30001;left: 50%;top: 50%;'><img src='https://boundlessaccelerator.ca/wp-content/themes/Divi-Child/images/loading.gif'/></div>");
			$('#gform_submit_button_'+form_id+'').click(function(){
				$("#overlay, #PleaseWait").show();
				setTimeout(function () {
                    $("#overlay, #PleaseWait").hide();
                }, 5000);
			});
		});
	</script>
	
<url>
<loc>https://ba.pfcd.ca/cfe-ihub-form/</loc>
<lastmod>2023-11-02T02:16:50-04:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/rhyze-ventures-form/thank-you/</loc>
<lastmod>2023-11-01T06:15:33-04:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/coil-application-form/thank-you/</loc>
<lastmod>2023-11-01T06:05:32-04:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/programs/venture-capital-ready/</loc>
<lastmod>2023-10-31T18:25:58-04:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/news/</loc>
<lastmod>2023-10-31T16:07:58-04:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/test-test-save-continue/</loc>
<lastmod>2023-10-28T02:45:22-04:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/programs/idea-fund/cohort-2-recipients/</loc>
<lastmod>2023-10-25T10:09:57-04:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/programs/idea-fund/cohort-1-recipients/</loc>
<lastmod>2023-10-24T16:29:13-04:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/programs/</loc>
<lastmod>2023-10-23T15:43:07-04:00</lastmod></url>
<url>
<loc>https://ba.pfcd.ca/privacy-policy/</loc>
<lastmod>2023-10-23T15:18:03-04:00</lastmod></url></urlset>
