function formSubmitInsure(which){
	document.thisForm.what.value = which;
	document.thisForm.submit();
}

gFlag = false;
function formSubmit(which){
	if (which == "check") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "record") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "recordNow") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "consult") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "agentdisplay") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "airdisplay") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "airlinedisplay") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "tourdisplay") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "cardisplay") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "traveldisplay") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "hoteldisplay") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "ferrydisplay") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "fcodisplay") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "display") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "buy") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "clearBasket") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "make") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if(which=="register"){
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else{
	if(which=="logoff"){
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else{	
	if (which == "new") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "list") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if (which == "finish") {
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else {
	if(checkRadio()){
		document.thisForm.what.value = which;
		document.thisForm.submit();
	}else{
		alert("Please select an item");
		gFlag = false;
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
	}
}
function checkRadio(){
var count = 0;
	for(var i = 0; i <= (document.thisForm.elements.length - 1); i++){
		if(document.thisForm.elements[i].checked){
			count++;
			if(count < 1){
				gFlag = false;
				}else{
				gFlag = true;
				}
		}
	}
	return gFlag;
}
function formFocusFeedback(){
	document.myForm.feedback.focus();
}
function goDown(){
	document.thisForm.button3.focus();
}
function selectContact(which){
	document.thisForm.what.value = "display";
	document.thisForm.ContactChoice.value = which;
	document.thisForm.submit();
}
function formFocusTS(){
	document.myForm.question.focus();
}

function listAreas(){
	alert("Albania, Andorra, Armenia, Austria, Azerbaijan, Belarus, Belgium, Bosnia-Herzegovina, Bulgaria, Croatia, Cyprus, Czech Republic, Denmark (including Faeroe Islands), Egypt, Estonia, Finland, France (including Corsica), Georgia, Germany, Gibraltar, Greece (including Greek Isles), Hungary, Iceland, Ireland, Italy (including Aeolian Islands, Sardinia, Sicily), Latvia, Liechtenstein, Lithuania, Luxembourg, Macedonia, Malta, Moldova, Monaco, Morrocco, Netherlands, Norway (including Jan Mayen, Svalbard Is), Poland, Portugal (including Azores, Madeira Islands), Romania, Russia (European), San Marino, Serbia/Montenegro (including Kosovo), Slovakia, Slovenia, Spain (including Balearic Islands, Canary Islands), Sweden, Switzerland, Tunisia, Turkey, UK Area, Ukraine, and Vatican City");
}

function listMondialAreas(){
	alert("Albania, Andorra, Armenia, Austria, Azerbaijan, Belarus, Belgium, Bosnia-Herzegovina, Bulgaria, Croatia, Cyprus, Czech Republic, Denmark (including Faeroe Islands), Egypt, Estonia, Finland, France (including Corsica), Georgia, Germany, Gibraltar, Greece (including Greek Isles), Hungary, Iceland, Ireland, Italy (including Aeolian Islands, Sardinia, Sicily), Latvia, Liechtenstein, Lithuania, Luxembourg, Macedonia, Malta, Moldova, Monaco, Morrocco, Netherlands, Norway (including Jan Mayen, Svalbard Is), Poland, Portugal (including Azores, Madeira Islands), Romania, Russia (European), San Marino, Serbia/Montenegro (including Kosovo), Slovakia, Slovenia, Spain (including Balearic Islands, Canary Islands), Sweden, Switzerland, Tunisia, Turkey, UK Area, Ukraine, and Vatican City");
}

function listPTIAreas(){
	alert("Albania, Andorra, Armenia, Austria, Azerbaijan, Belarus, Belgium, Bosnia-Herzegovina, Bulgaria, Croatia, Cyprus, Czech Republic, Denmark (including Faeroe Islands), Egypt, Estonia, Finland, France (including Corsica), Georgia, Germany, Gibraltar, Greece (including Greek Isles), Hungary, Iceland, Ireland, Italy (including Aeolian Islands, Sardinia, Sicily), Latvia, Liechtenstein, Lithuania, Luxembourg, Macedonia, Malta, Moldova, Monaco, Morrocco, Netherlands, Norway (including Jan Mayen, Svalbard Is), Poland, Portugal (including Azores, Madeira Islands), Romania, Russia (European), San Marino, Serbia/Montenegro (including Kosovo), Slovakia, Slovenia, Spain (including Balearic Islands, Canary Islands), Sweden, Switzerland, Tunisia, Turkey, UK Area, Ukraine, and Vatican City");
}

function formFocus(){
	document.myForm.Area.focus();
					}

function formFocus0(){
	document.thisForm.Login_name.focus();
					}

function formFocus1(){
	document.thisForm.elements[1].focus();
					}

function formFocusHere(here){
	document.thisForm.elements[here].focus();
					}

function checkFormInsNewmulti()
{
	if(checkMainFields(3, 4, "the name of insured person") && checkMainFields(11, 12, "your e-mail address") && checkMainFields(12, 13, "the policy start date") && checkMainFields(13, 14, "the month of departure") && checkMainFields(14, 15, "the year of departure") && checkMainFields(15, 16, "the period of cover required")){
		document.myForm.submit();
											}
					}
function checkFormInsNew()
{
	if(checkMainFields(2, 3, "the name of insured person") && checkMainFields(10, 11, "your e-mail address") && checkMainFields(11, 12, "the policy start date") && checkMainFields(12, 13, "the month of departure") && checkMainFields(13, 14, "the year of departure") && checkMainFields(14, 15, "the period of cover required")){
		document.myForm.submit();
											}
					}
function checkFormIns()
{
	if(checkMainFields(2, 3, "the name of insured person") && checkMainFields(4, 5, "your e-mail address") && checkMainFields(5, 6, "the policy start date") && checkMainFields(5, 6, "the month of departure") && checkMainFields(6, 7, "the year of departure") && checkMainFields(8, 9, "the period of cover required")){
		document.myForm.submit();
											}
					}
function checkFormInsSingleBargain()
{
	if(checkMainFields(2, 3, "the name of insured person") && checkMainFields(3, 4, "your e-mail address") && checkMainFields(4, 5, "the policy start date") && checkMainFields(5, 6, "the month of departure") && checkMainFields(6, 7, "the year of departure") && checkMainFields(7, 8, "the period of cover required")){
		document.myForm.submit();
											}
					}
function checkFormInsSingleWinter()
{
	if(checkMainFields(2, 3, "the name of insured person") && checkMainFields(12, 13, "your e-mail address") && checkMainFields(13, 14, "the policy start date") && checkMainFields(14, 15, "the month of departure") && checkMainFields(15, 16, "the year of departure") && checkMainFields(16, 17, "the period of cover required")){
		document.myForm.submit();
											}
					}
function checkFormInsSingleIndiv()
{
	if(checkMainFields(2, 3, "the name of insured person") && checkMainFields(12, 13, "your e-mail address") && checkMainFields(13, 14, "the policy start date") && checkMainFields(14, 15, "the month of departure") && checkMainFields(15, 16, "the year of departure") && checkMainFields(16, 17, "the period of cover required")){
		document.myForm.submit();
											}
					}
function checkFormInsSingleFamily()
{
	if(checkMainFields(2, 3, "the name of insured person") && checkMainFields(12, 13, "your e-mail address") && checkMainFields(13, 14, "the policy start date") && checkMainFields(14, 15, "the month of departure") && checkMainFields(15, 16, "the year of departure") && checkMainFields(16, 17, "the period of cover required")){
		document.myForm.submit();
											}
					}
function checkFormInsAnnual()
{
	if(checkMainFields(2, 3, "the name of insured person") && checkMainFields(10, 11, "your e-mail address") && checkMainFields(11, 12, "the policy start date") && checkMainFields(12, 13, "the month of departure") && checkMainFields(13, 14, "the year of departure") && checkMainFields(16, 17, "the period of cover required")){
		document.myForm.submit();
											}
					}
function checkForm(){
	if(checkMainFields(0, 1, "your question") && checkMainFields(1, 2, "your reply e-mail address")){
	document.myForm.submit();
	}
}
function checkFormAppoint(){
	if(checkFieldsAppoint(1, 2, "your name") && checkFieldsAppoint(2, 3, "your e-mail address") && checkFieldsAppoint(3, 4, "your departure day") && checkFieldsAppoint(4, 5, "your departure month") && checkFieldsAppoint(5, 6, "your departure year") && checkFieldsAppoint(8, 9, "your local clinic")){
	document.thisForm.what.value = "make";
	document.thisForm.submit();
	}
}

function checkFieldsAppoint(start, finish, q){
	var stop = finish;
	stop--;
	for(i=start;i<finish;i++)
	{
		if(document.thisForm.elements[i].value == "")
		{
			alert("Please complete " + q);
			document.thisForm.elements[i].focus();
			break;
		}else if(i >= stop){
			return true;
		}
	}
}

function checkMainFields(start, finish, q){
	var stop = finish;
	stop--;
	for(i=start;i<finish;i++)
	{
		if(document.myForm.elements[i].value == "")
		{
			alert("Please complete " + q);
			document.myForm.elements[i].focus();
			break;
		}else if(i >= stop){
			return true;
		}
	}
}

function checkFormFit(){
	if(checkFieldsFit(1, 3, "digestive system") && checkFieldsFit(3, 5, "heart problems") && checkFieldsFit(5, 7, "psychiatric disorders") && checkFieldsFit(7, 9, "breathing difficulties") && checkFieldsFit(9, 11, "cancer") && checkFieldsFit(11, 13, "brain or nervous system") && checkFieldsFit(13, 15, "endocrine system") && checkFieldsFit(15, 17, "skin") && checkFieldsFit(17, 19, "bones and joints") && checkFieldsFit(19, 21, "other problems") && checkFieldsFit(21, 23, "operation") && checkFieldsFit(23, 25, "medication")){
	document.thisForm.what.value = "check";
	document.thisForm.submit();
	}
}

function checkFormName(){
	if(checkFieldsName(1, 2, "title") && checkFieldsName(2, 3, "first name") && checkFieldsName(3, 4, "family name") && checkFieldsName(4, 5, "e-mail address")){
	document.thisForm.what.value = "recordNow";
	document.thisForm.submit();
}
}					

function checkFieldsName(start, finish, q){
	var stop = finish;
	stop--;
	for(i=start;i<finish;i++)
	{
		if(document.thisForm.elements[i].value == "")
		{
			alert("Please complete " + q);
			document.thisForm.elements[i].focus();
			break;
		}else if(i >= stop){
			return true;
		}
	}
}

function checkFieldsFit(start, finish, q){
var stop = finish;
stop--;
var j = 0
	for(i=start;i<finish;i++)
	{
		if(document.thisForm.elements[i].checked)
		{
			return true;
		}else if(i >= stop){
			alert("Please complete " + q + " question");
			document.thisForm.elements[i].focus();
			return false;
		}
		j++;
	}
}

function goMore(which){
	document.thisForm.whatStory.value = which;
	document.thisForm.what.value = "more";
	document.thisForm.submit();
}

function LoginCookie(){
	cookie = GetCookie("loginCookie");
	if(!cookie){
		alert ("You must login before entering the consultation area.");
		document.myForm.submit();
			   }
					  }
function GetCookie(name){
	var result = null;
	var myCookie = " " + document.cookie + ";";
	var searchName = " " + name + "=";
	var startOfCookie = myCookie.indexOf(searchName)
	var endOfCookie;
	if (startOfCookie != -1){
		startOfCookie += searchName.length;
		endOfCookie = myCookie.indexOf(";", startOfCookie);
		result = unescape(myCookie.substring(startOfCookie,endOfCookie));
		                    }
	return result;
                         }
	function additem(itemname,quantity,price,tax){
		itemtoadd=itemname + "," + quantity + "," + price + "," + tax
		alert("Item added to basket:\n" + quantity + " x " + itemname)
		document.thisForm.item_added.value = itemtoadd;
		document.thisForm.what.value = "item";
		document.thisForm.submit();
}
	function addMalaria(itemname,quantity,price,tax){
		itemtoadd=itemname + "," + quantity + "," + price + "," + tax
		document.thisForm.item_added.value = itemtoadd;
		document.thisForm.what.value = "malaria";
		document.thisForm.submit();
}
	function further_asthma(){
	asthma_control = (prompt("Is your asthma well controlled? Yes or No",""))
	document.thisForm.asthma_control.value = asthma_control;
}
	function further_copd(){
	copd_control = (prompt("Is your bronchitis well controlled? Yes or No",""))
	document.thisForm.copd_control.value = copd_control;
	document.thisForm.q_respiratory.focus();
}
	function further_angina(){
	angina_control = (prompt("Is your angina well controlled? Yes or No",""))
	document.thisForm.angina_control.value = angina_control;
}
	function further_bp(){
	bp_control = (prompt("Is your blood pressure well controlled? Yes or No",""))
	document.thisForm.bp_control.value = bp_control;
}
	function further_diabetes(){
	diabetes_control = (prompt("Is your diabetes well controlled? Yes or No",""))
	document.thisForm.diabetes_control.value = diabetes_control;
	document.thisForm.q_endocrine.focus();
}
	function further_eczema(){
	eczema_control = (prompt("Is your eczema well controlled? Yes or No",""))
	document.thisForm.eczema_control.value = eczema_control;
}
	function further_psoriasis(){
	psoriasis_control = (prompt("Is your psoriasis well controlled? Yes or No",""))
	document.thisForm.psoriasis_control.value = psoriasis_control;
	document.thisForm.q_skin.focus();
}
	function further_epilepsy(){
	epilepsy_control = (prompt("Is your epilepsy well controlled? Yes or No",""))
	document.thisForm.epilepsy_control.value = epilepsy_control;
	document.thisForm.q_cns.focus();
}
	function further_arthritis(){
	arthritis_control = (prompt("Is your arthritis well controlled? Yes or No",""))
	document.thisForm.arthritis_control.value = arthritis_control;
	document.thisForm.q_musculo.focus();
}