// Begin to call the information from the form page
function getParams() {
var idx = document.URL.indexOf('?');
var params = new Array();
if (idx != -1) {
var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
for (var i=0; i<pairs.length; i++) {
nameVal = pairs[i].split('=');
params[nameVal[0]] = nameVal[1];
   }
}
return params;
}
params = getParams();

//  End -->

firstname = unescape(params["firstname"]);
lastname = unescape(params["lastname"]);
age = unescape(params["age"]);
visitedThailand = unescape(params["visitedThailand"]);
// about the sponsor working
cf_field_5 = unescape(params["cf_field_5"]); sponsorWork = cf_field_5;// cf_field_5 = Client input Does the sponsor work
cf7_field_2 = unescape(params["cf7_field_2"]); // this is the trial form
cf7_field_3 = unescape(params["cf7_field_3"]); // this is the trial form
cf7_field_4 = unescape(params["cf7_field_4"]); // this is the trial form
cf7_field_5 = unescape(params["cf7_field_5"]); // this is the trial form
cf9_field_1 = unescape(params["cf9_field_1"]); 
cf9_field_2 = unescape(params["cf9_field_2"]); myVar = cf9_field_2;
yourName = unescape(params["yourName"]);
number = unescape(params["number"]);
colour = unescape(params["colour"]);
message = unescape(params["message"]);

cf7_field_2 = 'trial again with field2 input in the js file';

if (sponsorWork == 'Sponsor+receives+state+pension')
		{
		 sponsorWork = 'As you only recieve a state pension with no other income, the only visa available will be a Tourist Visa. ';		
		}
		else
		{
		sponsorWork = 'Not state pension';
		}
		
// about the sponsor visiting thailand
cf_field_23 = unescape(params["cf_field_23"]); visitedThailand = cf_field_23;// cf_field_23 = Client input Visited partner in Thailand

if (cf_field_23 <= 0)	
		{
		 visitedThailand = 'The immigration department will never issue the visa until you and your partner have met in person. For this reason, you will need to travel to Thailand to visit your partner. ';		
		}

		else
		{

			if (visitedThailand == 1)
			{
			visitedThailand = 'As you have only visited Thailand once, you will have to visited Thailand again prior to the final visa applicaiton being made.'
			}
			}
	// end of visit thailand


	
visaAnswer = 'Hi ' + firstname + '. ' +'<BR>' + visitedThailand + '.' + sponsorWork;
