var sl17,sl18,validcheck
function show17(value)
{
	
	if(value==1)
	{
		document.getElementById('relation').style.display='';

	}
	if(value==0)
	{ 
		document.getElementById('relation').style.display='none';

	}
}   
function show_txt()
{
    
	if(document.frm_survey.chk_other_aspect.checked )
	{
		document.frm_survey.txt_other_aspect.style.visibility='visible';
	}
	else
	{		
		document.frm_survey.txt_other_aspect.style.visibility='hidden';
		document.frm_survey.txt_other_aspect.value="";

	}

	if(document.frm_survey.chk_medical_treatment.checked)
	{
		document.frm_survey.txt_medical_treatment.style.visibility='visible';
	}
	else
	{		
		document.frm_survey.txt_medical_treatment.style.visibility='hidden';
		document.frm_survey.txt_medical_treatment.value="";
	}

	if(document.frm_survey.chk_treatment_other.checked )
	{
		document.frm_survey.txt_treatment_other.style.visibility='visible';
	}
	else
	{		
		document.frm_survey.txt_treatment_other.style.visibility='hidden';
		document.frm_survey.txt_treatment_other.value="";
	}
	
}
// ****** For consumer Survey ******
function show_othertxt()
{
    
	for (i=(document.frm_consumer_survey.rdo_industry.length-1); i > -1; i--) {
		if (document.frm_consumer_survey.rdo_industry[i].checked) {
		/*alert((document.frm_consumer_survey.rdo_industry[i].value);*/
		
			if (document.frm_consumer_survey.rdo_industry[i].value==1)
			{
				document.frm_consumer_survey.text_industry.style.visibility='visible';
			}
			else
			{		
				document.frm_consumer_survey.text_industry.style.visibility='hidden';
				document.frm_consumer_survey.text_industry.value="";
			}
		}
	}
	
	for (i=(document.frm_consumer_survey.rdo_symptom.length-1); i > -1; i--) {
		if (document.frm_consumer_survey.rdo_symptom[i].checked) {			
			if (document.frm_consumer_survey.rdo_symptom[i].value==1)
			{
				document.frm_consumer_survey.text_symptom_other.style.visibility='visible';
			}
			else
			{		
				document.frm_consumer_survey.text_symptom_other.style.visibility='hidden';
				document.frm_consumer_survey.text_symptom_other.value="";
			}
		}
	}

}
//**************
function ibsdrop()
{
 
	document.getElementById("ibsdrop").style.display= '';
	 
}
function ibsdiv()
{

	document.getElementById("ibsdrop").style.display= 'none';
	
}

function ibs_suspect_check() {
myOption = -1;
validcheck=0;
	for (i=document.frm_survey.rdo_IBS_suspect.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_IBS_suspect[i].checked) {
	/*alert(document.frm_survey.rdo_IBS_suspect[i].value);*/
	myOption = i;
	
	if (document.frm_survey.rdo_IBS_suspect[i].value==2) {
	validcheck=1;
	window.location="ibs_survey.asp#16";
	} //if val=2
	} //if checked
	} //for i loop
	} //end of function
/*function submit() {
	objForm = window.document.frm_survey;
	objForm.method = "POST";	
	objForm.submit();
}*/

// ************ for consumer_survey ************
function ibs_suspect_check2() {
myOption = -1;
validcheck=0;
	for (i=document.frm_consumer_survey.rdo_IBS_suspect.length-1; i > -1; i--) {
		
	if (document.frm_consumer_survey.rdo_IBS_suspect[i].checked) {
	/*alert(document.frm_survey.rdo_IBS_suspect[i].value);*/
	myOption = i;
	
	if (document.frm_consumer_survey.rdo_IBS_suspect[i].value==0) {
	validcheck=1;
	alert("Thank you for your time, this survey is intended for IBS sufferers only.");
	//window.location="http://ibs-relief.co.uk/abdominal_pain.asp";
	//window.open("http://ibs-relief.co.uk/abdominal_pain.asp");
	
	} //if val=0
	} //if checked
	} //for i loop
	} //end of function

// **********
function validateall() { 
var totval=0;
	myOption = -1;
	for (i=document.frm_survey.rdo_IBS_suspect.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_IBS_suspect[i].checked) {
		myOption = i;
		totval = ++totval;
		}
		}
	myOption = -1;
	for (i=document.frm_survey.rdo_age.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_age[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}		
		
	myOption = -1;
	for (i=document.frm_survey.rdo_suspect.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_suspect[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}	
		
	if ( document.frm_survey.chk_diagnosed_GP.checked== true || document.frm_survey.chk_notdiagnosed_GP.checked== true ||  document.frm_survey.chk_visited_pharmacist.checked== true || document.frm_survey.chk_notdiscussed.checked== true  )
		{
		totval = ++totval;
		}		
	
	myOption = -1;
	for (i=document.frm_survey.rdo_frequency.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_frequency[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}	
if ( document.frm_survey.chk_Social_life.checked== true || document.frm_survey.chk_job.checked== true ||  document.frm_survey.chk_personalrel.checked== true || document.frm_survey.chk_travel.checked== true || document.frm_survey.chk_all_aspect.checked== true || document.frm_survey.chk_no_impact.checked== true || document.frm_survey.chk_other_aspect.checked== true )
	{
	totval = ++totval;
	}		
if ( document.frm_survey.chk_partner.checked == true || document.frm_survey.chk_immdt_family.checked == true || document.frm_survey.chk_other_relative.checked == true || document.frm_survey.chk_friends.checked == true || document.frm_survey.chk_work_colleagues.checked == true || document.frm_survey.chk_employer.checked == true)
	{
	totval = ++totval;
	}
myOption = -1;
	for (i=document.frm_survey.rdo_periodpain.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_periodpain[i].checked) {
		myOption = i;
		totval = ++totval;
	}
	}		
myOption = -1;
	for (i=document.frm_survey.rdo_backpain.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_backpain[i].checked) {
		myOption = i;
		totval = ++totval;
	}
	}	
myOption = -1;
	for (i=document.frm_survey.rdo_childbirth.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_childbirth[i].checked) {
		myOption = i;
		totval = ++totval;
	}
	}	
myOption = -1;
	for (i=document.frm_survey.rdo_headache.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_headache[i].checked) {
		myOption = i;
		totval = ++totval;
	}
	}	
	myOption = -1;
	for (i=document.frm_survey.rdo_indigestion.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_indigestion[i].checked) {
		myOption = i;
		totval = ++totval;
	}
	}	
	myOption = -1;
	for (i=document.frm_survey.rdo_migraine.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_migraine[i].checked) {
		myOption = i;
		totval = ++totval;
	}
	}
if (document.frm_survey.txt_note1.value!="")	{
		totval = ++totval;
	}

if (document.frm_survey.txt_note2.value!="")	
	{
		totval = ++totval;
	}


if (document.frm_survey.txt_note3.value!="")	
	{
		totval = ++totval;
	}

if (document.frm_survey.txt_causenote.value!="")	
	{
		totval = ++totval;
	}
if ( document.frm_survey.chk_medical_treatment.checked == true || document.frm_survey.chk_diet_modification.checked == true || document.frm_survey.chk_exercise.checked == true || document.frm_survey.chk_alt_therapy.checked == true || document.frm_survey.chk_de_stressing.checked == true )
	{
		totval = ++totval;
	}

if ( document.frm_survey.chk_naturally_derived_product.checked == true || document.frm_survey.chk_clnically_proven_product.checked == true || document.frm_survey.chk_cause_of_pain.checked == true || document.frm_survey.chk_non_medical.checked == true || document.frm_survey.chk_prescription.checked == true || document.frm_survey.chk_known_treatment.checked == true || document.frm_survey.chk_treatment_other.checked == true )
	{
		totval = ++totval;
	}

myOption = -1;
	for (i=document.frm_survey.rdo_effect_mylife.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_effect_mylife[i].checked) {
		myOption = i;
		totval = ++totval;
	/*alert("total val = "+totval); */}
	}
myOption = -1;
	for (i=document.frm_survey.rdo_worst_symptom.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_worst_symptom[i].checked) {
		myOption = i;
				totval = ++totval;
	/*alert("total val = "+totval); */}
	}

myOption = -1;
	for (i=document.frm_survey.rdo_easy_to_control.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_easy_to_control[i].checked) {
		myOption = i;
				totval = ++totval;
	/*alert("total val = "+totval); */}
	}


myOption = -1;
	for (i=document.frm_survey.rdo_frustration.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_frustration[i].checked) {
		myOption = i;
				totval = ++totval;
	/*alert("total val = "+totval); */}
	}

myOption = -1;
	for (i=document.frm_survey.rdo_predict.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_predict[i].checked) {
		myOption = i;
				totval = ++totval;
	/*alert("total val = "+totval); */}
	}


myOption = -1;
	for (i=document.frm_survey.rdo_childbirth_pain.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_childbirth_pain[i].checked) {
		myOption = i;
				totval = ++totval;
	/*alert("total val = "+totval); */}
	}
	
if ( document.frm_survey.chk_nopain_you.checked == true || document.frm_survey.chk_nopain_family.checked == true || document.frm_survey.chk_nopain_doctor.checked == true || document.frm_survey.chk_nopain_other.checked == true  )
	{
		totval = ++totval;
	/*alert("total val = "+totval); */}
	
if ( document.frm_survey.chk_pain_you.checked == true || document.frm_survey.chk_pain_family.checked == true || document.frm_survey.chk_pain_doctor.checked == true || document.frm_survey.chk_pain_other.checked == true  )
	{
		totval = ++totval;
	/*alert("total val = "+totval); */}
	
if ( document.frm_survey.chk_trivial_you.checked == true || document.frm_survey.chk_trivial_family.checked == true || document.frm_survey.chk_trivial_doctor.checked == true || document.frm_survey.chk_trivial_other.checked == true  )
	{
		totval = ++totval;
	/*alert("total val = "+totval); */}	
if ( document.frm_survey.chk_discomfort_you.checked == true || document.frm_survey.chk_discomfort_family.checked == true || document.frm_survey.chk_discomfort_doctor.checked == true || document.frm_survey.chk_discomfort_other.checked == true  )
	{
		totval = ++totval;
	/*alert("total val = "+totval); */}		
	
if ( document.frm_survey.chk_serious_you.checked == true || document.frm_survey.chk_serious_family.checked == true || document.frm_survey.chk_serious_doctor.checked == true || document.frm_survey.chk_serious_other.checked == true  )
	{
		totval = ++totval;
	/*alert("total val = "+totval); */}		
		
if ( document.frm_survey.chk_impact_you.checked == true || document.frm_survey.chk_impact_family.checked == true || document.frm_survey.chk_impact_doctor.checked == true || document.frm_survey.chk_impact_other.checked == true )
	{
		totval = ++totval;
	/*alert("total val = "+totval); */}
if ( document.frm_survey.chk_in_mind_you.checked == true || document.frm_survey.chk_in_mind_family.checked == true || document.frm_survey.chk_in_mind_doctor.checked == true || document.frm_survey.chk_in_mind_other.checked == true )
	{
		totval = ++totval;
	/*alert("total val = "+totval); */}	

	
if ( document.frm_survey.chk_feel_stressed.checked == true || document.frm_survey.chk_laid_back.checked == true || document.frm_survey.chk_busy_life.checked == true || document.frm_survey.chk_my_stride.checked == true || document.frm_survey.chk_ambitious_person.checked == true || document.frm_survey.chk_best_at.checked == true || document.frm_survey.chk_half_glass.checked == true || document.frm_survey.chk_half_full.checked == true || document.frm_survey.chk_get_anxious.checked == true || document.frm_survey.chk_worry_things.checked == true || document.frm_survey.chk_getting_worse.checked == true || document.frm_survey.chk_forced_stop.checked == true)
	{
		totval = ++totval;
	/*alert("total val = "+totval); */}		


myOption = -1;
	for (i=document.frm_survey.rdo_IBS_suffer.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_IBS_suffer[i].checked) {
		myOption = i;
		totval = ++totval;
	/*alert("total val = "+totval); */}
	}
	myOption = -1;
	for (i=document.frm_survey.rdo_no_pain.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_no_pain[i].checked) {
		myOption = i;
		totval = ++totval;
	/*alert("total val = "+totval); */}
	}
	myOption = -1;
	for (i=document.frm_survey.rdo_severe_pain.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_severe_pain[i].checked) {
		myOption = i;
		totval = ++totval;
	/*alert("total val = "+totval); */}
	}
	myOption = -1;
	for (i=document.frm_survey.rdo_trivial_condition.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_trivial_condition[i].checked) {
		myOption = i;
		totval = ++totval;
	/*alert("total val = "+totval); */}
	}
	myOption = -1;
	for (i=document.frm_survey.rdo_exaggerate_discomfort.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_exaggerate_discomfort[i].checked) {
		myOption = i;
		totval = ++totval;
	/*alert("total val = "+totval); */}
	}
	myOption = -1;
	for (i=document.frm_survey.rdo_not_serious.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_not_serious[i].checked) {
		myOption = i;
		totval = ++totval;
	/*alert("total val = "+totval); */}
	}
	myOption = -1;
	for (i=document.frm_survey.rdo_impact_on_life.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_impact_on_life[i].checked) {
		myOption = i;
		totval = ++totval;
	/*alert("total val = "+totval); */}
	}
	myOption = -1;
	for (i=document.frm_survey.rdo_always_in_mind.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_always_in_mind[i].checked) {
		myOption = i;
		totval = ++totval;
	/*alert("total val = "+totval); */}
	}
	

if (totval<40) {
input_box=confirm("You are about to submit a survey with blank entries. Click ‘OK’ to submit, ‘Cancel’ to go back to our survey");
if (input_box==true)

{ 
  	objForm = window.document.frm_survey;
	objForm.method = "POST";	
	objForm.submit();
}

else
{

}

}
 if(totval>40){
/*alert("Redirect to competition");*/
	/*if (totval<40) {
	alert("Some Questions are Blank"); }
	else
	{ alert("All Questions answered"); }*/
   
 objForm = window.document.frm_survey;
	objForm.method = "POST";	
	objForm.submit();

}




}





function validate()
{
		
	myOption = -1;
	for (i=document.frm_survey.rdo_IBS_suspect.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_IBS_suspect[i].checked) {
		myOption = i;
	
	}
	
	}
	if (myOption == -1) {
		alert('Please choose option  Do you suffer from abdominal pain associated with Irritable Bowel Syndrome (IBS)?');
		window.location="ibs_survey.asp#1";
		/*document.frm_survey.rdo_IBS_suspect[0].focus();*/
		/*document.frm_survey.rdo_age.setAttribute("checked",true);*/
		return false; }
/*else if (myOption != 0) {
		alert(myOption);
		alert('Skip All questins and go to 15th question');
		document.frm_survey.chk_feel_stressed[0].focus();
		return false; 
	
	}*/
	

	
	if (!validcheck) {
	

	myOption = -1;
	for (i=document.frm_survey.rdo_age.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_age[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option How old are you?');
		/*document.frm_survey.rdo_age[0].focus();*/
		window.location="ibs_survey.asp#2";
		return false; 
	}




	myOption = -1;
	for (i=document.frm_survey.rdo_suspect.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_suspect[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose How long have you suffered from IBS?');
		/*document.frm_survey.rdo_suspect[0].focus();*/
		window.location="ibs_survey.asp#3";
		return false; 
	}


if ( document.frm_survey.chk_diagnosed_GP.checked== false && document.frm_survey.chk_notdiagnosed_GP.checked== false  &&  document.frm_survey.chk_visited_pharmacist.checked== false && document.frm_survey.chk_notdiscussed.checked== false  )
	{
		alert('Please choose option Have you been diagnosed with IBS by a GP or Pharmacist?');
		/*document.frm_survey.chk_diagnosed_GP.focus();*/
		window.location="ibs_survey.asp#4";
		return false; 
	}


myOption = -1;
	for (i=document.frm_survey.rdo_frequency.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_frequency[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose How frequently do you suffer from abdominal pain?');
		document.frm_survey.rdo_frequency[0].focus();
		window.location="ibs_survey.asp#5";
		return false; 
	}
	
	if ( document.frm_survey.chk_Social_life.checked== false && document.frm_survey.chk_job.checked== false  &&  document.frm_survey.chk_personalrel.checked== false && document.frm_survey.chk_travel.checked== false && document.frm_survey.chk_all_aspect.checked== false  && document.frm_survey.chk_no_impact.checked== false && document.frm_survey.chk_other_aspect.checked== false )
	{
		alert('Please choose option What aspects of your life does the pain associated with IBS impact the most?');
		/*document.frm_survey.chk_Social_life.focus();*/
		window.location="ibs_survey.asp#6";
		return false; 
	}


if ( document.frm_survey.chk_partner.checked == false && document.frm_survey.chk_immdt_family.checked == false && document.frm_survey.chk_other_relative.checked == false && document.frm_survey.chk_friends.checked == false && document.frm_survey.chk_work_colleagues.checked == false & document.frm_survey.chk_employer.checked == false)
	{
		alert('Please choose option Which of the following groups know about the impact of IBS pain on your life?');
		/*document.frm_survey.chk_partner.focus();*/
		window.location="ibs_survey.asp#7";
		return false; 
	}

myOption = -1;
	for (i=document.frm_survey.rdo_periodpain.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_periodpain[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option Thinking about different types of pain,select your preference of pain from period pain');
		/*document.frm_survey.rdo_periodpain[0].focus();*/
		window.location="ibs_survey.asp#8";
		return false; 
	}
myOption = -1;
	for (i=document.frm_survey.rdo_backpain.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_backpain[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option Thinking about different types of pain,select your preference of pain from back pain');
		/*document.frm_survey.rdo_backpain[0].focus();*/
		window.location="ibs_survey.asp#8";
		return false; 
	}

myOption = -1;
	for (i=document.frm_survey.rdo_childbirth.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_childbirth[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option Thinking about different types of pain,select your preference of pain from  child birth');
		/*document.frm_survey.rdo_childbirth[0].focus();*/
		window.location="ibs_survey.asp#8";
		return false; 
	}


myOption = -1;
	for (i=document.frm_survey.rdo_headache.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_headache[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option Thinking about different types of pain,select your preference of pain from headache');
		/*document.frm_survey.rdo_headache[0].focus();*/
		window.location="ibs_survey.asp#8";
		return false; 
	}
	

	
	myOption = -1;
	for (i=document.frm_survey.rdo_indigestion.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_indigestion[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option Thinking about different types of pain,select your preference of pain from indigestion');
		/*document.frm_survey.rdo_indigestion[0].focus();*/
		window.location="ibs_survey.asp#8";
		return false; 
	}
	
	myOption = -1;
	for (i=document.frm_survey.rdo_migraine.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_migraine[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option Thinking about different types of pain,select your preference of pain from migraine');
		/*document.frm_survey.rdo_migraine[0].focus();*/
		window.location="ibs_survey.asp#8";
		return false; 
	}



	if (document.frm_survey.txt_note1.value=="")	{
		alert('Please choose option What words would you use to describe your abdominal pain associated with IBS (e.g. cramping)? Please provide up to three different words. ');
		/*document.frm_survey.txt_note1.focus();*/
		window.location="ibs_survey.asp#9";
		return false; 
	}

if (document.frm_survey.txt_note2.value=="")	
	{
	alert('Please choose option What words would you use to describe your abdominal pain associated with IBS (e.g. cramping)? Please provide Second word ');
		/*document.frm_survey.txt_note2.focus();*/
		window.location="ibs_survey.asp#9";
		return false; 
	}


if (document.frm_survey.txt_note3.value=="")	
	{
	alert('Please choose option What words would you use to describe your abdominal pain associated with IBS (e.g. cramping)? Please provide third word');
		/*document.frm_survey.txt_note3.focus();*/
		window.location="ibs_survey.asp#9";
		return false; 
	}

if (document.frm_survey.txt_causenote.value=="")	
	{
	alert('Please choose option What do you understand to be the cause of abdominal pain associated with IBS?');
	/*	document.frm_survey.txt_causenote.focus();*/
	window.location="ibs_survey.asp#10";
		return false; 
	}




if ( document.frm_survey.chk_medical_treatment.checked == false && document.frm_survey.chk_diet_modification.checked == false && document.frm_survey.chk_exercise.checked == false && document.frm_survey.chk_alt_therapy.checked == false && document.frm_survey.chk_de_stressing.checked == false )
	{
		alert('Please choose option What do you find to be most effective in relieving abdominal pain?');
		/*document.frm_survey.chk_medical_treatment.focus();*/
		window.location="ibs_survey.asp#11";
		return false; 
	}

if ( document.frm_survey.chk_naturally_derived_product.checked == false && document.frm_survey.chk_clnically_proven_product.checked == false && document.frm_survey.chk_cause_of_pain.checked == false && document.frm_survey.chk_non_medical.checked == false && document.frm_survey.chk_prescription.checked == false && document.frm_survey.chk_known_treatment.checked == false && document.frm_survey.chk_treatment_other.checked == false)
	{
		alert('Please choose option What do you look for from a treatment?');
		/*document.frm_survey.chk_naturally_derived_product.focus();*/
		window.location="ibs_survey.asp#12";
		return false; 
	}

myOption = -1;
	for (i=document.frm_survey.rdo_effect_mylife.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_effect_mylife[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option Abdominal pain associated with IBS doesn’t affect my everyday life');
		/*document.frm_survey.rdo_effect_mylife[0].focus();*/
		window.location="ibs_survey.asp#13";
		return false; 
	}

myOption = -1;
	for (i=document.frm_survey.rdo_worst_symptom.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_worst_symptom[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option Abdominal pain is the worst symptom of IBS');
/*		document.frm_survey.rdo_worst_symptom[0].focus();*/
		window.location="ibs_survey.asp#13";
		return false; 
	}

myOption = -1;
	for (i=document.frm_survey.rdo_easy_to_control.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_easy_to_control[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option Abdominal pain associated with IBS is easy to control');
		/*document.frm_survey.rdo_easy_to_control[0].focus();*/
		window.location="ibs_survey.asp#13";
		return false; 
	}

myOption = -1;
	for (i=document.frm_survey.rdo_frustration.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_frustration[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option Abdominal pain associated with IBS frequently causes me frustration');
		/*document.frm_survey.rdo_frustration[0].focus();*/
		window.location="ibs_survey.asp#13";
		return false; 
	}

myOption = -1;
	for (i=document.frm_survey.rdo_predict.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_predict[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option I can predict when I will experience abdominal pain associated with IBS');
/*		document.frm_survey.rdo_predict[0].focus();*/
		window.location="ibs_survey.asp#13";
		return false; 
	}

myOption = -1;
	for (i=document.frm_survey.rdo_childbirth_pain.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_childbirth_pain[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option I imagine/believe abdominal pain associated with IBS could be worse than childbirth');
		/*document.frm_survey.rdo_childbirth_pain[0].focus();*/
		window.location="ibs_survey.asp#13";
		return false; 
	}
	
if ( document.frm_survey.chk_nopain_you.checked == false && document.frm_survey.chk_nopain_family.checked == false && document.frm_survey.chk_nopain_doctor.checked == false && document.frm_survey.chk_nopain_other.checked == false )
	{
		alert('Please choose option IBS is not associated with pain');
		/*document.frm_survey.chk_nopain_you.focus();*/
		window.location="ibs_survey.asp#14";
		return false; 
	}
	
if ( document.frm_survey.chk_pain_you.checked == false && document.frm_survey.chk_pain_family.checked == false && document.frm_survey.chk_pain_doctor.checked == false && document.frm_survey.chk_pain_other.checked == false )
	{
		alert('Please choose option IBS is associated with severe pain');
		/*document.frm_survey.chk_pain_you.focus();*/
		window.location="ibs_survey.asp#14";
		return false; 
	}
	
if ( document.frm_survey.chk_trivial_you.checked == false && document.frm_survey.chk_trivial_family.checked == false && document.frm_survey.chk_trivial_doctor.checked == false && document.frm_survey.chk_trivial_other.checked == false )
	{
		alert('Please choose option IBS is a trivial condition');
		/*document.frm_survey.chk_trivial_you.focus();*/
		window.location="ibs_survey.asp#14";
		return false; 
	}	
if ( document.frm_survey.chk_discomfort_you.checked == false && document.frm_survey.chk_discomfort_family.checked == false && document.frm_survey.chk_discomfort_doctor.checked == false && document.frm_survey.chk_discomfort_other.checked == false )
	{
		alert('Please choose option People with IBS often exaggerate their  discomfort');
		/*document.frm_survey.chk_discomfort_you.focus();*/
		window.location="ibs_survey.asp#14";
		return false; 
	}		
	
if ( document.frm_survey.chk_serious_you.checked == false && document.frm_survey.chk_serious_family.checked == false && document.frm_survey.chk_serious_doctor.checked == false && document.frm_survey.chk_serious_other.checked == false )
	{
		alert('Please choose option People with IBS is not taken seriously enough');
		/*document.frm_survey.chk_serious_you.focus();*/
		window.location="ibs_survey.asp#14";
		return false; 
	}		
		
if ( document.frm_survey.chk_impact_you.checked == false && document.frm_survey.chk_impact_family.checked == false && document.frm_survey.chk_impact_doctor.checked == false && document.frm_survey.chk_impact_other.checked == false )
	{
		alert('Please choose option People generally do not appreciate the extent to which IBS can impact everyday life ');
		/*document.frm_survey.chk_impact_you.focus();*/
		window.location="ibs_survey.asp#14";
		return false; 
	}		
			
	
if ( document.frm_survey.chk_in_mind_you.checked == false && document.frm_survey.chk_in_mind_family.checked == false && document.frm_survey.chk_in_mind_doctor.checked == false && document.frm_survey.chk_in_mind_other.checked == false )
	{
		alert('Please choose option IBS is all in the mind');
		/*document.frm_survey.chk_in_mind_you.focus();*/
		window.location="ibs_survey.asp#14";
		return false; 
	}	

	
if ( document.frm_survey.chk_feel_stressed.checked == false && document.frm_survey.chk_laid_back.checked == false && document.frm_survey.chk_busy_life.checked == false && document.frm_survey.chk_my_stride.checked == false && document.frm_survey.chk_ambitious_person.checked == false && document.frm_survey.chk_best_at.checked == false && document.frm_survey.chk_half_glass.checked == false && document.frm_survey.chk_half_full.checked == false && document.frm_survey.chk_get_anxious.checked == false && document.frm_survey.chk_worry_things.checked == false && document.frm_survey.chk_getting_worse.checked == false && document.frm_survey.chk_forced_stop.checked == false)
	{
		alert('Please choose option Please read the statements and tick all that apply to you');
		
		window.location="ibs_survey.asp#15";
		return false; 
	}		
} // validcheck = 1	

myOption = -1;
	for (i=document.frm_survey.rdo_IBS_suffer.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_IBS_suffer[i].checked) {
		myOption = i;
	
	}
	}
	if (myOption == -1) {
		alert('Please choose option  Do you know anyone who suffers from IBS? ');
		window.location="ibs_survey.asp#18";
		return false; 
	}
	

	myOption = -1;
	for (i=document.frm_survey.rdo_no_pain.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_no_pain[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option IBS is not associated with pain');
		document.frm_survey.rdo_no_pain[0].focus();
		window.location="ibs_survey.asp#18";
		return false; 
	}
	myOption = -1;
	for (i=document.frm_survey.rdo_severe_pain.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_severe_pain[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option IBS is associated with severe pain');
		window.location="ibs_survey.asp#18";
		return false; 
	}
	myOption = -1;
	for (i=document.frm_survey.rdo_trivial_condition.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_trivial_condition[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option IBS is a trivial condition');
		/*document.frm_survey.rdo_trivial_condition[0].focus();*/
		window.location="ibs_survey.asp#18";
		return false; 
	}
	myOption = -1;
	for (i=document.frm_survey.rdo_exaggerate_discomfort.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_exaggerate_discomfort[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option People with IBS often exaggerate their discomfort');
		/*document.frm_survey.rdo_exaggerate_discomfort[0].focus();*/
		window.location="ibs_survey.asp#18";
		return false; 
	}
	myOption = -1;
	for (i=document.frm_survey.rdo_not_serious.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_not_serious[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option IBS is not taken seriously enough');
		/*document.frm_survey.rdo_not_serious[0].focus();*/
		window.location="ibs_survey.asp#18";
		return false; 
	}
	myOption = -1;
	for (i=document.frm_survey.rdo_impact_on_life.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_impact_on_life[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option People generally do not appreciate the extent to which IBS can impact everyday life');
		/*document.frm_survey.rdo_impact_on_life[0].focus();*/
		window.location="ibs_survey.asp#18";
		return false; 
	}
	myOption = -1;
	for (i=document.frm_survey.rdo_always_in_mind.length-1; i > -1; i--) {
	if (document.frm_survey.rdo_always_in_mind[i].checked) {
		myOption = i;
	}
	}
	if (myOption == -1) {
		alert('Please choose option BS is `all in the mind`');
		/*document.frm_survey.rdo_always_in_mind[0].focus();*/
		window.location="ibs_survey.asp#18";
		return false; 
	}
	
	objForm = window.document.frm_survey;
	objForm.method = "POST";	
	objForm.submit();
}



function validate_cons_survey()
{
	
	var totval=0;
	var stat = 0;
	myOption = -1;
	for (i=document.frm_consumer_survey.rdo_gender.length-1; i > -1; i--) {
	if (document.frm_consumer_survey.rdo_gender[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}
	
	myOption = -1;
	for (i=document.frm_consumer_survey.rdo_IBS_suspect.length-1; i > -1; i--) {
	if (document.frm_consumer_survey.rdo_IBS_suspect[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}
	
	myOption = -1;
	for (i=document.frm_consumer_survey.rdo_mconfirm.length-1; i > -1; i--) {
	if (document.frm_consumer_survey.rdo_mconfirm[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}
	myOption = -1;
	for (i=document.frm_consumer_survey.rdo_age.length-1; i > -1; i--) {
	if (document.frm_consumer_survey.rdo_age[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}
	myOption = -1;
	for (i=document.frm_consumer_survey.rdo_region.length-1; i > -1; i--) {
	if (document.frm_consumer_survey.rdo_region[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}
	
	myOption = -1
	if (document.frm_consumer_survey.text_town.value != "" )
	{
		myOption = i;
		totval = ++totval;
	}
	myOption = -1;
	for (i=document.frm_consumer_survey.rdo_industry.length-1; i > -1; i--) {
	if (document.frm_consumer_survey.rdo_industry[i].checked) {
		myOption = i;
		totval = ++totval;
		if (document.frm_consumer_survey.rdo_industry[i].value == 1)
		{
			if(document.frm_consumer_survey.text_industry.value =="")
			{
				//alert("Please enter the other industry sector");
				stat = 1;
			}
		}
	}
	}
	myOption = -1;
	for (i=document.frm_consumer_survey.rdo_marital_status.length-1; i > -1; i--) {
	if (document.frm_consumer_survey.rdo_marital_status[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}
	myOption = -1;
	for (i=document.frm_consumer_survey.rdo_knw_partner.length-1; i > -1; i--) {
	if (document.frm_consumer_survey.rdo_knw_partner[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}
	
	
	myOption = -1;
	for (i=document.frm_consumer_survey.rdo_rel_ability.length-1; i > -1; i--) {
	if (document.frm_consumer_survey.rdo_rel_ability[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}
	myOption = -1;
	for (i=document.frm_consumer_survey.rdo_unattractive.length-1; i > -1; i--) {
	if (document.frm_consumer_survey.rdo_unattractive[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}
	myOption = -1;
	for (i=document.frm_consumer_survey.rdo_clothes.length-1; i > -1; i--) {
	if (document.frm_consumer_survey.rdo_clothes[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}
	myOption = -1;
	for (i=document.frm_consumer_survey.rdo_self_conf.length-1; i > -1; i--) {
	if (document.frm_consumer_survey.rdo_self_conf[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}
	myOption = -1;
	for (i=document.frm_consumer_survey.rdo_lonely_condn.length-1; i > -1; i--) {
	if (document.frm_consumer_survey.rdo_lonely_condn[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}
	myOption = -1;
	for (i=document.frm_consumer_survey.rdo_food.length-1; i > -1; i--) {
	if (document.frm_consumer_survey.rdo_food[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}
	
	myOption = -1;
	for (i=document.frm_consumer_survey.rdo_cancel_date.length-1; i > -1; i--) {
	if (document.frm_consumer_survey.rdo_cancel_date[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}
	myOption = -1;
	for (i=document.frm_consumer_survey.rdo_end_rel.length-1; i > -1; i--) {
	if (document.frm_consumer_survey.rdo_end_rel[i].checked) {
		myOption = i;
		totval = ++totval;
		}
	}
	myOption = -1;
	for (i=document.frm_consumer_survey.rdo_symptom.length-1; i > -1; i--) {
	if (document.frm_consumer_survey.rdo_symptom[i].checked) {
		myOption = i;
		totval = ++totval;
		if (document.frm_consumer_survey.rdo_symptom[i].value == 1)
		{
			if (document.frm_consumer_survey.text_symptom_other.value == "")
			{
					//alert("Please enter the symptoms of IBS");
					stat = 1;
			}
		}
	}
	}
	
	if (stat==1)
	{
		alert("Please enter the Other values");
	}
	else
	{
	//alert(totval);
		if (totval<18) {
	input_box=confirm("You have submitted the survey without completing some of the questions.  Do you want to proceed?");
			if (input_box==true)
		
			{ 
				objForm = window.document.frm_consumer_survey;
				objForm.method = "POST";	
				objForm.submit();
			}
			
			else
			{
			
			}
	
		}
		 if(totval>=18 & stat!=1){
		/*alert("Redirect to competition");*/
			/*if (totval<40) {
			alert("Some Questions are Blank"); }
			else
			{ alert("All Questions answered"); }*/
		   
		 objForm = window.document.frm_consumer_survey;
			objForm.method = "POST";	
			objForm.submit();
		
			}
	}
}


function addToFavorites() 
{ 
	titleElement = document.getElementsByTagName('title')[0];
	var urlAddres = window.location.href;
	titlevalue=titleElement.innerHTML;
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(titlevalue, urlAddres,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( urlAddres, titlevalue); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }

} 

