//-----------------------------Div 1----------------------------------------
function fnDoSubmit1(){
	var valid = true;
	var message = '';
	if (document.form.qap_slt0_546592.value == ''){
		if (document.form.qap_slt0_546592.disabled == false && document.form.qap_slt0_546592.type != 'hidden'){
			document.form.qap_slt0_546592.focus();
		}
		$('.surveylabels1a').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels1a').toggleClass('mandatory',false);
	}
	if (document.form.qap_slt0_546593.value == ''){
		if (document.form.qap_slt0_546593.disabled == false && document.form.qap_slt0_546593.type != 'hidden'){
			document.form.qap_slt0_546593.focus();
		}
		$('.surveylabels1b').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels1b').toggleClass('mandatory',false);
	}
	if (document.form.qap_slt1_546594.value.length<1){
		if (document.form.qap_slt1_546594.disabled == false && document.form.qap_slt1_546594.type != 'hidden'){
			document.form.qap_slt1_546594.focus();
		}
		$('.surveylabels1c').toggleClass('mandatory',true);
		$('#emailwarningmessages').html('');
		valid = false;
	} else {
		if (IsEmail(document.form.qap_slt1_546594.value)==false){
			$('#emailwarningmessages').html('Please enter a valid email address.');
			document.form.qap_slt1_546594.focus();
			$('.surveylabels1c').toggleClass('mandatory',true);
			valid = false;
		} else {
			if(document.form.qap_slt1_546594.value!=document.form.retype_email.value){
				$('#emailwarningmessages').html('Your email addresses do not match.');
				document.form.qap_slt1_546594.focus();
				$('.surveylabels1c').toggleClass('mandatory',true);
				$('.surveylabels1re').toggleClass('mandatory',true);
				valid = false;
			}else{
				$('#emailwarningmessages').html('');
				$('.surveylabels1c').toggleClass('mandatory',false);
				$('.surveylabels1re').toggleClass('mandatory',false);
			}
		}
	}
	if (document.form.qap_slt0_577168.value.length==0){
		if (document.form.qap_slt0_577168.disabled == false && document.form.qap_slt0_577168.type != 'hidden'){
			document.form.qap_slt0_577168.focus();
		}
		$('.surveylabels1d').toggleClass('mandatory',true);
		valid = false;
	} else {
		if(document.form.qap_slt0_577168.value.length<4){
			$('#passwarningmessages').html('Please enter a password of minimum length 4 characters.');
			document.form.qap_slt0_577168.focus();
			$('.surveylabels1d').toggleClass('mandatory',true);
			valid = false;
		} else {
			if(document.form.qap_slt0_577168.value!=document.form.retype.value){
				$('#passwarningmessages').html('Passwords do not match.');
				document.form.qap_slt0_577168.focus();
				$('.surveylabels1d').toggleClass('mandatory',true);
				$('.surveylabels1x').toggleClass('mandatory',true);
				valid = false;
			}else{
				$('#passwarningmessages').html('');
				$('.surveylabels1d').toggleClass('mandatory',false);
				$('.surveylabels1x').toggleClass('mandatory',false);
			}
		}
	}
	if (document.form.qap_dd_546802.options[0].selected == true){
		if (document.form.qap_dd_546802.disabled == false && document.form.qap_dd_546802.type != 'hidden'){
			document.form.qap_dd_546802.focus();
		}
		$('.surveylabels1e').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels1e').toggleClass('mandatory',false);
	}
	if (document.form.qap_dd_546805.options[0].selected == true){
		if (document.form.qap_dd_546805.disabled == false && document.form.qap_dd_546805.type != 'hidden'){
			document.form.qap_dd_546805.focus();
		}
		$('.surveylabels1f').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels1f').toggleClass('mandatory',false);
	}
	if (document.form.qap_dd_546822.options[0].selected == true){
		if (document.form.qap_dd_546822.disabled == false && document.form.qap_dd_546822.type != 'hidden'){
			document.form.qap_dd_546822.focus();
		}
		$('.surveylabels1g').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels1g').toggleClass('mandatory',false);
	}
	if (document.form.qap_dd_546823.options[0].selected == true){
		if (document.form.qap_dd_546823.disabled == false && document.form.qap_dd_546823.type != 'hidden'){
			document.form.qap_dd_546823.focus();
		}
		$('.surveylabels1h').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels1h').toggleClass('mandatory',false);
	}
	if (document.form.qap_dd_547359.options[0].selected == true){
		if (document.form.qap_dd_547359.disabled == false && document.form.qap_dd_547359.type != 'hidden'){
			document.form.qap_dd_547359.focus();
		}
		$('.surveylabels1i').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels1i').toggleClass('mandatory',false);
	}
	
	if(!valid){
		$('.notification').toggleClass('mandatory',true);
	}else{
		$('#dialog').jqmShow();
		$.postJSON("services/check_email.php",{ 'email' : document.form.qap_slt1_546594.value , 's' : document.form.s.value },
			function(data){
				if (data.status=='0'){
					if(document.form.qap_dd_546823.options[1].selected || document.form.qap_dd_546823.options[8].selected){
						$('.join_nsw').show();
					} else if(document.form.qap_dd_546823.options[2].selected){
						$('.join_vic').show();
					} else if(document.form.qap_dd_546823.options[3].selected){
						$('.join_qld').show();
					} else if(document.form.qap_dd_546823.options[4].selected){
						$('.join_sa').show();
						$('.join_wa').show();
					}
					$('.surveylabels1i').toggleClass('mandatory',false);
					$('.warningmessages').html('');
					$('.notification').toggleClass('mandatory',false);
					$('.surveylabels1').toggleClass('mandatory',false);
					$('#join_parentdiv').css({'height':'405px'});
					$('#join_parentdiv').cycle(2);
				}else if (data.status=='1'){
					$('#emailwarningmessages').html('This email is already registered.');
					$('.surveylabels1c').toggleClass('mandatory',true);
					$('.notification').toggleClass('mandatory',true);
				}else{
					valid = false;
					$('#join_parentdiv').html("<p>Ohh no! An error has occured, please try again later. Sorry for the inconvenience </p>")
				}
				$('#dialog').jqmHide();
			}
		);
	}
}
//-----------------------------Div 2----------------------------------------
function fnDoSubmit2(){
	var valid = true;
	var message = '';
	if (document.form.qap_dd_547363.options[0].selected == true){
		if (document.form.qap_dd_547363.disabled == false && document.form.qap_dd_547363.type != 'hidden'){
			document.form.qap_dd_547363.focus();
		}
		$('.surveylabels2a').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels2a').toggleClass('mandatory',false);
	}
	if (document.form.qap_dd_547364.options[0].selected == true){
		if (document.form.qap_dd_547364.disabled == false && document.form.qap_dd_547364.type != 'hidden'){
			document.form.qap_dd_547364.focus();
		}
		$('.surveylabels2b').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels2b').toggleClass('mandatory',false);
	}
	if (document.form.qap_dd_551835.options[0].selected == true){
		if (document.form.qap_dd_551835.disabled == false && document.form.qap_dd_551835.type != 'hidden'){
			document.form.qap_dd_551835.focus();
		}
		$('.surveylabels2c').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels2c').toggleClass('mandatory',false);
	}
	if (document.form.qap_dd_547366.options[0].selected == true){
		if (document.form.qap_dd_547366.disabled == false && document.form.qap_dd_547366.type != 'hidden'){
			document.form.qap_dd_547366.focus();
		}
		$('.surveylabels2d').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels2d').toggleClass('mandatory',false);
	}
	if (document.form.qap_dd_547367.options[0].selected == true){
		if (document.form.qap_dd_547367.disabled == false && document.form.qap_dd_547367.type != 'hidden'){
			document.form.qap_dd_547367.focus();
		}
		$('.surveylabels2e').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels2e').toggleClass('mandatory',false);
	}
	return [valid,message];
}
//-----------------------------Div 3----------------------------------------
function fnDoSubmit3(){
	var valid = true;
	var message = '';
	if (document.form.qap_dd_547370.options[0].selected == true){
		if (document.form.qap_dd_547370.disabled == false && document.form.qap_dd_547370.type != 'hidden'){
			document.form.qap_dd_547370.focus();
		}
		$('.surveylabels3a').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels3a').toggleClass('mandatory',false);
	}
	if (document.form.qap_r_566245[0].checked == false && document.form.qap_r_566245[1].checked == false && document.form.qap_r_566245[2].checked == false && document.form.qap_r_566245[3].checked == false && document.form.qap_r_566245[4].checked == false){
		if (document.form.qap_r_566245[0].disabled == false && document.form.qap_r_566245.type != 'hidden'){
			document.form.qap_r_566245[0].focus();
		}
		$('.surveylabels3b').toggleClass('mandatory',true);
		$('.surveylabels3b1').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels3b1').toggleClass('mandatory',false);
	}
	if (document.form.qap_r_566247[0].checked == false && document.form.qap_r_566247[1].checked == false && document.form.qap_r_566247[2].checked == false && document.form.qap_r_566247[3].checked == false && document.form.qap_r_566247[4].checked == false){
		if (document.form.qap_r_566247[0].disabled == false && document.form.qap_r_566247.type != 'hidden'){
			document.form.qap_r_566247[0].focus();
		}
		$('.surveylabels3b').toggleClass('mandatory',true);
		$('.surveylabels3b2').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels3b2').toggleClass('mandatory',false);
	}
	if (document.form.qap_r_566249[0].checked == false && document.form.qap_r_566249[1].checked == false && document.form.qap_r_566249[2].checked == false && document.form.qap_r_566249[3].checked == false && document.form.qap_r_566249[4].checked == false){
		if (document.form.qap_r_566249[0].disabled == false && document.form.qap_r_566249.type != 'hidden'){
			document.form.qap_r_566249[0].focus();
		}
		$('.surveylabels3b').toggleClass('mandatory',true);
		$('.surveylabels3b3').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels3b3').toggleClass('mandatory',false);
	}
	if (document.form.qap_r_566250[0].checked == false && document.form.qap_r_566250[1].checked == false && document.form.qap_r_566250[2].checked == false && document.form.qap_r_566250[3].checked == false && document.form.qap_r_566250[4].checked == false){
		if (document.form.qap_r_566250[0].disabled == false && document.form.qap_r_566250.type != 'hidden'){
			document.form.qap_r_566250[0].focus();
		}
		$('.surveylabels3b').toggleClass('mandatory',true);
		$('.surveylabels3b4').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels3b4').toggleClass('mandatory',false);
	}
	if (document.form.qap_r_566251[0].checked == false && document.form.qap_r_566251[1].checked == false && document.form.qap_r_566251[2].checked == false && document.form.qap_r_566251[3].checked == false && document.form.qap_r_566251[4].checked == false){
		if (document.form.qap_r_566251[0].disabled == false && document.form.qap_r_566251.type != 'hidden'){
			document.form.qap_r_566251[0].focus();
		}
		$('.surveylabels3b').toggleClass('mandatory',true);
		$('.surveylabels3b5').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels3b5').toggleClass('mandatory',false);
	}
	if (document.form.qap_r_566252[0].checked == false && document.form.qap_r_566252[1].checked == false && document.form.qap_r_566252[2].checked == false && document.form.qap_r_566252[3].checked == false && document.form.qap_r_566252[4].checked == false){
		if (document.form.qap_r_566252[0].disabled == false && document.form.qap_r_566252.type != 'hidden'){
			document.form.qap_r_566252[0].focus();
		}
		$('.surveylabels3b').toggleClass('mandatory',true);
		$('.surveylabels3b6').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels3b6').toggleClass('mandatory',false);
	}
	if (document.form.qap_r_566253[0].checked == false && document.form.qap_r_566253[1].checked == false && document.form.qap_r_566253[2].checked == false && document.form.qap_r_566253[3].checked == false && document.form.qap_r_566253[4].checked == false){
		if (document.form.qap_r_566253[0].disabled == false && document.form.qap_r_566253.type != 'hidden'){
			document.form.qap_r_566253[0].focus();
		}
		$('.surveylabels3b').toggleClass('mandatory',true);
		$('.surveylabels3b7').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels3b7').toggleClass('mandatory',false);
	}
	return [valid,message];
}
//-----------------------------Div 4----------------------------------------
function fnDoSubmit4(){
	var valid = true;
	var message = '';
	if (document.form.qap_dd_547377.options[0].selected == true){
		if (document.form.qap_dd_547377.disabled == false && document.form.qap_dd_547377.type != 'hidden'){
			document.form.qap_dd_547377.focus();
		}
		$('.surveylabels4a').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels4a').toggleClass('mandatory',false);
	}
	if (document.form.qap_dd_547378.options[0].selected == true){
		if (document.form.qap_dd_547378.disabled == false && document.form.qap_dd_547378.type != 'hidden'){
			document.form.qap_dd_547378.focus();
		}
		$('.surveylabels4b').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels4b').toggleClass('mandatory',false);
	}
	if (document.form.qap_dd_547379.options[0].selected == true){
		if (document.form.qap_dd_547379.disabled == false && document.form.qap_dd_547379.type != 'hidden'){
			document.form.qap_dd_547379.focus();
		}
		$('.surveylabels4c').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels4c').toggleClass('mandatory',false);
	}
	if (document.form.qap_r_566255[0].checked == false && document.form.qap_r_566255[1].checked == false && document.form.qap_r_566255[2].checked == false){
		if (document.form.qap_r_566255[0].disabled == false && document.form.qap_r_566255.type != 'hidden'){
			document.form.qap_r_566255[0].focus();
		}
		$('.surveylabels4d').toggleClass('mandatory',true);
		$('.surveylabels4d1').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels4d1').toggleClass('mandatory',false);
	}
	if (document.form.qap_r_566258[0].checked == false && document.form.qap_r_566258[1].checked == false && document.form.qap_r_566258[2].checked == false){
		if (document.form.qap_r_566258[0].disabled == false && document.form.qap_r_566258.type != 'hidden'){
			document.form.qap_r_566258[0].focus();
		}
		$('.surveylabels4d').toggleClass('mandatory',true);
		$('.surveylabels4d2').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels4d2').toggleClass('mandatory',false);
	}
	if (document.form.qap_r_566259[0].checked == false && document.form.qap_r_566259[1].checked == false && document.form.qap_r_566259[2].checked == false){
		if (document.form.qap_r_566259[0].disabled == false && document.form.qap_r_566259.type != 'hidden'){
			document.form.qap_r_566259[0].focus();
		}
		$('.surveylabels4d').toggleClass('mandatory',true);
		$('.surveylabels4d3').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels4d3').toggleClass('mandatory',false);
	}
	if (document.form.qap_r_566260[0].checked == false && document.form.qap_r_566260[1].checked == false && document.form.qap_r_566260[2].checked == false){
		if (document.form.qap_r_566260[0].disabled == false && document.form.qap_r_566260.type != 'hidden'){
			document.form.qap_r_566260[0].focus();
		}
		$('.surveylabels4d').toggleClass('mandatory',true);
		$('.surveylabels4d4').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels4d4').toggleClass('mandatory',false);
	}
	if (document.form.qap_r_566261[0].checked == false && document.form.qap_r_566261[1].checked == false && document.form.qap_r_566261[2].checked == false){
		if (document.form.qap_r_566261[0].disabled == false && document.form.qap_r_566261.type != 'hidden'){
			document.form.qap_r_566261[0].focus();
		}
		$('.surveylabels4d').toggleClass('mandatory',true);
		$('.surveylabels4d5').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels4d5').toggleClass('mandatory',false);
	}
	return [valid,message];
}
//-----------------------------Div 5----------------------------------------
function fnDoSubmit5(){
	var valid = true;
	var message = '';
	var count_547399 = 0;
	if (document.form.qap_mc_547399_809808.checked == true){
		count_547399++;
	}
	if (document.form.qap_mc_547399_809814.checked == true){
		count_547399++;
	}
	if (document.form.qap_mc_547399_813224.checked == true){
		count_547399++;
	}
	if (document.form.qap_mc_547399_809810.checked == true){
		count_547399++;
	}
	if (document.form.qap_mc_547399_809817.checked == true){
		count_547399++;
	}
	if (document.form.qap_mc_547399_809813.checked == true){
		count_547399++;
	}
	if (document.form.qap_mc_547399_809811.checked == true){
		count_547399++;
	}
	if (document.form.qap_mc_547399_809816.checked == true){
		count_547399++;
	}
	if (document.form.qap_mc_547399_809815.checked == true){
		count_547399++;
	}
	if (document.form.qap_mc_547399_809812.checked == true){
		count_547399++;
	}
	if (document.form.qap_mc_547399_809809.checked == true){
		count_547399++;
	}
	if (document.form.qap_mc_547399_813222.checked == true){
		count_547399++;
	}
	if (count_547399 > 0 && count_547399 < 1){
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5b').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5b').toggleClass('mandatory',false);
	}
	if (document.form.qap_mc_547399_809808.checked == false && document.form.qap_mc_547399_809814.checked == false && document.form.qap_mc_547399_813224.checked == false && document.form.qap_mc_547399_809810.checked == false && document.form.qap_mc_547399_809817.checked == false && document.form.qap_mc_547399_809813.checked == false && document.form.qap_mc_547399_809811.checked == false && document.form.qap_mc_547399_809816.checked == false && document.form.qap_mc_547399_809815.checked == false && document.form.qap_mc_547399_809812.checked == false && document.form.qap_mc_547399_809809.checked == false && document.form.qap_mc_547399_813222.checked == false){
		if (document.form.qap_mc_547399_813222.disabled == false && document.form.qap_mc_547399_813222.type != 'hidden'){
			document.form.qap_mc_547399_813222.focus();
		}
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5b').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5b').toggleClass('mandatory',false);
	}
	var count_547400 = 0;
	if (document.form.qap_mc_547400_809822.checked == true){
		count_547400++;
	}
	if (document.form.qap_mc_547400_809823.checked == true){
		count_547400++;
	}
	if (document.form.qap_mc_547400_809819.checked == true){
		count_547400++;
	}
	if (document.form.qap_mc_547400_809824.checked == true){
		count_547400++;
	}
	if (document.form.qap_mc_547400_809825.checked == true){
		count_547400++;
	}
	if (document.form.qap_mc_547400_809820.checked == true){
		count_547400++;
	}
	if (document.form.qap_mc_547400_809826.checked == true){
		count_547400++;
	}
	if (document.form.qap_mc_547400_809821.checked == true){
		count_547400++;
	}
	if (document.form.qap_mc_547400_813223.checked == true){
		count_547400++;
	}
	if (count_547400 > 0 && count_547400 < 1){
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5c').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5c').toggleClass('mandatory',false);
	}
	if (document.form.qap_mc_547400_809822.checked == false && document.form.qap_mc_547400_809823.checked == false && document.form.qap_mc_547400_809819.checked == false && document.form.qap_mc_547400_809824.checked == false && document.form.qap_mc_547400_809825.checked == false && document.form.qap_mc_547400_809820.checked == false && document.form.qap_mc_547400_809826.checked == false && document.form.qap_mc_547400_809821.checked == false && document.form.qap_mc_547400_813223.checked == false){
		if (document.form.qap_mc_547400_813223.disabled == false && document.form.qap_mc_547400_813223.type != 'hidden'){
			document.form.qap_mc_547400_813223.focus();
		}
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5c').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5c').toggleClass('mandatory',false);
	}
	var count_547657 = 0;
	if (document.form.qap_mc_547657_810007.checked == true){
		count_547657++;
	}
	if (document.form.qap_mc_547657_810006.checked == true){
		count_547657++;
	}
	if (document.form.qap_mc_547657_810008.checked == true){
		count_547657++;
	}
	if (document.form.qap_mc_547657_813225.checked == true){
		count_547657++;
	}
	if (count_547657 > 0 && count_547657 < 1){
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5j').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5j').toggleClass('mandatory',false);
	}
	if (document.form.qap_mc_547657_810007.checked == false && document.form.qap_mc_547657_810006.checked == false && document.form.qap_mc_547657_810008.checked == false && document.form.qap_mc_547657_813225.checked == false){
		if (document.form.qap_mc_547657_813225.disabled == false && document.form.qap_mc_547657_813225.type != 'hidden'){
			document.form.qap_mc_547657_813225.focus();
		}
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5j').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5j').toggleClass('mandatory',false);
	}
	var count_547658 = 0;
	if (document.form.qap_mc_547658_810014.checked == true){
		count_547658++;
	}
	if (document.form.qap_mc_547658_810016.checked == true){
		count_547658++;
	}
	if (document.form.qap_mc_547658_810018.checked == true){
		count_547658++;
	}
	if (document.form.qap_mc_547658_810011.checked == true){
		count_547658++;
	}
	if (document.form.qap_mc_547658_810012.checked == true){
		count_547658++;
	}
	if (document.form.qap_mc_547658_810010.checked == true){
		count_547658++;
	}
	if (document.form.qap_mc_547658_810015.checked == true){
		count_547658++;
	}
	if (document.form.qap_mc_547658_810009.checked == true){
		count_547658++;
	}
	if (document.form.qap_mc_547658_810013.checked == true){
		count_547658++;
	}
	if (document.form.qap_mc_547658_810017.checked == true){
		count_547658++;
	}
	if (document.form.qap_mc_547658_813226.checked == true){
		count_547658++;
	}
	if (document.form.qap_mc_547658_1010496.checked == true){
		count_547658++;
	}
	if (count_547658 > 0 && count_547658 < 1){
		message = 'For the question \"Q20. Food\" you must make at least 1 selection.<br />';
		valid = false;
	}
	if (document.form.qap_mc_547658_810014.checked == false && document.form.qap_mc_547658_810016.checked == false && document.form.qap_mc_547658_810018.checked == false && document.form.qap_mc_547658_810011.checked == false && document.form.qap_mc_547658_810012.checked == false && document.form.qap_mc_547658_810010.checked == false && document.form.qap_mc_547658_810015.checked == false && document.form.qap_mc_547658_810009.checked == false && document.form.qap_mc_547658_810013.checked == false && document.form.qap_mc_547658_810017.checked == false && document.form.qap_mc_547658_813226.checked == false && document.form.qap_mc_547658_1010496.checked == false){
		if (document.form.qap_mc_547658_813226.disabled == false && document.form.qap_mc_547658_813226.type != 'hidden'){
			document.form.qap_mc_547658_813226.focus();
		}
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5d').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5d').toggleClass('mandatory',false);
	}
	var count_547659 = 0;
	if (document.form.qap_mc_547659_810019.checked == true){
		count_547659++;
	}
	if (document.form.qap_mc_547659_810020.checked == true){
		count_547659++;
	}
	if (document.form.qap_mc_547659_810028.checked == true){
		count_547659++;
	}
	if (document.form.qap_mc_547659_810025.checked == true){
		count_547659++;
	}
	if (document.form.qap_mc_547659_810024.checked == true){
		count_547659++;
	}
	if (document.form.qap_mc_547659_810022.checked == true){
		count_547659++;
	}
	if (document.form.qap_mc_547659_810023.checked == true){
		count_547659++;
	}
	if (document.form.qap_mc_547659_810027.checked == true){
		count_547659++;
	}
	if (document.form.qap_mc_547659_810021.checked == true){
		count_547659++;
	}
	if (document.form.qap_mc_547659_810026.checked == true){
		count_547659++;
	}
	if (document.form.qap_mc_547659_813227.checked == true){
		count_547659++;
	}
	if (count_547659 > 0 && count_547659 < 1){
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5f').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5f').toggleClass('mandatory',false);
	}
	if (document.form.qap_mc_547659_810019.checked == false && document.form.qap_mc_547659_810020.checked == false && document.form.qap_mc_547659_810028.checked == false && document.form.qap_mc_547659_810025.checked == false && document.form.qap_mc_547659_810024.checked == false && document.form.qap_mc_547659_810022.checked == false && document.form.qap_mc_547659_810023.checked == false && document.form.qap_mc_547659_810027.checked == false && document.form.qap_mc_547659_810021.checked == false && document.form.qap_mc_547659_810026.checked == false && document.form.qap_mc_547659_813227.checked == false){
		if (document.form.qap_mc_547659_813227.disabled == false && document.form.qap_mc_547659_813227.type != 'hidden'){
			document.form.qap_mc_547659_813227.focus();
		}
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5f').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5f').toggleClass('mandatory',false);
	}
	var count_547660 = 0;
	if (document.form.qap_mc_547660_810030.checked == true){
		count_547660++;
	}
	if (document.form.qap_mc_547660_810035.checked == true){
		count_547660++;
	}
	if (document.form.qap_mc_547660_810031.checked == true){
		count_547660++;
	}
	if (document.form.qap_mc_547660_810036.checked == true){
		count_547660++;
	}
	if (document.form.qap_mc_547660_813240.checked == true){
		count_547660++;
	}
	if (document.form.qap_mc_547660_810032.checked == true){
		count_547660++;
	}
	if (document.form.qap_mc_547660_810033.checked == true){
		count_547660++;
	}
	if (document.form.qap_mc_547660_810034.checked == true){
		count_547660++;
	}
	if (document.form.qap_mc_547660_810037.checked == true){
		count_547660++;
	}
	if (document.form.qap_mc_547660_813228.checked == true){
		count_547660++;
	}
	if (count_547660 > 0 && count_547660 < 1){
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5l').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5l').toggleClass('mandatory',false);
	}
	if (document.form.qap_mc_547660_810030.checked == false && document.form.qap_mc_547660_810035.checked == false && document.form.qap_mc_547660_810031.checked == false && document.form.qap_mc_547660_810036.checked == false && document.form.qap_mc_547660_813240.checked == false && document.form.qap_mc_547660_810032.checked == false && document.form.qap_mc_547660_810033.checked == false && document.form.qap_mc_547660_810034.checked == false && document.form.qap_mc_547660_810037.checked == false && document.form.qap_mc_547660_813228.checked == false){
		if (document.form.qap_mc_547660_813228.disabled == false && document.form.qap_mc_547660_813228.type != 'hidden'){
			document.form.qap_mc_547660_813228.focus();
		}
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5l').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5l').toggleClass('mandatory',false);
	}
	var count_547698 = 0;
	if (document.form.qap_mc_547698_810053.checked == true){
		count_547698++;
	}
	if (document.form.qap_mc_547698_810054.checked == true){
		count_547698++;
	}
	if (document.form.qap_mc_547698_810055.checked == true){
		count_547698++;
	}
	if (document.form.qap_mc_547698_810057.checked == true){
		count_547698++;
	}
	if (document.form.qap_mc_547698_810058.checked == true){
		count_547698++;
	}
	if (document.form.qap_mc_547698_810056.checked == true){
		count_547698++;
	}
	if (document.form.qap_mc_547698_810062.checked == true){
		count_547698++;
	}
	if (document.form.qap_mc_547698_810059.checked == true){
		count_547698++;
	}
	if (document.form.qap_mc_547698_810060.checked == true){
		count_547698++;
	}
	if (document.form.qap_mc_547698_810061.checked == true){
		count_547698++;
	}
	if (document.form.qap_mc_547698_813229.checked == true){
		count_547698++;
	}
	if (count_547698 > 0 && count_547698 < 1){
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5g').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5g').toggleClass('mandatory',false);
	}
	if (document.form.qap_mc_547698_810053.checked == false && document.form.qap_mc_547698_810054.checked == false && document.form.qap_mc_547698_810055.checked == false && document.form.qap_mc_547698_810057.checked == false && document.form.qap_mc_547698_810058.checked == false && document.form.qap_mc_547698_810056.checked == false && document.form.qap_mc_547698_810062.checked == false && document.form.qap_mc_547698_810059.checked == false && document.form.qap_mc_547698_810060.checked == false && document.form.qap_mc_547698_810061.checked == false && document.form.qap_mc_547698_813229.checked == false){
		if (document.form.qap_mc_547698_813229.disabled == false && document.form.qap_mc_547698_813229.type != 'hidden'){
			document.form.qap_mc_547698_813229.focus();
		}
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5g').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5g').toggleClass('mandatory',false);
	}
	var count_547699 = 0;
	if (document.form.qap_mc_547699_810074.checked == true){
		count_547699++;
	}
	if (document.form.qap_mc_547699_810069.checked == true){
		count_547699++;
	}
	if (document.form.qap_mc_547699_810073.checked == true){
		count_547699++;
	}
	if (document.form.qap_mc_547699_810064.checked == true){
		count_547699++;
	}
	if (document.form.qap_mc_547699_810065.checked == true){
		count_547699++;
	}
	if (document.form.qap_mc_547699_810063.checked == true){
		count_547699++;
	}
	if (document.form.qap_mc_547699_810075.checked == true){
		count_547699++;
	}
	if (document.form.qap_mc_547699_810070.checked == true){
		count_547699++;
	}
	if (document.form.qap_mc_547699_810071.checked == true){
		count_547699++;
	}
	if (document.form.qap_mc_547699_810072.checked == true){
		count_547699++;
	}
	if (document.form.qap_mc_547699_810077.checked == true){
		count_547699++;
	}
	if (document.form.qap_mc_547699_810076.checked == true){
		count_547699++;
	}
	if (document.form.qap_mc_547699_810068.checked == true){
		count_547699++;
	}
	if (document.form.qap_mc_547699_810066.checked == true){
		count_547699++;
	}
	if (document.form.qap_mc_547699_810067.checked == true){
		count_547699++;
	}
	if (document.form.qap_mc_547699_813230.checked == true){
		count_547699++;
	}
	if (count_547699 > 0 && count_547699 < 1){
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5h').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5h').toggleClass('mandatory',false);
	}
	if (document.form.qap_mc_547699_810074.checked == false && document.form.qap_mc_547699_810069.checked == false && document.form.qap_mc_547699_810073.checked == false && document.form.qap_mc_547699_810064.checked == false && document.form.qap_mc_547699_810065.checked == false && document.form.qap_mc_547699_810063.checked == false && document.form.qap_mc_547699_810075.checked == false && document.form.qap_mc_547699_810070.checked == false && document.form.qap_mc_547699_810071.checked == false && document.form.qap_mc_547699_810072.checked == false && document.form.qap_mc_547699_810077.checked == false && document.form.qap_mc_547699_810076.checked == false && document.form.qap_mc_547699_810068.checked == false && document.form.qap_mc_547699_810066.checked == false && document.form.qap_mc_547699_810067.checked == false && document.form.qap_mc_547699_813230.checked == false){
		if (document.form.qap_mc_547699_813230.disabled == false && document.form.qap_mc_547699_813230.type != 'hidden'){
			document.form.qap_mc_547699_813230.focus();
		}
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5h').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5h').toggleClass('mandatory',false);
	}
	var count_547700 = 0;
	if (document.form.qap_mc_547700_810079.checked == true){
		count_547700++;
	}
	if (document.form.qap_mc_547700_813237.checked == true){
		count_547700++;
	}
	if (document.form.qap_mc_547700_813236.checked == true){
		count_547700++;
	}
	if (document.form.qap_mc_547700_813235.checked == true){
		count_547700++;
	}
	if (document.form.qap_mc_547700_813233.checked == true){
		count_547700++;
	}
	if (document.form.qap_mc_547700_813234.checked == true){
		count_547700++;
	}
	if (document.form.qap_mc_547700_813232.checked == true){
		count_547700++;
	}
	if (count_547700 > 0 && count_547700 < 1){
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5i').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5i').toggleClass('mandatory',false);
	}
	if (document.form.qap_mc_547700_810079.checked == false && document.form.qap_mc_547700_813237.checked == false && document.form.qap_mc_547700_813236.checked == false && document.form.qap_mc_547700_813235.checked == false && document.form.qap_mc_547700_813233.checked == false && document.form.qap_mc_547700_813234.checked == false && document.form.qap_mc_547700_813232.checked == false){
		if (document.form.qap_mc_547700_813232.disabled == false && document.form.qap_mc_547700_813232.type != 'hidden'){
			document.form.qap_mc_547700_813232.focus();
		}
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5i').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5i').toggleClass('mandatory',false);
	}
	var count_547701 = 0;
	if (document.form.qap_mc_547701_810095.checked == true){
		count_547701++;
	}
	if (document.form.qap_mc_547701_810088.checked == true){
		count_547701++;
	}
	if (document.form.qap_mc_547701_810087.checked == true){
		count_547701++;
	}
	if (document.form.qap_mc_547701_810084.checked == true){
		count_547701++;
	}
	if (document.form.qap_mc_547701_810091.checked == true){
		count_547701++;
	}
	if (document.form.qap_mc_547701_810092.checked == true){
		count_547701++;
	}
	if (document.form.qap_mc_547701_810096.checked == true){
		count_547701++;
	}
	if (document.form.qap_mc_547701_832544.checked == true){
		count_547701++;
	}
	if (document.form.qap_mc_547701_810093.checked == true){
		count_547701++;
	}
	if (document.form.qap_mc_547701_810083.checked == true){
		count_547701++;
	}
	if (document.form.qap_mc_547701_810082.checked == true){
		count_547701++;
	}
	if (document.form.qap_mc_547701_810090.checked == true){
		count_547701++;
	}
	if (document.form.qap_mc_547701_810086.checked == true){
		count_547701++;
	}
	if (document.form.qap_mc_547701_810085.checked == true){
		count_547701++;
	}
	if (document.form.qap_mc_547701_810094.checked == true){
		count_547701++;
	}
	if (document.form.qap_mc_547701_810089.checked == true){
		count_547701++;
	}
	if (document.form.qap_mc_547701_813238.checked == true){
		count_547701++;
	}
	if (count_547701 > 0 && count_547701 < 1){
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5k').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5k').toggleClass('mandatory',false);
	}
	if (document.form.qap_mc_547701_810095.checked == false && document.form.qap_mc_547701_810088.checked == false && document.form.qap_mc_547701_810087.checked == false && document.form.qap_mc_547701_810084.checked == false && document.form.qap_mc_547701_810091.checked == false && document.form.qap_mc_547701_810092.checked == false && document.form.qap_mc_547701_810096.checked == false && document.form.qap_mc_547701_832544.checked == false && document.form.qap_mc_547701_810093.checked == false && document.form.qap_mc_547701_810083.checked == false && document.form.qap_mc_547701_810082.checked == false && document.form.qap_mc_547701_810090.checked == false && document.form.qap_mc_547701_810086.checked == false && document.form.qap_mc_547701_810085.checked == false && document.form.qap_mc_547701_810094.checked == false && document.form.qap_mc_547701_810089.checked == false && document.form.qap_mc_547701_813238.checked == false){
		if (document.form.qap_mc_547701_813238.disabled == false && document.form.qap_mc_547701_813238.type != 'hidden'){
			document.form.qap_mc_547701_813238.focus();
		}
		$('.surveylabels5a').toggleClass('mandatory',true);
		$('.surveylabels5k').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels5k').toggleClass('mandatory',false);
	}
	return [valid,message];
}
//-----------------------------Div 6----------------------------------------
function fnDoSubmit6(){
	var valid = true;
	var message = '';
	var count_547704 = 0;
	if (document.form.qap_mc_547704_810105.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_810114.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_810104.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_810113.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_810110.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_810106.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_810111.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_810109.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_810103.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_810102.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_810112.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_810101.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_810107.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_810108.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_813239.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_1010497.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_1010498.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_1010499.checked == true){
		count_547704++;
	}
	if (document.form.qap_mc_547704_1010500.checked == true){
		count_547704++;
	}	
	if (count_547704 > 0 && count_547704 < 1){
		$('.surveylabels6a').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels6a').toggleClass('mandatory',false);
	}
	if (document.form.qap_mc_547704_810105.checked == false && document.form.qap_mc_547704_810114.checked == false && document.form.qap_mc_547704_810104.checked == false && document.form.qap_mc_547704_810113.checked == false && document.form.qap_mc_547704_810110.checked == false && document.form.qap_mc_547704_810106.checked == false && document.form.qap_mc_547704_810111.checked == false && document.form.qap_mc_547704_810109.checked == false && document.form.qap_mc_547704_810103.checked == false && document.form.qap_mc_547704_810102.checked == false && document.form.qap_mc_547704_810112.checked == false && document.form.qap_mc_547704_810101.checked == false && document.form.qap_mc_547704_810107.checked == false && document.form.qap_mc_547704_810108.checked == false && document.form.qap_mc_547704_813239.checked == false && document.form.qap_mc_547704_1010497.checked == false && document.form.qap_mc_547704_1010498.checked == false && document.form.qap_mc_547704_1010499.checked == false && document.form.qap_mc_547704_1010500.checked == false){
		if (document.form.qap_mc_547704_813239.disabled == false && document.form.qap_mc_547704_813239.type != 'hidden'){
			document.form.qap_mc_547704_813239.focus();
		}
		$('.surveylabels6a').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels6a').toggleClass('mandatory',false);
	}
	var count_547708 = 0;
	if (document.form.qap_mc_547708_810128.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810129.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810130.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810131.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810132.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810135.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810133.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810134.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810153.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810140.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810142.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810141.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810143.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810136.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810137.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810139.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810145.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810138.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810144.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810146.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810147.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810148.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810149.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810150.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810151.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810152.checked == true){
		count_547708++;
	}
	if (document.form.qap_mc_547708_810154.checked == true){
		count_547708++;
	}
	if (count_547708 > 0 && count_547708 < 1){
		$('.surveylabels6b').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels6b').toggleClass('mandatory',false);
	}
	if (document.form.qap_mc_547708_810128.checked == false && document.form.qap_mc_547708_810129.checked == false && document.form.qap_mc_547708_810130.checked == false && document.form.qap_mc_547708_810131.checked == false && document.form.qap_mc_547708_810132.checked == false && document.form.qap_mc_547708_810135.checked == false && document.form.qap_mc_547708_810133.checked == false && document.form.qap_mc_547708_810134.checked == false && document.form.qap_mc_547708_810153.checked == false && document.form.qap_mc_547708_810140.checked == false && document.form.qap_mc_547708_810142.checked == false && document.form.qap_mc_547708_810141.checked == false && document.form.qap_mc_547708_810143.checked == false && document.form.qap_mc_547708_810136.checked == false && document.form.qap_mc_547708_810137.checked == false && document.form.qap_mc_547708_810139.checked == false && document.form.qap_mc_547708_810145.checked == false && document.form.qap_mc_547708_810138.checked == false && document.form.qap_mc_547708_810144.checked == false && document.form.qap_mc_547708_810146.checked == false && document.form.qap_mc_547708_810147.checked == false && document.form.qap_mc_547708_810148.checked == false && document.form.qap_mc_547708_810149.checked == false && document.form.qap_mc_547708_810150.checked == false && document.form.qap_mc_547708_810151.checked == false && document.form.qap_mc_547708_810152.checked == false && document.form.qap_mc_547708_810154.checked == false){
		if (document.form.qap_mc_547708_810154.disabled == false && document.form.qap_mc_547708_810154.type != 'hidden'){
			document.form.qap_mc_547708_810154.focus();
		}
		$('.surveylabels6b').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels6b').toggleClass('mandatory',false);
	}
	return [valid,message];
}
//-----------------------------Div 7----------------------------------------
function fnDoSubmit7(){
	var valid = true;
	var message = '';
	var count_547711 = 0;
	if (document.form.qap_mc_547711_826944.checked == true){
		count_547711++;
	}
	if (document.form.qap_mc_547711_826945.checked == true){
		count_547711++;
	}
	if (document.form.qap_mc_547711_826946.checked == true){
		count_547711++;
	}
	if (document.form.qap_mc_547711_826947.checked == true){
		count_547711++;
	}
	if (document.form.qap_mc_547711_826949.checked == true){
		count_547711++;
	}
	if (document.form.qap_mc_547711_826950.checked == true){
		count_547711++;
	}
	if (document.form.qap_mc_547711_826951.checked == true){
		count_547711++;
	}
	if (document.form.qap_mc_547711_826948.checked == true){
		count_547711++;
	}
	if (document.form.qap_mc_547711_826952.checked == true){
		count_547711++;
	}
	if (document.form.qap_mc_547711_826956.checked == true){
		count_547711++;
	}
	if (document.form.qap_mc_547711_826953.checked == true){
		count_547711++;
	}
	if (document.form.qap_mc_547711_826954.checked == true){
		count_547711++;
	}
	if (document.form.qap_mc_547711_826955.checked == true){
		count_547711++;
	}
	if (document.form.qap_mc_547711_826957.checked == true){
		count_547711++;
	}
	if (count_547711 > 0 && count_547711 < 1){
		$('.surveylabels7a').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels7a').toggleClass('mandatory',false);
	}
	if (document.form.qap_mc_547711_826944.checked == false && document.form.qap_mc_547711_826945.checked == false && document.form.qap_mc_547711_826946.checked == false && document.form.qap_mc_547711_826947.checked == false && document.form.qap_mc_547711_826949.checked == false && document.form.qap_mc_547711_826950.checked == false && document.form.qap_mc_547711_826951.checked == false && document.form.qap_mc_547711_826948.checked == false && document.form.qap_mc_547711_826952.checked == false && document.form.qap_mc_547711_826956.checked == false && document.form.qap_mc_547711_826953.checked == false && document.form.qap_mc_547711_826954.checked == false && document.form.qap_mc_547711_826955.checked == false && document.form.qap_mc_547711_826957.checked == false){
		if (document.form.qap_mc_547711_826957.disabled == false && document.form.qap_mc_547711_826957.type != 'hidden'){
			document.form.qap_mc_547711_826957.focus();
		}
		$('.surveylabels7a').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels7a').toggleClass('mandatory',false);
	}
	return [valid,message];
}
//-----------------------------Div 8----------------------------------------
function fnDoSubmit8(){
	var valid = true;
	var message = '';
	var count_547729 = 0;
	if (document.form.qap_mc_547729_810160.checked == true){
		count_547729++;
	}
	if (document.form.qap_mc_547729_810161.checked == true){
		count_547729++;
	}
	if (document.form.qap_mc_547729_810162.checked == true){
		count_547729++;
	}
	if (document.form.qap_mc_547729_810163.checked == true){
		count_547729++;
	}
	if (document.form.qap_mc_547729_810164.checked == true){
		count_547729++;
	}
	if (document.form.qap_mc_547729_810165.checked == true){
		count_547729++;
	}
	if (document.form.qap_mc_547729_810166.checked == true){
		count_547729++;
	}
	if (document.form.qap_mc_547729_810167.checked == true){
		count_547729++;
	}
	if (document.form.qap_mc_547729_810168.checked == true){
		count_547729++;
	}
	if (document.form.qap_mc_547729_810169.checked == true){
		count_547729++;
	}
	if (document.form.qap_mc_547729_810170.checked == true){
		count_547729++;
	}
	if (document.form.qap_mc_547729_810171.checked == true){
		count_547729++;
	}
	if (document.form.qap_mc_547729_826958.checked == true){
		count_547729++;
	}
	if (count_547729 > 0 && count_547729 < 1){
		$('.surveylabels8a').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels8a').toggleClass('mandatory',false);
	}
	if (document.form.qap_mc_547729_810160.checked == false && document.form.qap_mc_547729_810161.checked == false && document.form.qap_mc_547729_810162.checked == false && document.form.qap_mc_547729_810163.checked == false && document.form.qap_mc_547729_810164.checked == false && document.form.qap_mc_547729_810165.checked == false && document.form.qap_mc_547729_810166.checked == false && document.form.qap_mc_547729_810167.checked == false && document.form.qap_mc_547729_810168.checked == false && document.form.qap_mc_547729_810169.checked == false && document.form.qap_mc_547729_810170.checked == false && document.form.qap_mc_547729_810171.checked == false && document.form.qap_mc_547729_826958.checked == false){
		if (document.form.qap_mc_547729_826958.disabled == false && document.form.qap_mc_547729_826958.type != 'hidden'){
			document.form.qap_mc_547729_826958.focus();
		}
		$('.surveylabels8a').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels8a').toggleClass('mandatory',false);
	}
	if (document.form.qap_mc_547732_810174.checked == false && document.form.qap_mc_547732_810175.checked == false && document.form.qap_mc_547732_810173.checked == false && document.form.qap_mc_547732_810176.checked == false && document.form.qap_mc_547732_810172.checked == false && document.form.qap_mc_547732_810177.checked == false){
		if (document.form.qap_mc_547732_810177.disabled == false && document.form.qap_mc_547732_810177.type != 'hidden'){
			document.form.qap_mc_547732_810177.focus();
		}
		$('.surveylabels8b').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels8b').toggleClass('mandatory',false);
	}
	return [valid,message];
}
//-----------------------------Div 9----------------------------------------
function fnDoSubmit9(){
	var valid = true;
	var message = '';
	if (document.form.qap_r_547733[0].checked == false && document.form.qap_r_547733[1].checked == false && document.form.qap_r_547733[2].checked == false && document.form.qap_r_547733[3].checked == false && document.form.qap_r_547733[4].checked == false){
		if (document.form.qap_r_547733[0].disabled == false && document.form.qap_r_547733.type != 'hidden'){
			//document.form.qap_r_547733[0].focus();
		}
		$('.surveylabels9a').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels9a').toggleClass('mandatory',false);
	}
	var count_547734 = 0;
	if (document.form.qap_mc_547734_810183.checked == true){
		count_547734++;
	}
	if (document.form.qap_mc_547734_810184.checked == true){
		count_547734++;
	}
	if (document.form.qap_mc_547734_810185.checked == true){
		count_547734++;
	}
	if (document.form.qap_mc_547734_810186.checked == true){
		count_547734++;
	}
	if (document.form.qap_mc_547734_810187.checked == true){
		count_547734++;
	}
	if (document.form.qap_mc_547734_810188.checked == true){
		count_547734++;
	}
	if (document.form.qap_mc_547734_810189.checked == true){
		count_547734++;
	}
	if (document.form.qap_mc_547734_810190.checked == true){
		count_547734++;
	}
	if (document.form.qap_mc_547734_810191.checked == true){
		count_547734++;
	}
	if (document.form.qap_mc_547734_810192.checked == true){
		count_547734++;
	}
	if (document.form.qap_mc_547734_810193.checked == true){
		count_547734++;
	}
	if (document.form.qap_mc_547734_810194.checked == true){
		count_547734++;
	}
	if (document.form.qap_mc_547734_810195.checked == true){
		count_547734++;
	}
	if (document.form.qap_mc_547734_810196.checked == true){
		count_547734++;
	}
	if (document.form.qap_mc_547734_810197.checked == true){
		count_547734++;
	}
	if (document.form.qap_mc_547734_810198.checked == true){
		count_547734++;
	}
	if (count_547734 > 0 && count_547734 < 1){
		$('.surveylabels9b').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels9b').toggleClass('mandatory',false);
	}
	if (document.form.qap_mc_547734_810183.checked == false && document.form.qap_mc_547734_810184.checked == false && document.form.qap_mc_547734_810185.checked == false && document.form.qap_mc_547734_810186.checked == false && document.form.qap_mc_547734_810187.checked == false && document.form.qap_mc_547734_810188.checked == false && document.form.qap_mc_547734_810189.checked == false && document.form.qap_mc_547734_810190.checked == false && document.form.qap_mc_547734_810191.checked == false && document.form.qap_mc_547734_810192.checked == false && document.form.qap_mc_547734_810193.checked == false && document.form.qap_mc_547734_810194.checked == false && document.form.qap_mc_547734_810195.checked == false && document.form.qap_mc_547734_810196.checked == false && document.form.qap_mc_547734_810197.checked == false && document.form.qap_mc_547734_810198.checked == false){
		if (document.form.qap_mc_547734_810198.disabled == false && document.form.qap_mc_547734_810198.type != 'hidden'){
			//document.form.qap_mc_547734_810198.focus();
		}
		$('.surveylabels9b').toggleClass('mandatory',true);
		valid = false;
	} else {
		$('.surveylabels9b').toggleClass('mandatory',false);
	}
	return [valid,message];
}


$(document).ready(function(){
	var button_pressed = false; // used to stop people subscribing multiple times 

	//error modal in place of alert
	/*$('#thinkspot_message').dialog({
		modal:true,
		autoOpen:false,
		width:600,
		title: 'Oops, there were some errors found!',
		buttons:{
			"Ok": function() {
				$(this).dialog("close");
			}
		}
	});*/
	$('#footer').hide();
	//initialise
	$('#join_parentdiv').cycle({
		timeout:0,
		nowrap:1,
		height:'auto',
		cleartype:1,
		containerResize:0
	});
	$('#join_parentdiv').css({'height':'600px'});
	$('#join_parentdiv').show();
	$('#footer').show();


	//-----next/submit buttons----------------------------------------------
	$('#join_submit0_next').click(function(){
		if ($('#seg').val() == ''){
			$('.surveylabels0').toggleClass('mandatory',true);
			$('.notification').toggleClass('mandatory',true);
		}else{
			$('.notification').toggleClass('mandatory',false);
			$('.surveylabels0').toggleClass('mandatory',false);
			$('#join_parentdiv').css({'height':'595px'});
			$('#join_parentdiv').cycle(1);
		}
		window.location.replace('#');
		return false;
	});
	$('#join_submit1_next').click(function(){
		fnDoSubmit1();
		window.location.replace('#');
		return false;
	});
	$('#join_submit2_next').click(function(){
		var _a_return = fnDoSubmit2();
		if(!_a_return[0]){
			/*$('#thinkspot_message').html(_a_return[1]);
			$('#thinkspot_message').dialog('open');*/
			$('.notification').toggleClass('mandatory',true);
		} else {
			$('.notification').toggleClass('mandatory',false);
			$('.surveylabels2').toggleClass('mandatory',false);
			$('#join_parentdiv').css({'height':'470px'});
			$('#join_parentdiv').cycle(3);
		}
		window.location.replace('#');
		return false;
	});
	$('#join_submit3_next').click(function(){
		var _a_return = fnDoSubmit3();
		if(!_a_return[0]){
			/*$('#thinkspot_message').html(_a_return[1]);
			$('#thinkspot_message').dialog('open');*/
			$('.notification').toggleClass('mandatory',true);
		} else {
			$('.notification').toggleClass('mandatory',false);
			$('.surveylabels3').toggleClass('mandatory',false);
			$('.surveylabels3_').toggleClass('mandatory',false);
			$('#join_parentdiv').css({'height':'520px'});
			$('#join_parentdiv').cycle(4);
		}
		window.location.replace('#');
		return false;
	});
	$('#join_submit4_next').click(function(){
		var _a_return = fnDoSubmit4();
		if(!_a_return[0]){
			/*$('#thinkspot_message').html(_a_return[1]);
			$('#thinkspot_message').dialog('open');*/
			$('.notification').toggleClass('mandatory',true);
		} else {
			$('.notification').toggleClass('mandatory',false);
			$('.surveylabels4').toggleClass('mandatory',false);
			$('.surveylabels4_').toggleClass('mandatory',false);
			$('#join_parentdiv').css({'height':'1285px'});
			$('#join_parentdiv').cycle(5);
		}
		window.location.replace('#');
		return false;
	});
	$('#join_submit5_next').click(function(){
		var _a_return = fnDoSubmit5();
		if(!_a_return[0]){
			/*$('#thinkspot_message').html(_a_return[1]);
			$('#thinkspot_message').dialog('open');*/
			$('.notification').toggleClass('mandatory',true);
		} else {
			$('.notification').toggleClass('mandatory',false);
			$('.surveylabels5').toggleClass('mandatory',false);
			$('#join_parentdiv').css({'height':'910px'});
			$('#join_parentdiv').cycle(6);
		}
		window.location.replace('#');
		return false;
	});
	$('#join_submit6_next').click(function(){
		var _a_return = fnDoSubmit6();
		if(!_a_return[0]){
			/*$('#thinkspot_message').html(_a_return[1]);
			$('#thinkspot_message').dialog('open');*/
			$('.notification').toggleClass('mandatory',true);
		} else {
			$('.notification').toggleClass('mandatory',false);
			$('.surveylabels6').toggleClass('mandatory',false);
			$('#join_parentdiv').css({'height':'585px'});
			$('#join_parentdiv').cycle(7);
		}
		window.location.replace('#');
		return false;
	});
	$('#join_submit7_next').click(function(){
		var _a_return = fnDoSubmit7();
		if(!_a_return[0]){
			/*$('#thinkspot_message').html(_a_return[1]);
			$('#thinkspot_message').dialog('open');*/
			$('.notification').toggleClass('mandatory',true);
		} else {
			$('.notification').toggleClass('mandatory',false);
			$('.surveylabels7').toggleClass('mandatory',false);
			$('#join_parentdiv').css({'height':'605px'});
			$('#join_parentdiv').cycle(8);
		}
		window.location.replace('#');
		return false;
	});
	$('#join_submit8_next').click(function(){
		var _a_return = fnDoSubmit8();
		if(!_a_return[0]){
			/*$('#thinkspot_message').html(_a_return[1]);
			$('#thinkspot_message').dialog('open');*/
			$('.notification').toggleClass('mandatory',true);
		} else {
			$('.notification').toggleClass('mandatory',false);
			$('.surveylabels8').toggleClass('mandatory',false);
			$('#join_parentdiv').css({'height':'710px'});
			$('#join_parentdiv').cycle(9);
		}
		window.location.replace('#');
		return false;
	});
	$('#complete_survey_button').click(function(){
		if (button_pressed == false){
			button_pressed = true;
			var _a_return = fnDoSubmit9();
			if(!_a_return[0]){
				$('.notification').toggleClass('mandatory',true);
			} else {
				$('.notification').toggleClass('mandatory',false);
				$('.surveylabels9').toggleClass('mandatory',false);
				$('#dialog').jqmShow();
				$.postJSON("services/subscribe.php",$("#form").serialize(),
					function(data){
						if (data.status=='0'){
							$('.join_td0').html("<h1>Thank You!</h1><p>&nbsp;</p><span class=\"join_p0\"><p>Your registration has been submitted! We will send you an email to confirm your email address shortly - <u>you need to click the link in this email to activate your account.</u></p><p>&nbsp;</p><p>Once you confirm your registration, your name will be entered into the draw to win an <u>Apple iPhone 3GS 16Gb!</u></p><p>&nbsp;</p><p><strong>The ThinkSpot Team.</strong></p></span>");
							$('#join_parentdiv').css({'height':'355px'});
							$('.join_p0').css({'height':'180px'});
							$('#join_parentdiv').cycle(0);
							$('#join_div0').css({'height':'355px'});
						}else if (data.status=='1'){
							alert('The code did not match. Please try again.');
							document.getElementById('captcha').src = 'includes/securimage/securimage_show.php?' + Math.random();
						}else{
							$('#join_parentdiv').html("<p>Oh no! An error has occured, please try again later. Sorry for the inconvenience!</p>")
						}
						$('#dialog').jqmHide();
					}
				);
			}
			window.location.replace('#');
		}
		button_pressed = false;
		return false;
	});
	//--------prev buttons--------------------------------------------------
	$('#join_submit1_prev').click(function(){
		$('.notification').toggleClass('mandatory',false);
		$('#join_parentdiv').css({'height':'600px'});
		$('#join_parentdiv').cycle(0);
		return false;
	});
	$('#join_submit2_prev').click(function(){
		$('.notification').toggleClass('mandatory',false);
		$('#join_parentdiv').css({'height':'595px'});
		$('#join_parentdiv').cycle(1);
		return false;
	});
	$('#join_submit3_prev').click(function(){
		$('.notification').toggleClass('mandatory',false);
		$('#join_parentdiv').css({'height':'405px'});
		$('#join_parentdiv').cycle(2);
		return false;
	});
	$('#join_submit4_prev').click(function(){
		$('.notification').toggleClass('mandatory',false);
		$('#join_parentdiv').css({'height':'470px'});
		$('#join_parentdiv').cycle(3);
		return false;
	});
	$('#join_submit5_prev').click(function(){
		$('.notification').toggleClass('mandatory',false);
		$('#join_parentdiv').css({'height':'520px'});
		$('#join_parentdiv').cycle(4);
		return false;
	});
	$('#join_submit6_prev').click(function(){
		$('.notification').toggleClass('mandatory',false);
		$('#join_parentdiv').css({'height':'1285px'});
		$('#join_parentdiv').cycle(5);
		return false;
	});
	$('#join_submit7_prev').click(function(){
		$('.notification').toggleClass('mandatory',false);
		$('#join_parentdiv').css({'height':'910px'});
		$('#join_parentdiv').cycle(6);
		return false;
	});
	$('#join_submit8_prev').click(function(){
		$('.notification').toggleClass('mandatory',false);
		$('#join_parentdiv').css({'height':'585px'});
		$('#join_parentdiv').cycle(7);
		return false;
	});
	$('#join_submit9_prev').click(function(){
		$('.notification').toggleClass('mandatory',false);
		$('#join_parentdiv').css({'height':'605px'});
		$('#join_parentdiv').cycle(8);
		return false;
	});
	$.postJSON = function(url, data, callback) {$.post(url, data, callback, "json");};
});