function emailIt()
{

if ((document.getElementById('yourName').value == '') || (document.getElementById('friendName').value == '') || (document.getElementById('email').value == ''))
{
document.getElementById('successfulEmail').style.color = '#D2433F';
document.getElementById('successfulEmail').innerHTML = 'Please fill out all the fields';
return;
}


var t1 = document.getElementById('tab');
var tabLength = parseInt(t1.rows.length);
var myEmailArray = new Array();
var preCosts, currencyType, box1, luxury, drinker, eater, shopper, numDests, activities, GrandTotal, leavingDate, returnDate, tripLength, yourName, friendName, email;
var x = 1;
sendMailString = '';
for (x=1;x<tabLength;x++)
{
myEmailArray[x] = new Array();
myEmailArray[x][1] = t1.rows[x].cells[1].firstChild.nodeValue;
myEmailArray[x][2] = t1.rows[x].cells[3].firstChild.nodeValue;
myEmailArray[x][3] = document.getElementById('txtRow' + x).value;
myEmailArray[x][4] = t1.rows[x].cells[4].firstChild.nodeValue;
temp = myEmailArray[x].join('|');
length = temp.length;
temp = temp.substr(1, length);
sendMailString = sendMailString + temp + "%";
}
numDests = tabLength-1;
box1 = document.currencyForm1.currency1.selectedIndex;
box1 = document.currencyForm1.currency1.options[box1].text + "%";

currencyType = ' ' + document.getElementById('jabs2').innerHTML;
leavingDate = leavingDateString;
if (leavingDate == '')
{
leavingDate = 'Not Specified';
}

returnDate = document.getElementById('returnDate').childNodes[0].innerHTML;
if (returnDate == 'Enter a leaving date')
{
returnDate = 'Not Specified';
}

tripLength = document.getElementById('days').childNodes[0].innerHTML;

preCosts = document.getElementById('jabs').value + currencyType + "%" + document.getElementById('AirFares').value + currencyType + "%" + document.getElementById('Visas').value + currencyType + "%" + document.getElementById('Insurance').value + currencyType + "%" + document.getElementById('Tours').value + currencyType + "%" + document.getElementById('pc1').value + "%" + document.getElementById('preCreateVal1').value + currencyType + "%" + document.getElementById('pc2').value + "%" + document.getElementById('preCreateVal2').value + currencyType;

luxury = document.lifestyle.luxury.selectedIndex;
luxury = document.lifestyle.luxury.options[luxury].text + "%";

if (luxury == 'Please Select%')
{
luxury = 'Not Specified%';
}

drinker = document.lifestyle.drinker.selectedIndex;
drinker = document.lifestyle.drinker.options[drinker].text + "%";

if (drinker == 'Please Select%')
{
drinker = 'Not Specified%';
}

eater = document.lifestyle.eater.selectedIndex;
eater = document.lifestyle.eater.options[eater].text + "%";

if (eater == 'Please Select%')
{
eater = 'Not Specified%';
}

shopper = document.lifestyle.shopper.selectedIndex;
shopper = document.lifestyle.shopper.options[shopper].text + "%";

if (shopper == 'Please Select%')
{
shopper = 'Not Specified%';
}

activities = document.getElementById('zorbingText').value + " " + currencyType + "%" + document.getElementById('bungeeJunpingText').value + " " + currencyType + "%" + document.getElementById('skyDivingText').value + " " + currencyType + "%" + document.getElementById('canoeingText').value + " " + currencyType + "%" + document.getElementById('raftingText').value  + " " + currencyType + "%" + document.getElementById('cyclingText').value + " " + currencyType + "%" + document.getElementById('whaleWatchingText').value  + " " + currencyType + "%" + document.getElementById('canyoningText').value + " " + currencyType + "%" + document.getElementById('kayakingText').value + " " + currencyType + "%" + document.getElementById('surfingText').value  + " " + currencyType + "%" + document.getElementById('rockClimbingText').value + " " + currencyType + "%" + document.getElementById('divingText').value + " " + currencyType +  "%" + document.getElementById('quadBikingText').value + " " + currencyType + "%" + document.getElementById('blank1TextName').value + "%" + document.getElementById('blank1Text').value + " " + currencyType + "%" + document.getElementById('blank2TextName').value + "%" + document.getElementById('blank2Text').value + " " + currencyType +  "%" + document.getElementById('blank3TextName').value + "%" + document.getElementById('blank3Text').value + " " + currencyType +  "%";

GrandTotal = document.getElementById('GrandTotal').innerHTML;

yourName = document.getElementById('yourName').value;
friendName = document.getElementById('friendName').value;
email = document.getElementById('email').value;

sendMailString = yourName + "%" + friendName + "%" + email + "%" + leavingDate + "%" + returnDate + "%" + tripLength + "%" + box1 + preCosts + "%" + numDests + "%" + sendMailString + document.getElementById('subTotal').innerHTML + "%" + luxury + drinker + eater + shopper + activities + GrandTotal;

document.test.linkid.value = sendMailString;

//successfully vcalidated and sent email
document.getElementById('successfulEmail').style.color = '#549C38';
document.getElementById('successfulEmail').innerHTML='Email Successfully sent';

}

function addRow()
{

var a = document.getElementById('suggest1').value;
var a2 = a.search(/,/);

if (a == '' || a == 'start typing country ....')

{
alert('please enter a value');
}
else if (a2 == -1)
{
alert('Invalid destination');
}
else if (whatIsLeft == 0)
{
alert('You cannot add any more destinations');
}
else
{

document.getElementById('suggest1').value = '';


	var tbl = document.getElementById('tab');
	
	// if there's no header row in the table, then iteration = lastRow + 1
	iteration = iteration + 1;

	var row = tbl.insertRow(iteration-numRowRemoved);  
	//row.setAttribute('id', 'row' + iteration);  
	//row.setAttribute('class', 'row');

	//add to the array
	myArray.push(iteration);

	//What is left
	whatIsLeft = whatIsLeft - 1;
	document.getElementById('left').innerHTML = '<strong>' + whatIsLeft + '</strong> left to add';

 	// first cell
 	var firstCell = row.insertCell(0);
	var imgNode = document.createElement('img');
	imgNode.src = 'images/num' + (iteration-numRowRemoved) + '.gif';
	imgNode.setAttribute('onClick','dont();');
	imgNode.setAttribute('id','img' + iteration);
 	firstCell.appendChild(imgNode);


	// second cell
	var second = row.insertCell(1);
	var textNode = document.createTextNode(a);
	second.appendChild(textNode);

	// third cell
	var third = row.insertCell(2);
	var imgNode = document.createElement('img');
	imgNode.src = 'images/plus2.gif';
	imgNode.onclick = function() { add(this) };
	third.appendChild(imgNode);

	var el = document.createElement('input');
	el.type = 'text';
	el.name = 'txtRow' + iteration;
	el.id = 'txtRow' + iteration;
	el.style.marginRight = '10px';
	el.style.marginLeft = '10px'
	el.size = 3;
	el.value = 0;
	el.setAttribute('readOnly', 'true');
  
	third.appendChild(el);

	var imgNode2 = document.createElement('img');
	imgNode2.src = 'images/minus2.gif';
	imgNode2.onclick = function() { minus(this) };
	third.appendChild(imgNode2);

	var textNode = document.createTextNode('  Days');
	third.appendChild(textNode);

	//fourth cell
	var fourth = row.insertCell(3);
	fourth.setAttribute('id', 'budget' + iteration);
	fourth.setAttribute('class', 'budget');
	fourth.setAttribute('className', 'budget');
	var rowName = 'budget' + iteration;

	var val = (1/window.CurrMulti)*window.NewCurrMulti*window.f;

	myGBPPriceArray.push(window.f);

	var textNode = document.createTextNode(addCommas(val.toFixed(2)) + ' ' + window.NewCurrName);
	fourth.appendChild(textNode);

	//fifth cell
	var fifth = row.insertCell(4);
	fifth.setAttribute('id', 'total' + iteration);
	fifth.setAttribute('class', 'budget');
	fifth.setAttribute('className', 'budget');
	var rowName = 'total' + iteration;
	var textNode = document.createTextNode('0.00 ' + window.NewCurrName);
	fifth.appendChild(textNode);

	//sixth cell
	var Remove = row.insertCell(5);
	newlink = document.createElement('a');
	newlink.setAttribute('href', 'javascript:void(0);');
	newlink.onclick = function() { rem(this) };
	newlink.setAttribute('class', 'hlinkTable');
	newlink.setAttribute('className', 'hlinkTable');
	Remove.appendChild(newlink);
	tn = document.createTextNode('Remove');
	newlink.appendChild(tn);

document.getElementById('suggest1').setFocus();

}

}


function rem(t)
{
//totalTripDays
var tbl = document.getElementById('tab');
var days;
var daysAcc = 0;
var i = 0;
var p = t.parentNode.parentNode.rowIndex;
var lastRow = tbl.rows.length;
var rowIndex = 1;

numRowRemoved = numRowRemoved + 1;

tbl.deleteRow(p);

document.getElementById('GrandTotal').innerHTML = '0.00 ' + window.NewCurrName;
whatIsLeft = whatIsLeft + 1;
document.getElementById('left').innerHTML = '<strong>' + whatIsLeft + '</strong> left to add';

 
//array used to tie the row elements id to the row number. this keeps the row number and id elements together after row deletion. ie myArray[0] = txtRowid1, myArray[1] = txtRowid3, myArray[2] = txtRowid4 
myArray.splice(p-1,1);
myGBPPriceArray.splice(p-1,1);

//calculate new length of trip
var tabLength = tbl.rows.length;
tabLength = tabLength-1;

while (i<tabLength)
		{
				
		days = 'txtRow' + myArray[i]; 
		daysAcc = daysAcc + parseInt(document.getElementById(days).value);
		i++;
		}

totalTripDays = daysAcc;
document.getElementById('days').innerHTML = '<strong>' + totalTripDays + ' Day(s)</strong>';
daysToDateMinus();


findSubTotal();
//deals with the line numbering images when the rows are removed
while (rowIndex<=lastRow)

{

var temp2 = rowIndex-1;
var temp = 'img' + myArray[temp2];
var r = document.getElementById(temp);
r.src = 'images/num' + rowIndex + '.gif';

rowIndex++;

}

}


function findSubTotal()
{

var table = document.getElementById('tab');
var tabLength = table.rows.length;
tabLength = tabLength-1;
var i = 0;
var dailyBudgetSubTotal = 0.00;
var tabBudget;
var days;
var rowTotal;
var rowSub = 0.00;
var total;


		while (i<tabLength)
		{
				
		tabBudget = 'budget' + myArray[i];
		days = 'txtRow' + myArray[i]; 
		rowTotal = 'total' + myArray[i];
		
		rowSub = parseFloat(document.getElementById(days).value) * parseFloat(remCommas(document.getElementById(tabBudget).innerHTML));

		document.getElementById(rowTotal).innerHTML = addCommas(rowSub.toFixed(2)) + ' ' + window.NewCurrName;


		dailyBudgetSubTotal = dailyBudgetSubTotal + document.getElementById(days).value * parseFloat(remCommas(document.getElementById(tabBudget).innerHTML));

		i++;

		}

document.getElementById('subTotal').innerHTML = addCommas(dailyBudgetSubTotal.toFixed(2)) + ' ' + window.NewCurrName;

}



function show(t)

{

validation();

//which drop down to dictate the new curreny value

if (t == 1)
{

if (abort1 == 1)
{
abort1 = 0;
document.currencyForm1.currency1.selectedIndex = document.currencyForm2.currency2.selectedIndex;
return;
}

window.prevMulti = window.NewCurrMulti;
document.currencyForm2.currency2.value = document.currencyForm1.currency1.value;
var temp2 = document.currencyForm1.currency1[document.currencyForm1.currency1.selectedIndex].text;
window.NewCurrMulti = document.currencyForm1.currency1[document.currencyForm1.currency1.selectedIndex].value;

}

else if (t == 2)
{

if (abort1 == 1)
{
abort1 = 0;
document.currencyForm2.currency2.selectedIndex = document.currencyForm1.currency1.selectedIndex;
return;
}

window.prevMulti = window.NewCurrMulti;
document.currencyForm1.currency1.value = document.currencyForm2.currency2.value;
var temp2 = document.currencyForm2.currency2[document.currencyForm2.currency2.selectedIndex].text;
window.NewCurrMulti = document.currencyForm2.currency2[document.currencyForm2.currency2.selectedIndex].value;
}
else
{

var temp2 = document.currencyForm1.currency1[document.currencyForm1.currency1.selectedIndex].text;
window.NewCurrMulti = document.currencyForm1.currency1[document.currencyForm1.currency1.selectedIndex].value;

}


//this deals with get only the first 3 digits from the currency conversion dropdown text

window.NewCurrName = temp2.substr(0,3);


var table = document.getElementById('tab');
var tabLength = table.rows.length;
tabLength = tabLength-1;
var i = 0;
var dailyBudgetSubTotal = 0.00;
var tabBudget;
var days;
var rowTotal;
var rowSub = 0.00;
var total;
var temp, temp2, temp3, temp4;
temp4 = 0;

if (window.NewCurrName == 'EUR')
{

while (i<tabLength)

		{
		
		tabBudget = 'budget' + myArray[i];
		days = 'txtRow' + myArray[i]; 
		rowTotal = 'total' + myArray[i];
		
		temp = (1/window.CurrMulti)*window.NewCurrMulti*parseFloat(myGBPPriceArray[i]);

		document.getElementById(tabBudget).innerHTML = addCommas(temp.toFixed(2)) + ' ' + window.NewCurrName;
		rowSub = parseFloat(document.getElementById(days).value) * parseFloat(temp.toFixed(2));

		document.getElementById(rowTotal).innerHTML = addCommas(rowSub.toFixed(2)) + ' ' + window.NewCurrName;
		dailyBudgetSubTotal = dailyBudgetSubTotal + parseFloat(document.getElementById(rowTotal).innerHTML);

		i++;
		}

//alert('prevMulti: ' + window.prevMulti);
//alert('NewCurrvMulti: ' + window.NewCurrMulti);

document.getElementById('jabs2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('AirFares2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('Visas2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('Insurance2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('Tours2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('preCreate1').innerHTML = ' ' + window.NewCurrName;
document.getElementById('preCreate2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('zorbing2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('diving2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('rockClimbing2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('canyoning2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('kayaking2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('cycling2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('whaleWatching2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('canoeing2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('rafting2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('bungeeJumping2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('skyDiving2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('quadBiking2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('surfing2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('blank12').innerHTML = ' ' + window.NewCurrName;
document.getElementById('blank22').innerHTML = ' ' + window.NewCurrName;
document.getElementById('blank32').innerHTML = ' ' + window.NewCurrName;


var j = (document.getElementById('jabs').value/window.prevMulti)*window.CurrMulti;
j = (j/window.CurrMulti)*window.NewCurrMulti;

var a = (document.getElementById('AirFares').value/window.prevMulti)*window.CurrMulti;
a = (a/window.CurrMulti)*window.NewCurrMulti;

var v = (document.getElementById('Visas').value/window.prevMulti)*window.CurrMulti;
v = (v/window.CurrMulti)*window.NewCurrMulti;

var i = (document.getElementById('Insurance').value/window.prevMulti)*window.CurrMulti;
i = (i/window.CurrMulti)*window.NewCurrMulti;

var t = (document.getElementById('Tours').value/window.prevMulti)*window.CurrMulti;
t = (t/window.CurrMulti)*window.NewCurrMulti;

var pc1 = (document.getElementById('preCreateVal1').value/window.prevMulti)*window.CurrMulti;
pc1 = (pc1/window.CurrMulti)*window.NewCurrMulti;

var pc2 = (document.getElementById('preCreateVal2').value/window.prevMulti)*window.CurrMulti;
pc2 = (pc2/window.CurrMulti)*window.NewCurrMulti;

var zorbing = (document.getElementById('zorbingText').value/window.prevMulti)*window.CurrMulti;
zorbing = (zorbing/window.CurrMulti)*window.NewCurrMulti;

var diving = (document.getElementById('divingText').value/window.prevMulti)*window.CurrMulti;
diving = (diving/window.CurrMulti)*window.NewCurrMulti;

var rockClimbing = (document.getElementById('rockClimbingText').value/window.prevMulti)*window.CurrMulti;
rockClimbing = (rockClimbing/window.CurrMulti)*window.NewCurrMulti;

var canyoning = (document.getElementById('canyoningText').value/window.prevMulti)*window.CurrMulti;
canyoning = (canyoning/window.CurrMulti)*window.NewCurrMulti;

var kayaking = (document.getElementById('kayakingText').value/window.prevMulti)*window.CurrMulti;
kayaking = (kayaking/window.CurrMulti)*window.NewCurrMulti;

var cycling = (document.getElementById('cyclingText').value/window.prevMulti)*window.CurrMulti;
cycling = (cycling/window.CurrMulti)*window.NewCurrMulti;

var whaleWatching = (document.getElementById('whaleWatchingText').value/window.prevMulti)*window.CurrMulti;
whaleWatching = (whaleWatching/window.CurrMulti)*window.NewCurrMulti;

var canoeing = (document.getElementById('canoeingText').value/window.prevMulti)*window.CurrMulti;
canoeing = (canoeing/window.CurrMulti)*window.NewCurrMulti;

var rafting = (document.getElementById('raftingText').value/window.prevMulti)*window.CurrMulti;
rafting = (rafting/window.CurrMulti)*window.NewCurrMulti;

var bungeeJumping = (document.getElementById('bungeeJunpingText').value/window.prevMulti)*window.CurrMulti;
bungeeJumping = (bungeeJumping/window.CurrMulti)*window.NewCurrMulti;

var skyDiving = (document.getElementById('skyDivingText').value/window.prevMulti)*window.CurrMulti;
skyDiving = (skyDiving/window.CurrMulti)*window.NewCurrMulti;

var quadBiking = (document.getElementById('quadBikingText').value/window.prevMulti)*window.CurrMulti;
quadBiking = (quadBiking/window.CurrMulti)*window.NewCurrMulti;

var surfing = (document.getElementById('surfingText').value/window.prevMulti)*window.CurrMulti;
surfing = (surfing/window.CurrMulti)*window.NewCurrMulti;

var Blank1 = (document.getElementById('blank1Text').value/window.prevMulti)*window.CurrMulti;
Blank1 = (Blank1/window.CurrMulti)*window.NewCurrMulti;

var Blank2 = (document.getElementById('blank2Text').value/window.prevMulti)*window.CurrMulti;
Blank2 = (Blank2/window.CurrMulti)*window.NewCurrMulti;

var Blank3 = (document.getElementById('blank3Text').value/window.prevMulti)*window.CurrMulti;
Blank3 = (Blank3/window.CurrMulti)*window.NewCurrMulti;

var drinker = document.lifestyle.drinker.value;
var eater = document.lifestyle.eater.value;
var luxury = document.lifestyle.luxury.value;
var shopper = document.lifestyle.shopper.value;
var preTotal, gTotal, actTotal, drinkerTotal, eaterTotal, shopperTotal, luxuryTotal;
var countryTotal, subTotal;

document.getElementById('jabs').value = j.toFixed(2);
document.getElementById('AirFares').value = a.toFixed(2);
document.getElementById('Visas').value = v.toFixed(2);
document.getElementById('Insurance').value = i.toFixed(2);
document.getElementById('Tours').value = t.toFixed(2);
document.getElementById('preCreateVal1').value = pc1.toFixed(2);
document.getElementById('preCreateVal2').value = pc2.toFixed(2);
document.getElementById('zorbingText').value = zorbing.toFixed(2); 
document.getElementById('divingText').value = diving.toFixed(2); 
document.getElementById('rockClimbingText').value = rockClimbing.toFixed(2); 
document.getElementById('canyoningText').value = canyoning.toFixed(2); 
document.getElementById('kayakingText').value = kayaking.toFixed(2); 
document.getElementById('cyclingText').value = cycling.toFixed(2); 
document.getElementById('whaleWatchingText').value = whaleWatching.toFixed(2); 
document.getElementById('canoeingText').value = canoeing.toFixed(2); 
document.getElementById('raftingText').value = rafting.toFixed(2); 
document.getElementById('bungeeJunpingText').value = bungeeJumping.toFixed(2); 
document.getElementById('skyDivingText').value = skyDiving.toFixed(2); 
document.getElementById('quadBikingText').value = quadBiking.toFixed(2); 
document.getElementById('surfingText').value = surfing.toFixed(2); 
document.getElementById('blank1Text').value = Blank1.toFixed(2); 
document.getElementById('blank2Text').value = Blank2.toFixed(2);
document.getElementById('blank3Text').value = Blank3.toFixed(2);


temp2 = dailyBudgetSubTotal.toFixed(2);

document.getElementById('subTotal').innerHTML = addCommas(temp2) + ' ' + window.NewCurrName;

subTotal = temp2;

preTotal = parseFloat(j.toFixed(2)) + parseFloat(a.toFixed(2)) + parseFloat(v.toFixed(2)) + parseFloat(i.toFixed(2)) + parseFloat(t.toFixed(2)) + parseFloat(pc1.toFixed(2)) + parseFloat(pc2.toFixed(2));

actTotal = parseFloat(zorbing.toFixed(2)) + parseFloat(quadBiking.toFixed(2)) + parseFloat(skyDiving.toFixed(2)) + parseFloat(bungeeJumping.toFixed(2)) + parseFloat(rafting.toFixed(2)) + parseFloat(canoeing.toFixed(2)) + parseFloat(whaleWatching.toFixed(2)) + parseFloat(cycling.toFixed(2)) + parseFloat(kayaking.toFixed(2)) + parseFloat(canyoning.toFixed(2)) + parseFloat(rockClimbing.toFixed(2)) + parseFloat(surfing.toFixed(2)) + parseFloat(diving.toFixed(2)) + parseFloat(Blank1.toFixed(2)) + parseFloat(Blank2.toFixed(2)) + parseFloat(Blank3.toFixed(2));

drinkerTotal = (parseFloat(remCommas(document.getElementById('subTotal').innerHTML)) * drinker)-parseFloat(subTotal);
eaterTotal = (parseFloat(remCommas(document.getElementById('subTotal').innerHTML)) * eater)-parseFloat(subTotal);
shopperTotal = (parseFloat(remCommas(document.getElementById('subTotal').innerHTML)) * shopper)-parseFloat(subTotal);
luxuryTotal = (parseFloat(remCommas(document.getElementById('subTotal').innerHTML)) * luxury)-parseFloat(subTotal);

gTotal = parseFloat(subTotal) + parseFloat(preTotal) + parseFloat(drinkerTotal) + parseFloat(eaterTotal) + parseFloat(shopperTotal) + parseFloat(luxuryTotal) + parseFloat(actTotal);

document.getElementById('GrandTotal').innerHTML = addCommas(gTotal.toFixed(2)) + ' ' + window.NewCurrName;

//if this fires, the other part of the clause will not
temp4 = 1;

}


if ((window.CurrName != 'EUR' || window.NewCurrName != 'EUR') && (temp4==0))
{

		while (i<tabLength)
		{
		
		tabBudget = 'budget' + myArray[i];
		days = 'txtRow' + myArray[i]; 
		rowTotal = 'total' + myArray[i];

		temp = (1/window.CurrMulti)*window.NewCurrMulti*parseFloat(myGBPPriceArray[i]);

		document.getElementById(tabBudget).innerHTML = addCommas(temp.toFixed(2)) + ' ' + window.NewCurrName;
		rowSub = parseFloat(document.getElementById(days).value) * parseFloat(temp.toFixed(2));

		document.getElementById(rowTotal).innerHTML = addCommas(rowSub.toFixed(2)) + ' ' + window.NewCurrName;
		dailyBudgetSubTotal = dailyBudgetSubTotal + parseFloat(remCommas(document.getElementById(rowTotal).innerHTML));

		i++;
		}

document.getElementById('jabs2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('AirFares2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('Visas2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('Insurance2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('Tours2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('preCreate1').innerHTML = ' ' + window.NewCurrName;
document.getElementById('preCreate2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('zorbing2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('diving2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('rockClimbing2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('canyoning2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('kayaking2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('cycling2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('whaleWatching2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('canoeing2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('rafting2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('bungeeJumping2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('skyDiving2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('quadBiking2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('surfing2').innerHTML = ' ' + window.NewCurrName;
document.getElementById('blank12').innerHTML = ' ' + window.NewCurrName;
document.getElementById('blank22').innerHTML = ' ' + window.NewCurrName;
document.getElementById('blank32').innerHTML = ' ' + window.NewCurrName;


//to british and then onto foreign currency

var j = (document.getElementById('jabs').value/window.prevMulti)*window.CurrMulti;
j = (j/window.CurrMulti)*window.NewCurrMulti;

var a = (document.getElementById('AirFares').value/window.prevMulti)*window.CurrMulti;
a = (a/window.CurrMulti)*window.NewCurrMulti;

var v = (document.getElementById('Visas').value/window.prevMulti)*window.CurrMulti;
v = (v/window.CurrMulti)*window.NewCurrMulti;

var i = (document.getElementById('Insurance').value/window.prevMulti)*window.CurrMulti;
i = (i/window.CurrMulti)*window.NewCurrMulti;

var t = (document.getElementById('Tours').value/window.prevMulti)*window.CurrMulti;
t = (t/window.CurrMulti)*window.NewCurrMulti;

var pc1 = (document.getElementById('preCreateVal1').value/window.prevMulti)*window.CurrMulti;
pc1 = (pc1/window.CurrMulti)*window.NewCurrMulti;

var pc2 = (document.getElementById('preCreateVal2').value/window.prevMulti)*window.CurrMulti;
pc2 = (pc2/window.CurrMulti)*window.NewCurrMulti;

var zorbing = (document.getElementById('zorbingText').value/window.prevMulti)*window.CurrMulti;
zorbing = (zorbing/window.CurrMulti)*window.NewCurrMulti;

var diving = (document.getElementById('divingText').value/window.prevMulti)*window.CurrMulti;
diving = (diving/window.CurrMulti)*window.NewCurrMulti;

var rockClimbing = (document.getElementById('rockClimbingText').value/window.prevMulti)*window.CurrMulti;
rockClimbing = (rockClimbing/window.CurrMulti)*window.NewCurrMulti;

var canyoning = (document.getElementById('canyoningText').value/window.prevMulti)*window.CurrMulti;
canyoning = (canyoning/window.CurrMulti)*window.NewCurrMulti;

var kayaking = (document.getElementById('kayakingText').value/window.prevMulti)*window.CurrMulti;
kayaking = (kayaking/window.CurrMulti)*window.NewCurrMulti;

var cycling = (document.getElementById('cyclingText').value/window.prevMulti)*window.CurrMulti;
cycling = (cycling/window.CurrMulti)*window.NewCurrMulti;

var whaleWatching = (document.getElementById('whaleWatchingText').value/window.prevMulti)*window.CurrMulti;
whaleWatching = (whaleWatching/window.CurrMulti)*window.NewCurrMulti;

var canoeing = (document.getElementById('canoeingText').value/window.prevMulti)*window.CurrMulti;
canoeing = (canoeing/window.CurrMulti)*window.NewCurrMulti;

var rafting = (document.getElementById('raftingText').value/window.prevMulti)*window.CurrMulti;
rafting = (rafting/window.CurrMulti)*window.NewCurrMulti;

var bungeeJumping = (document.getElementById('bungeeJunpingText').value/window.prevMulti)*window.CurrMulti;
bungeeJumping = (bungeeJumping/window.CurrMulti)*window.NewCurrMulti;

var skyDiving = (document.getElementById('skyDivingText').value/window.prevMulti)*window.CurrMulti;
skyDiving = (skyDiving/window.CurrMulti)*window.NewCurrMulti;

var quadBiking = (document.getElementById('quadBikingText').value/window.prevMulti)*window.CurrMulti;
quadBiking = (quadBiking/window.CurrMulti)*window.NewCurrMulti;

var surfing = (document.getElementById('surfingText').value/window.prevMulti)*window.CurrMulti;
surfing = (surfing/window.CurrMulti)*window.NewCurrMulti;

var Blank1 = (document.getElementById('blank1Text').value/window.prevMulti)*window.CurrMulti;
Blank1 = (Blank1/window.CurrMulti)*window.NewCurrMulti;

var Blank2 = (document.getElementById('blank2Text').value/window.prevMulti)*window.CurrMulti;
Blank2 = (Blank2/window.CurrMulti)*window.NewCurrMulti;

var Blank3 = (document.getElementById('blank3Text').value/window.prevMulti)*window.CurrMulti;
Blank3 = (Blank3/window.CurrMulti)*window.NewCurrMulti;

var drinker = document.lifestyle.drinker.value;
var eater = document.lifestyle.eater.value;
var luxury = document.lifestyle.luxury.value;
var shopper = document.lifestyle.shopper.value;
var preTotal, gTotal, actTotal, drinkerTotal, eaterTotal, shopperTotal, luxuryTotal;
var countryTotal, subTotal;

document.getElementById('jabs').value = j.toFixed(2);
document.getElementById('AirFares').value = a.toFixed(2);
document.getElementById('Visas').value = v.toFixed(2);
document.getElementById('Insurance').value = i.toFixed(2);
document.getElementById('Tours').value = t.toFixed(2);
document.getElementById('preCreateVal1').value = pc1.toFixed(2);
document.getElementById('preCreateVal2').value = pc2.toFixed(2);
document.getElementById('zorbingText').value = zorbing.toFixed(2); 
document.getElementById('divingText').value = diving.toFixed(2); 
document.getElementById('rockClimbingText').value = rockClimbing.toFixed(2); 
document.getElementById('canyoningText').value = canyoning.toFixed(2); 
document.getElementById('kayakingText').value = kayaking.toFixed(2); 
document.getElementById('cyclingText').value = cycling.toFixed(2); 
document.getElementById('whaleWatchingText').value = whaleWatching.toFixed(2); 
document.getElementById('canoeingText').value = canoeing.toFixed(2); 
document.getElementById('raftingText').value = rafting.toFixed(2); 
document.getElementById('bungeeJunpingText').value = bungeeJumping.toFixed(2); 
document.getElementById('skyDivingText').value = skyDiving.toFixed(2); 
document.getElementById('quadBikingText').value = quadBiking.toFixed(2); 
document.getElementById('surfingText').value = surfing.toFixed(2); 
document.getElementById('blank1Text').value = Blank1.toFixed(2); 
document.getElementById('blank2Text').value = Blank2.toFixed(2);
document.getElementById('blank3Text').value = Blank3.toFixed(2);

temp2 = dailyBudgetSubTotal.toFixed(2);

document.getElementById('subTotal').innerHTML = addCommas(temp2) + ' ' + window.NewCurrName;

subTotal = temp2;

preTotal = parseFloat(j.toFixed(2)) + parseFloat(a.toFixed(2)) + parseFloat(v.toFixed(2)) + parseFloat(i.toFixed(2)) + parseFloat(t.toFixed(2)) + parseFloat(pc1.toFixed(2)) + parseFloat(pc2.toFixed(2));

actTotal = parseFloat(zorbing.toFixed(2)) + parseFloat(quadBiking.toFixed(2)) + parseFloat(skyDiving.toFixed(2)) + parseFloat(bungeeJumping.toFixed(2)) + parseFloat(rafting.toFixed(2)) + parseFloat(canoeing.toFixed(2)) + parseFloat(whaleWatching.toFixed(2)) + parseFloat(cycling.toFixed(2)) + parseFloat(kayaking.toFixed(2)) + parseFloat(canyoning.toFixed(2)) + parseFloat(rockClimbing.toFixed(2)) + parseFloat(surfing.toFixed(2)) + parseFloat(diving.toFixed(2)) + parseFloat(Blank1.toFixed(2)) + parseFloat(Blank2.toFixed(2)) + parseFloat(Blank3.toFixed(2));

drinkerTotal = (parseFloat(remCommas(document.getElementById('subTotal').innerHTML)) * drinker)-parseFloat(subTotal);
eaterTotal = (parseFloat(remCommas(document.getElementById('subTotal').innerHTML)) * eater)-parseFloat(subTotal);
shopperTotal = (parseFloat(remCommas(document.getElementById('subTotal').innerHTML)) * shopper)-parseFloat(subTotal);
luxuryTotal = (parseFloat(remCommas(document.getElementById('subTotal').innerHTML)) * luxury)-parseFloat(subTotal);

gTotal = parseFloat(subTotal) + parseFloat(preTotal) + parseFloat(drinkerTotal) + parseFloat(eaterTotal) + parseFloat(shopperTotal) + parseFloat(luxuryTotal) + parseFloat(actTotal);

document.getElementById('GrandTotal').innerHTML = addCommas(gTotal.toFixed(2)) + ' ' + window.NewCurrName;

}

}

function isMoney(val, name)
{

var i, mychar;

if(val.length==0)
{
document.getElementById(name).value = '0.00';
}

//if (val.charAt(val.length-3) != '.')
//{
//document.getElementById(name).style.backgroundColor='#F5EC8B';
//return false;
//}


for (i = val.length; i > 0 ; i--) 
{

if (i == val.length-2)
{
}
else
{
mychar = val.charAt(i-1);

if (mychar >= 0 && mychar <= 9)
{
}
else
{
document.getElementById(name).style.backgroundColor='#F5EC8B';
return false;
}
}

}


}

var abort1 = 0;

function validation()
{

var abort;

var jabs = document.getElementById('jabs').value;
abort = isMoney(jabs, 'jabs');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else 
{
document.getElementById('jabs').style.backgroundColor = '#FFFFFF';
}

var AirFares = document.getElementById('AirFares').value;
abort = isMoney(AirFares, 'AirFares');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('AirFares').style.backgroundColor = '#FFFFFF';
}

var Visas = document.getElementById('Visas').value;
abort = isMoney(Visas, 'Visas');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('Visas').style.backgroundColor = '#FFFFFF';
}

var Insurance = document.getElementById('Insurance').value;
abort = isMoney(Insurance, 'Insurance');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('Insurance').style.backgroundColor = '#FFFFFF';
}

var Tours = document.getElementById('Tours').value;
abort = isMoney(Tours, 'Tours');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('Tours').style.backgroundColor = '#FFFFFF';
}

var preC1 = document.getElementById('preCreateVal1').value;
abort = isMoney(preC1, 'preCreateVal1');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('preCreateVal1').style.backgroundColor = '#FFFFFF';
}

var preC2 = document.getElementById('preCreateVal2').value;
abort = isMoney(preC2, 'preCreateVal2');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('preCreateVal2').style.backgroundColor = '#FFFFFF';
}

var zorbing = document.getElementById('zorbingText').value;
abort = isMoney(zorbing, 'zorbingText');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('zorbingText').style.backgroundColor = '#FFFFFF';
}

var quadBiking = document.getElementById('quadBikingText').value;
abort = isMoney(quadBiking, 'quadBikingText');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('quadBikingText').style.backgroundColor = '#FFFFFF';
}

var skyDiving = document.getElementById('skyDivingText').value;
abort = isMoney(skyDiving, 'skyDivingText');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('skyDivingText').style.backgroundColor = '#FFFFFF';
}

var bungeeJunping = document.getElementById('bungeeJunpingText').value;
abort = isMoney(bungeeJunping, 'bungeeJunpingText');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('bungeeJunpingText').style.backgroundColor = '#FFFFFF';
}

var rafting = document.getElementById('raftingText').value;
abort = isMoney(rafting, 'raftingText');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('raftingText').style.backgroundColor = '#FFFFFF';
}

var canoeing= document.getElementById('canoeingText').value;
abort = isMoney(canoeing, 'canoeingText');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('canoeingText').style.backgroundColor = '#FFFFFF';
}

var whaleWatching = document.getElementById('whaleWatchingText').value;
abort = isMoney(whaleWatching, 'whaleWatchingText');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('whaleWatchingText').style.backgroundColor = '#FFFFFF';
}

var cycling = document.getElementById('cyclingText').value;
abort = isMoney(cycling, 'cyclingText');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('cyclingText').style.backgroundColor = '#FFFFFF';
}

var kayaking = document.getElementById('kayakingText').value;
abort = isMoney(kayaking, 'kayakingText');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('kayakingText').style.backgroundColor = '#FFFFFF';
}

var canyoning = document.getElementById('canyoningText').value;
abort = isMoney(canyoning, 'canyoningText');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('canyoningText').style.backgroundColor = '#FFFFFF';
}

var rockClimbing = document.getElementById('rockClimbingText').value;
abort = isMoney(rockClimbing, 'rockClimbingText');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('rockClimbingText').style.backgroundColor = '#FFFFFF';
}

var surfing = document.getElementById('surfingText').value;
abort = isMoney(surfing, 'surfingText');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('surfingText').style.backgroundColor = '#FFFFFF';
}

var diving = document.getElementById('divingText').value;
abort = isMoney(diving, 'divingText');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('divingText').style.backgroundColor = '#FFFFFF';
}

var blank1 = document.getElementById('blank1Text').value;
abort = isMoney(blank1, 'blank1Text');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('blank1Text').style.backgroundColor = '#FFFFFF';
}

var blank2 = document.getElementById('blank2Text').value;
abort = isMoney(blank2, 'blank2Text');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('blank2Text').style.backgroundColor = '#FFFFFF';
}

var blank3 = document.getElementById('blank3Text').value;
abort = isMoney(blank3, 'blank3Text');
if (abort == false) 
{
abort1 = 1;
abort = 'true';
}
else
{
document.getElementById('blank3Text').style.backgroundColor = '#FFFFFF';
}


if (abort1 == 1)
{
alert('Text fields now in yellow must have currency entered with 2 decimal places.')
document.getElementById('GrandTotal').innerHTML = '0.00 ' + window.NewCurrName;
return;
}

}


function Result()

{

validation();

if (abort1 == 1)
{
abort1 = 0;
return;
}

var jabs = document.getElementById('jabs').value;
var AirFares = document.getElementById('AirFares').value;
var Visas = document.getElementById('Visas').value;
var Insurance = document.getElementById('Insurance').value;
var Tours = document.getElementById('Tours').value;
var zorbing = document.getElementById('zorbingText').value;
var quadBiking = document.getElementById('quadBikingText').value;
var skyDiving = document.getElementById('skyDivingText').value;
var bungeeJunping = document.getElementById('bungeeJunpingText').value;
var rafting = document.getElementById('raftingText').value;
var canoeing= document.getElementById('canoeingText').value;
var whaleWatching = document.getElementById('whaleWatchingText').value;
var cycling = document.getElementById('cyclingText').value;
var kayaking = document.getElementById('kayakingText').value;
var canyoning = document.getElementById('canyoningText').value;
var rockClimbing = document.getElementById('rockClimbingText').value;
var surfing = document.getElementById('surfingText').value;
var diving = document.getElementById('divingText').value;
var preC1 = document.getElementById('preCreateVal1').value;
var preC2 = document.getElementById('preCreateVal2').value;
var Blank1 = document.getElementById('blank1Text').value;
var Blank2 = document.getElementById('blank2Text').value;
var Blank3 = document.getElementById('blank3Text').value;

var drinker = document.lifestyle.drinker.value;
var eater = document.lifestyle.eater.value;
var luxury = document.lifestyle.luxury.value;
var shopper = document.lifestyle.shopper.value;
var preTotal, gTotal, actTotal, drinkerTotal, eaterTotal, shopperTotal, luxuryTotal;
var countryTotal, subTotal;

subTotal = parseFloat(remCommas(document.getElementById('subTotal').innerHTML));

preTotal = parseFloat(jabs) + parseFloat(AirFares) + parseFloat(Visas) + parseFloat(Insurance) + parseFloat(Tours) + parseFloat(preC1) + parseFloat(preC2);

actTotal = parseFloat(zorbing) + parseFloat(quadBiking) + parseFloat(skyDiving) + parseFloat(bungeeJunping) + parseFloat(rafting) + parseFloat(canoeing) + parseFloat(whaleWatching) + parseFloat(cycling) + parseFloat(kayaking) + parseFloat(canyoning) + parseFloat(rockClimbing) + parseFloat(surfing) + parseFloat(diving) + parseFloat(Blank1) + parseFloat(Blank2) + parseFloat(Blank3);

drinkerTotal = (parseFloat(remCommas(document.getElementById('subTotal').innerHTML)) * drinker)-parseFloat(subTotal);
eaterTotal = (parseFloat(remCommas(document.getElementById('subTotal').innerHTML)) * eater)-parseFloat(subTotal);
shopperTotal = (parseFloat(remCommas(document.getElementById('subTotal').innerHTML)) * shopper)-parseFloat(subTotal);
luxuryTotal = (parseFloat(remCommas(document.getElementById('subTotal').innerHTML)) * luxury)-parseFloat(subTotal);

gTotal = parseFloat(subTotal) + parseFloat(preTotal) + parseFloat(drinkerTotal) + parseFloat(eaterTotal) + parseFloat(shopperTotal) + parseFloat(luxuryTotal) + parseFloat(actTotal);

document.getElementById('GrandTotal').innerHTML = addCommas(gTotal.toFixed(2)) + ' ' + window.NewCurrName;


}

function backToZero()
{
document.getElementById('GrandTotal').innerHTML = '0.00 ' + window.NewCurrName;
}


function addCountryTextBox()
{

document.getElementById('suggest1').value = '';
document.getElementById('suggest1').style.color = '#000000';

}

function addCommas(nStr)
{
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}

function remCommas(nStr)
{

nStr = nStr.replace(/,/g,'');
return nStr;

}



function addDaysToDate(yr, mmx, dd) {

var months=['January','February','March','April','May','June','July','August','September','October','November','December']
var mm = mmx-1;
checkValidDate(yr,mmx,dd);
if (!flag) {return false}
//alert(yr + ' ' + mm + ' ' + dd);
var nd = new Date(yr, mm, dd);  // YYYY/MM/DD - months are 0-11 
nd.setMonth(nd.getMonth());
nd.setDate(nd.getDate() + totalTripDays);
var month = nd.getMonth();
var day = nd.getDate();



var year = nd.getFullYear();
//alert(year + ' ' + month + ' ' + day);
getSuffix(day);
futureDate = (day + daySuffix + " " +  months[month] + " " +  year);
document.getElementById('returnDate').innerHTML = '<strong>' + futureDate + '</strong>';
//for the email leaving date
leavingDateString = futureDate;
}

function minusDaysToDate(yr, mmx, dd) {

var months=['January','February','March','April','May','June','July','August','September','October','November','December']
var mm = mmx-1;
checkValidDate(yr,mmx,dd);
if (!flag) {return false}
//alert(yr + ' ' + mm + ' ' + dd);
var nd = new Date(yr, mm, dd);  // YYYY/MM/DD - months are 0-11 
nd.setMonth(nd.getMonth());
nd.setDate(nd.getDate() + totalTripDays);
var month = nd.getMonth();
var day = nd.getDate();



var year = nd.getFullYear();
//alert(year + ' ' + month + ' ' + day);
getSuffix(day);
futureDate = (day + daySuffix + " " +  months[month] + " " +  year);
document.getElementById('returnDate').innerHTML = '<strong>' + futureDate + '</strong>';
}

function getSuffix(dd) {  
daySuffix = 'th';
if(dd != 11 && dd != 12 && dd != 13) { var ddx = dd % 10 }
else {var ddx = dd}
if (ddx == 1) { daySuffix = 'st' }
if (ddx == 2) { daySuffix = 'nd' }
if (ddx == 3) { daySuffix = 'rd' }
return daySuffix;
}

function checkValidDate(yr,mmx,dd) {
mm = mmx-1;  // remember that in Javascript date objects the months are 0-11
var nd = new Date();
nd.setFullYear(yr,mm,dd);  
var ndmm = nd.getMonth();
if (ndmm != mm) {
flag = false;
}
else {
flag = true;
}
}

function daysToDateAdd()
{

var dateArr = document.getElementById('testinput').value;
var day;
var month;
var year;

day = dateArr.substring(0,2);
month = dateArr.substring(3,5);
year = dateArr.substring(6,10);


addDaysToDate(year, month, day);  // 16th September 2009

}

function daysToDateMinus()
{

var dateArr = document.getElementById('testinput').value;
var day;
var month;
var year;

day = dateArr.substring(0,2);
month = dateArr.substring(3,5);
year = dateArr.substring(6,10);


minusDaysToDate(year, month, day);  // 16th September 2009

}

function add(t)
{


var p = t.nextSibling.id;
p = p.slice(6, p.length);

var tabBudget, days, rowTotal, total;
var rowSub = 0.00;

	tabBudget = 'budget' + p;

	days = 'txtRow' + p; 
	rowTotal = 'total' + p;

	document.getElementById(days).value = parseInt(document.getElementById(days).value) + 1;
	
rowSub = parseFloat(document.getElementById(days).value) * parseFloat(remCommas(document.getElementById(tabBudget).innerHTML));

document.getElementById(rowTotal).innerHTML = addCommas(rowSub.toFixed(2)) + ' ' + window.NewCurrName;

	findSubTotal();
		
	document.getElementById('GrandTotal').innerHTML = '0.00' + ' ' + window.NewCurrName;

	//totalling trip days
	totalTripDays = totalTripDays + 1;
	document.getElementById('days').innerHTML = '<strong>' + totalTripDays + ' Day(s)</strong>';
	daysToDateAdd();

}

function minus(t)
{



var p = t.previousSibling.id;
p = p.slice(6, p.length);
tabBudget = 'budget' + p;
days = 'txtRow' + p; 
rowTotal = 'total' + p;
	
	if (document.getElementById(days).value == 0)
	{
	}
	else
	{
	
	
	var tabBudget, days, rowTotal, total;
	var rowSub = 0.00;
	document.getElementById(days).value = parseInt(document.getElementById(days).value) - 1;
		
	rowSub = parseFloat(document.getElementById(days).value) * parseFloat(remCommas(document.getElementById(tabBudget).innerHTML));

	document.getElementById(rowTotal).innerHTML = addCommas(rowSub.toFixed(2)) + ' ' + window.NewCurrName;
	findSubTotal();

	document.getElementById('GrandTotal').innerHTML = '0.00' + ' ' + window.NewCurrName;

	//totalling trip days
	totalTripDays = totalTripDays - 1;
	document.getElementById('days').innerHTML = '<strong>' + totalTripDays + ' Day(s)</strong>';
	daysToDateMinus();
	}

}

function reset()
{

var tbl = document.getElementById('tab');
var tabLength = tbl.rows.length;

while (tabLength > 1)

		{
		tbl.deleteRow(tabLength-1);
		whatIsLeft = whatIsLeft + 1;
		myGBPPriceArray.splice(myGBPPriceArray.length-1,1);
		myArray.splice(myArray.length-1,1);
		tabLength=tabLength-1;
		}

iteration = 0;
totalTripDays = 0;
numRowRemoved = 0;

document.getElementById('left').innerHTML = '<strong>' + whatIsLeft + '</strong> left to add';
document.getElementById('days').innerHTML = '<strong>' + totalTripDays + ' Day(s)</strong>';
document.getElementById('testinput').value = '';
futureDate = '';
document.getElementById('returnDate').innerHTML = '<strong>Enter a leaving date</strong>';

document.getElementById('zorbingText').value = '0.00';
document.getElementById('divingText').value = '0.00';
document.getElementById('rockClimbingText').value = '0.00';
document.getElementById('canyoningText').value = '0.00';
document.getElementById('kayakingText').value = '0.00';
document.getElementById('cyclingText').value = '0.00';
document.getElementById('whaleWatchingText').value = '0.00';
document.getElementById('canoeingText').value = '0.00';
document.getElementById('raftingText').value = '0.00';
document.getElementById('bungeeJunpingText').value = '0.00';
document.getElementById('skyDivingText').value = '0.00';
document.getElementById('quadBikingText').value = '0.00';
document.getElementById('surfingText').value = '0.00';
document.getElementById('blank1Text').value = '0.00';
document.getElementById('blank2Text').value = '0.00';
document.getElementById('blank3Text').value = '0.00';
document.getElementById('preCreateVal1').value = '0.00';
document.getElementById('preCreateVal2').value = '0.00';
document.getElementById('blank1TextName').value = 'Create Your Own';
document.getElementById('blank2TextName').value = 'Create Your Own';
document.getElementById('blank3TextName').value = 'Create Your Own';
document.getElementById('pc1').value = 'Create Your Own';
document.getElementById('pc2').value = 'Create Your Own';


document.getElementById('zorbingText').style.backgroundColor = '#FFFFFF';
document.getElementById('divingText').style.backgroundColor = '#FFFFFF';
document.getElementById('rockClimbingText').style.backgroundColor = '#FFFFFF';
document.getElementById('canyoningText').style.backgroundColor = '#FFFFFF';
document.getElementById('kayakingText').style.backgroundColor = '#FFFFFF';
document.getElementById('cyclingText').style.backgroundColor = '#FFFFFF';
document.getElementById('whaleWatchingText').style.backgroundColor = '#FFFFFF';
document.getElementById('canoeingText').style.backgroundColor = '#FFFFFF';
document.getElementById('raftingText').style.backgroundColor = '#FFFFFF';
document.getElementById('bungeeJunpingText').style.backgroundColor = '#FFFFFF';
document.getElementById('skyDivingText').style.backgroundColor = '#FFFFFF';
document.getElementById('quadBikingText').style.backgroundColor = '#FFFFFF';
document.getElementById('surfingText').style.backgroundColor = '#FFFFFF';
document.getElementById('blank1Text').style.backgroundColor = '#FFFFFF';
document.getElementById('blank2Text').style.backgroundColor = '#FFFFFF';
document.getElementById('blank3Text').style.backgroundColor = '#FFFFFF';

document.lifestyle.drinker.selectedIndex = 0;
document.lifestyle.eater.selectedIndex = 0;
document.lifestyle.luxury.selectedIndex = 0;
document.lifestyle.shopper.selectedIndex = 0;


document.getElementById('jabs').value = '0.00'
document.getElementById('AirFares').value = '0.00'
document.getElementById('Visas').value = '0.00'
document.getElementById('Insurance').value = '0.00';
document.getElementById('Tours').value = '0.00';

document.getElementById('jabs').style.backgroundColor = '#FFFFFF';
document.getElementById('AirFares').style.backgroundColor = '#FFFFFF';
document.getElementById('Visas').style.backgroundColor = '#FFFFFF';
document.getElementById('Insurance').style.backgroundColor = '#FFFFFF';
document.getElementById('Tours').style.backgroundColor = '#FFFFFF';

document.getElementById('subTotal').innerHTML = '0.00 ' + window.NewCurrName;
document.getElementById('GrandTotal').innerHTML = '0.00 ' + window.NewCurrName;

}

function showArray()
{

alert(myGBPPriceArray.toString());
alert(myArray.toString());

}

function description(temp)
{

if (temp == "zorbingText")
{
document.getElementById("description").innerHTML = "Zorbing price based on one run";
}
if (temp == "quadBikingText")
{
document.getElementById("description").innerHTML = "Quad biking price based on a 2 hour session";
}
if (temp == "skyDivingText")
{
document.getElementById("description").innerHTML = "Sky diving price based on a 15,000ft tandem jumps";
}
if (temp == "canoeingText")
{
document.getElementById("description").innerHTML = "Price is based on a guided day tour";
}
if (temp == "cyclingText")
{
document.getElementById("description").innerHTML = "Cycling is priced on the day hire of a bicycle";
}
if (temp == "kayakingText")
{
document.getElementById("description").innerHTML = "Kayaking is priced on the day hire of a kayak";
}
if (temp == "surfingText")
{
document.getElementById("description").innerHTML = "Surfing is priced on the day hire of a surfboard";
}
if (temp == "divingText")
{
document.getElementById("description").innerHTML = "Price is based on a dive with two tanks of oxygen. PADI not included";
}
if (temp == "rockClimbingText")
{
document.getElementById("description").innerHTML = "Price is for half a day of climbing and instruction";
}
if (temp == "canyoningText")
{
document.getElementById("description").innerHTML = "Costed for half a guided day";
}
if (temp == "whaleWatchingText")
{
document.getElementById("description").innerHTML = "Price for a 2-3 hour watching session";
}
if (temp == "raftingText")
{
document.getElementById("description").innerHTML = "Price for a guided 2 hours session on a grade 3-5 river";
}
if (temp == "bungeeJunpingText")
{
document.getElementById("description").innerHTML = "Price for a jump. Greatly varies based on height and combo deals";
}


}
