infoArr = new Array();
infoArr['f'] = '<strong>Need Multistop flights?</strong> Just click on the multi-stop option in the navigation bar';
infoArr['h'] = '<strong>Looking for a hotel?</strong> Search for thousands of properties all over the USA and Canada';
infoArr['c'] = '<strong>Please Note:</strong> All drivers must have held a full licence for at least one year and be 25 or older. If the driver is over 65, please call American Holidays at 01 6733840';
infoArr['fh'] = '<strong>Create your own package:</strong> You have the power to build your own holiday. Choose from thousands of options in the USA & Canada';
infoArr['fhc'] = '<strong>Looking for freedom?</strong> Why not include a car in your search and you can have complete freedom on your dream holiday';
infoArr['fc'] = '<strong>For More Options</strong> Please Note: All drivers must have held a full licence for at least one year and be 25 or older. If the driver is over 65, please call American Holidays at 01 6733840';
 

errors = new Array();

errors[1] = 'The information you provided did not match our records. <br>Please try again or contact us.';
errors[10009] = 'The information you provided did not match our records.<br> It appears you may have tried to access another agents records. <br> We have logged your address for security reasons.';
errors[1001] = 'There are no Cars available during the dates you have selected. Please try a different car company.';
errors[11] = 'Your return date must be after your departure date.';
errors[110] = 'Your flight did not meet the advance days requirement of param1 days.';
errors[111] = 'This program requires a Saturday night stay.';
errors[112] = 'Your stay did not meet the minimum days requirement of param1 days.';
errors[113] = 'Your stay exceeded the maximum days requirement of param1 days.';
errors[13] = 'Your departure date must be at least 24 hours in advance.';
errors[17] = 'Your package must have an airroom or car selection.';
errors[19] = 'Unbooked itineraries are saved for 6 hours.';
errors[2] = 'That Package name already exists. Please try another.';
errors[200] = 'That Username already existsplease select another one.';
errors[2000] = 'You cannot take a flight between same airports.';
errors[201] = 'That Agency name already exists please enter another one. If you would like to add more Agents to your agency recordplease contact us.';
errors[203] = 'An error has occurred adding your add-on activity. Please try again.';
errors[204] = 'No themes were found that match your query. Please try again.';
errors[205] = 'You must build a valid activity rate before building an add-on contract.';
errors[21] = 'The number of adults must be more than or equal to the number of rooms.';
errors[21212] = 'FROM date must be before TO date. Please try again.';
errors[22] = 'While adding to or replacing air legs adding roomcar or activity components is not allowed.';
errors[22223] = 'One of your selected dates does not exist. Please try again.';
errors[2341] = 'One of your selected dates is between another rates FROM and TO. Please make sure these dates do not overlap each other and that a rate starts the day after another one ends.';
errors[2342] = 'Your TO date must end where the next FROM date begins when adding or modifying a rate when another rate exists for the same product.';
errors[2345] = 'One of your selected dates is between another periods FROM and TO for this room category. Please make sure these dates do not overlap each other.';
errors[24] = 'While adding to or replacing air legs the GDS must be the same as the originalparam1.';
errors[2451] = 'You must build a room category before building a room contract.';
errors[2452] = 'You must build a car product before building a car contract.';
errors[2453] = 'You must build a car contract to assign to a package.';
errors[251] = 'You cannot modify or cancel a booking 4000 day(s) after the booking end date.';
errors[298] = 'It appears you have pressed the RELOAD button or have book marked this page.<br> If you booked your itinerary successfullyyou should receive an Email shortly.';
errors[2999] = 'You do not have clearance to view that area. Please ask the system administrator to modify your permissions if necessary.';
errors[3] = 'The seat selection service is unavailable for this flight.';
errors[30] = 'Please login to view products.';
errors[31] = 'No flights are available for the dates/restrictions you have chosen. Please change your selections or contact us directly.';
errors[33] = 'Please enter the number of adults and children.';
errors[3360] = 'Chain names must be unique. Please select another name or modify this one.';
errors[34] = 'There is already a flight on one of your selected dates.';
errors[3400] = 'SupplierName must be unique. Please select another name or modify this one.';
errors[3401] = 'During the time you were making your bookingyour room has become unavailable. Please delete this from your itinerary and book another room.';
errors[3402] = 'During the time you were making your bookingthe charter air you selected has become unavailable. Please delete this from your itinerary.';
errors[3404] = 'There are no flights available. Please try different times daysairlines and flight requirements.';
errors[3405] = 'During the time you were making your bookingthe coupons you selected have become unavailable. Please delete this from your itinerary.';
errors[3406] = 'SupplierCode must be unique. Please select another code or modify this one.';
errors[36] = 'You need to create an active package fare before building availability.';
errors[37] = 'You cant delete that fare class until all of its availability is sold or changed to another fare class.';
errors[38] = 'That package is sold out.';
errors[40] = 'Please make sure your information contains only numbers letters and the . -and @ characters.';
errors[41] = 'The number of comfort and coach seats you are creating do not match the airplane configuration.';
errors[42] = 'That flight is sold out.';
errors[44] = 'You cannot add additional flights to a waitlist itinerary.';
errors[45] = 'You cannot delete a flight while there are available seats.';
errors[47] = 'One of these passengers already exists in booking param1. All passengers must be unique.';
errors[48] = 'You need to create fares for that flight.';
errors[49] = 'You need to schedule flights.';
errors[50] = 'No rooms were found. Please try different dates or destination';
errors[50000] = 'Amount of checks to Agents cannot exceed balance due to them.';
errors[50001] = 'A check must have an amount greater than 0. No payments were made.';
errors[50002] = 'That check no already exists. Please review the checkbook. <br>If there are no payments due belowyou may have tried to submit the Transaction twice.';
errors[50003] = 'Amount of checks to suppliers cannot exceed balance due to them.';
errors[50005] = 'This transaction was posted successfully.';
errors[50006] = 'You must mark at least one item to make a payment.';
errors[50007] = 'You cannot have blank fields for the various amount types. Please use a 0 instead.';
errors[50008] = 'No payments have been received that have not already been refunded.';
errors[51] = 'There are no flights available for the time/date you chose. Please select a different timedate or airline.';
errors[52] = 'Maximum car rental term is 28 days. Please book additional cars for extended terms.';
errors[53] = 'No activities were found. Please try different datesarea or activity type.';
errors[54] = 'That seat is no longer available.';
errors[6] = 'Your session has expired. Sessions typically time out after 20 minutes.';
errors[60] = 'One of your selected dates does not exist.';
errors[60000] = 'A goal already exists for that month and year. Please use Edit Goals below to change the goal.';
errors[60004] = 'Please enter a name for the new region.';
errors[60005] = 'Please enter one or more zip codes to add to this region.';
errors[60007] = 'That booking does not exists. Please enter a valid booking number.';
errors[61] = 'Please select an area with a specific airport from the drop down or use the help list.';
errors[62] = 'Please select an area with a specific airport from the drop down or use the help list.';
errors[65] = 'This special is sold out on your selected dates.';
errors[69] = 'You can only have 1 flight in your itinerary at a time. <i>Hint: You may delete a flight and add another.</i>';
errors[7] = 'That memocode already exists. Please try another.';
errors[70] = 'The city that was found does not contain any airports.';
errors[80014] = 'Please build a rate for this activity before scheduling.';
errors[80015] = 'Please build activity categories and sub-categories before building activities.';
errors[923] = 'Please try a different name for your special service. The one you tried already exists.';
errors[96000] = 'This standby rate is currently in use.';
errors[96001] = 'This standby agent has dependents. You must delete the dependents first.';
errors[96002] = 'That rate name already exists. Please choose a different one.';
errors[96003] = 'Please create a standby rate first.';
errors[96004] = 'Please create a waitlist category first.';
errors[96005] = 'This waitlist category is being used by standby agents and/or their dependents.';
/*errors[AGENT_MUST_CHANGE_PASSWORD] = 'You must change your password.';
errors[AIR_SEARH_TOO_FAR_IN_FUTURE] = 'An air search can be a maximum of param1 days in the future. Part of this search is param2 days out.';
errors[AVAILABILITY_HOTEL_SOLD_OUT] = 'Sorrythere are no rooms available at this hotel.';
errors[BAD_AIRPORT_CODE_LIST] = 'At least one of the airport codes you have entered in invalid. Please check and try again.';
errors[CERT_CURRENCY_MUST_BE_SYSTEM_CURRENCY] = 'Itineraries with certificates must have customer currency same as system currency.';
errors[CHILD_AGE_OUT_OF_RANGE] = 'A childs age must be between param1 and param2 inclusivenot param3.';
errors[CHOICE_PROCESSOR_INDEX_OUT_OF_RANGE] = 'The selection you made does not exist. This can occur if you have multiple browsers open. The most recent availabiity display has your current options.';
errors[CREDIT_CARD_PROCESSOR_UNAVAILABLE] = 'The credit card payment processor is not available. Please try again later or call for assistance.';
errors[CRUISE_NO_RATES_FOUND] = 'No rates were found for this cruise.';
errors[DUPLICATE_GROUP_CODE_ENTERED] = 'The Group Code entered already exists. Please enter a different group code.';
errors[DUPLICATE_RECLOC] = 'The recloc and crs you entered are already being used by another booking.';
errors[ENTER_NEW_UNIQUE_PASSWORD] = 'Please use a new unique password';
errors[ERROR_POINTS_EXCEEDED] = 'You cannot use more points than you have available.';
errors[ERROR_SEATING_PASSENGERS] = 'An error occured while requesting seats. No seats have been reserved.';
errors[HOTEL_DETAILS_NOT_AVAILABLE] = 'Details for this hotel are not available at this time.';
errors[INVALID_BOOKING_NUMBER] = 'The Booking Number must be a numeric value.';
errors[INVALID_CARD_NUMBER] = 'This is not a valid credit card number. Please check the number and try again.';
errors[INVALID_EXPIRATION_DATE] = 'The expiration date is invalid. Please check the expiration date and try again.';
errors[INVALID_PROMOTION_CODE] = 'The promotion code you entered is invalid.';
errors[INVALID_REGION_FOR_POINTS] = 'You can only fly between valid regions for this redemption program.';
errors[LOGIN_FAILURE] = 'The information you provided did not match our records. Please try again or contact us.';
errors[MAX_LOGIN_ATTEMPT] = 'You are allowed 5 failed login attempts. Please wait 5 minutes before trying again.';
errors[MISSING_CURRENCY_CONVERSION] = 'There is no currency conversion named param1 for param2 to param3.';
errors[NEED_AT_LEAST_1_ADULT_OR_SENIOR] = 'You must have at least 1 adult or senior in your search.';
errors[NEED_SAME_NUM_PAX_ON_ALL_FLIGHTS] = 'All flights must have the same number of passengers.';
errors[NO_AREAS] = 'You must enter in an area to search.';
errors[NO_CRUISES_AVAILABLE] = 'There are no cruises available on that ship';
errors[NO_SUPPLIER] = 'You must first create a supplier to use this feature.';
errors[PASSWORD_CHANGE_COMPLETE] = 'Your password has been successfully changed.';
errors[PASSWORD_NOT_VALID] = 'Your password must have a combination of at least 7 numbers and letters.';
errors[PASSWORD_NOT_VALID_SEQ] = 'Passwords must not contain 3 sequential characters ex. 123 111AAA';
errors[SEARCH_NOT_FOUND] = 'Your search has expired. Please try again.';
errors[SEATING_FAILURE] = 'The seats you requested could not be reserved.';
errors[SESSION_TIMEOUT] = 'Your session has timed out. Please retry your search.';
errors[SHOW_HOTEL_DETAILS_FAILED] = 'Hotel information is not available at this time. Please search for hotel again.';
errors[SITE_ERROR] = 'A system error has occurred. System administrators have been notified. Please retry your request or <a href=""/service/contact.cfm"">contact us</a> directly for help with your reservation.<br>"
';
errors[TOO_CLOSE_TO_DEPARTURE] = 'This trip is too close to departure to book.';
errors[TOO_CLOSE_TO_DEPARTURE_ETICKET] = 'This trip is too close to departure to book.';
errors[TOO_CLOSE_TO_DEPARTURE_PAPER_TICKET] = 'This trip is too close to departure to bookmost likley because this trip cannot be ticketed electronically.';
errors[UNSUPPORTED_CREDIT_CARD] = 'The credit card you entered is unsupported.';
errors[UNSUPPORTED_EXCHANGE_RATE] = 'The currency param1cannot be converted to param2. Foreign exchange rate shanpshot id = param3.';
errors[UPDATE_COMPLETE] = 'Update complete.';
errors[VALUE_OUT_OF_RANGE] = 'The value you specified (param1) is out of range. It must be between param2 and param3.';
errors[YOU_MUST_HAVE_ADULT] = 'You must have at least 1 adult or senior in your search.';
errors[] = 'You must have at least 1 adult or senior in your search.';*/



function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function getURLParam(strParamName){
  var strReturn = "";
  var strHref = window.location.href;
  if ( strHref.indexOf("?") > -1 ){
    var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
    var aQueryString = strQueryString.split("&");
    for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
      if (
aQueryString[iParam].indexOf(strParamName + "=") > -1 ){
        var aParam = aQueryString[iParam].split("=");
        strReturn = aParam[1];
        break;
      }
    }
  }
  return strReturn;
  
}

function typeChange() {	
	captions = new Array();
	captionKeys  = new Array();
captionKeys[0] = 'area1';
captionKeys[1] = 'area2';
captionKeys[2] = 'date1';
captionKeys[3] = 'date2';
captionKeys[4] = 'adults';
captionKeys[5] = 'child_age1';
captionKeys[6] = 'child_age2';
captionKeys[7] = 'child_age3';
captionKeys[8] = 'serviceclass';
captionKeys[9] = 'num_rooms';
captionKeys[10] = 'time1';
captionKeys[11] = 'time2';
captionKeys[12] = 'car_type';
captionKeys[13] = 'roundtrip';
captionKeys[14] = 'dynamic_children';
captionKeys[15] = 'seniors';
	for (i=0; i<captionKeys.length; i++){ 
		captions[captionKeys[i]] = new Array();
	}

captions['area1']['f'] = 'Departing from:';
captions['area1']['h'] = '';
captions['area1']['c'] = '';
captions['area1']['fh'] = 'Leaving From:';
captions['area1']['fhc'] = 'Leaving From:';
captions['area1']['fc'] = 'Leaving From :';
captions['area2']['f'] = 'Going To:';
captions['area2']['h'] = 'Destination:';
captions['area2']['c'] = 'Pick-up Location:';
captions['area2']['fh'] = 'Going To:';
captions['area2']['fhc'] = 'Going To:';
captions['area2']['fc'] = 'Going To :';
captions['date1']['f'] = 'Depart:';
captions['date1']['h'] = 'Check-in:';
captions['date1']['c'] = 'Pick-up:';
captions['date1']['fh'] = 'Departing :';
captions['date1']['fhc'] = 'Departing :';
captions['date1']['fc'] = 'Departing :';
captions['date2']['f'] = 'Return:';
captions['date2']['h'] = 'Check-out:';
captions['date2']['c'] = 'Drop-Off:';
captions['date2']['fh'] = 'Returning:';
captions['date2']['fhc'] = 'Returning:';
captions['date2']['fc'] = 'Returning :';
captions['adults']['f'] = 'Adults:';
captions['adults']['h'] = 'Adults:';
captions['adults']['c'] = '';
captions['adults']['fh'] = 'Adults:';
captions['adults']['fhc'] = 'Adults:';
captions['adults']['fc'] = 'Adults :';
captions['child_age1']['f'] = ' ';
captions['child_age1']['h'] = 'Children:';
captions['child_age1']['c'] = '';
captions['child_age1']['fh'] = ' ';
captions['child_age1']['fhc'] = ' ';
captions['child_age1']['fc'] = ' :';
captions['child_age2']['f'] = ' ';
captions['child_age2']['h'] = ' ';
captions['child_age2']['c'] = ' ';
captions['child_age2']['fh'] = ' ';
captions['child_age2']['fhc'] = ' ';
captions['child_age2']['fc'] = ' ';
captions['child_age3']['f'] = ' ';
captions['child_age3']['h'] = ' ';
captions['child_age3']['c'] = ' ';
captions['child_age3']['fh'] =  ' ';
captions['child_age3']['fhc'] = ' ';
captions['child_age3']['fc'] = ' :';
captions['serviceclass']['f'] = 'Service Class:';
captions['serviceclass']['h'] = '';
captions['serviceclass']['c'] = '';
captions['serviceclass']['fh'] = 'Service Class:';
captions['serviceclass']['fhc'] = 'Service Class:';
captions['serviceclass']['fc'] = 'Service Class:';
captions['num_rooms']['f'] = '';
captions['num_rooms']['h'] = 'Number of rooms:';
captions['num_rooms']['c'] = '';
captions['num_rooms']['fh'] = 'Number of rooms:';
captions['num_rooms']['fhc'] = 'Number of rooms:';
captions['num_rooms']['fc'] = '';
captions['time1']['f'] = '';
captions['time1']['h'] = '';
captions['time1']['c'] = 'Pick-up Time:';
captions['time1']['fh'] = '';
captions['time1']['fhc'] = '';
captions['time1']['fc'] = '';
captions['time2']['f'] = '';
captions['time2']['h'] = '';
captions['time2']['c'] = 'Drop-Off Time:';
captions['time2']['fh'] = '';
captions['time2']['fhc'] = '';
captions['time2']['fc'] = '';
captions['car_type']['f'] = '';
captions['car_type']['h'] = '';
captions['car_type']['c'] = 'Car Type:';
captions['car_type']['fh'] = '';
captions['car_type']['fhc'] = '';
captions['car_type']['fc'] = '';
captions['roundtrip']['f'] = 'Round Trip:';
captions['roundtrip']['h'] = '';
captions['roundtrip']['c'] = '';
captions['roundtrip']['fh'] = '';
captions['roundtrip']['fhc'] = '';
captions['roundtrip']['fc'] = '';
captions['dynamic_children']['f'] = 'Children:';
captions['dynamic_children']['h'] = '';
captions['dynamic_children']['c'] = '';
captions['dynamic_children']['fh'] = 'Children:';
captions['dynamic_children']['fhc'] = 'Children:';
captions['dynamic_children']['fc'] = 'Children:';
captions['seniors']['f'] = 'Seniors:';
captions['seniors']['h'] = '';
captions['seniors']['c'] = '';
captions['seniors']['fh'] = 'Seniors:';
captions['seniors']['fhc'] = 'Seniors:';
captions['seniors']['fc'] = 'Seniors:';

	if (document.form_arc_packages.air1 == null)
		return false;
	document.form_arc_packages.air1.value= "false";	
	document.form_arc_packages.room1.value= "false";
	document.form_arc_packages.car1.value= "false";

	document.form_arc_packages.child_age1.options[0] = new Option('Under 2','1');
	document.form_arc_packages.child_age2.options[0] = new Option('Under 2','1');
	document.form_arc_packages.child_age3.options[0] = new Option('Under 2','1');
	
	for (i=0; i<document.form_arc_packages.book_type.length; i++){
		if(document.form_arc_packages.book_type[i].checked) 
			var bookType = document.form_arc_packages.book_type[i].value;
	}
	
	if (bookType == null)
	{
		document.form_arc_packages.book_type[0].checked = true;
		bookType = 'f';
	}
	if (bookType == 'f') {
		document.form_arc_packages.air1.value= "true";
	}
	if (bookType == 'h') {
		document.form_arc_packages.room1.value= "true";
		document.form_arc_packages.discount_code.value= "amh051";
		document.form_arc_packages.child_age1.options[0] = new Option('n/a','-1');
		document.form_arc_packages.child_age2.options[0] = new Option('n/a','-1');
		document.form_arc_packages.child_age3.options[0] = new Option('n/a','-1');
		document.form_arc_packages.child_age1.options[0].selected = true;
		document.form_arc_packages.child_age2.options[0].selected = true;
		document.form_arc_packages.child_age3.options[0].selected = true;

//		document.form_arc_packages.dynamic_children.value=3;
	}
	if (bookType == 'c') {
		document.form_arc_packages.car1.value= "true";
		document.form_arc_packages.discount_code.value= "amh051";
		document.form_arc_packages.dynamic_children.value=0;
	}
	if (bookType == 'fh'){
		document.form_arc_packages.air1.value= "true";
		document.form_arc_packages.room1.value= "true";
		document.form_arc_packages.discount_code.value= "amh052";
	}
	if (bookType == 'fhc') {
		document.form_arc_packages.air1.value= "true";
		document.form_arc_packages.room1.value= "true";
		document.form_arc_packages.car1.value= "true";
		document.form_arc_packages.discount_code.value= "amh052";
	}
	if (bookType == 'fc') {
		document.form_arc_packages.air1.value= "true";
		document.form_arc_packages.car1.value= "true";
		document.form_arc_packages.discount_code.value= "amh052";
	}
	for (i=0; i<captionKeys.length; i++){ 
		key = captionKeys[i];		
		captionElement = document.getElementById('cap_'+key);
		divElement = document.getElementById('div_'+key);
		if (captionElement !== null)
			captionElement.innerHTML = captions[key][bookType];	
		if (divElement !== null){		
			if (captions[key][bookType] == '') {				
				divElement.style.display = 'none';
			} else {				
				divElement.style.display = 'block';
			}
		}

	}

	
	childrenChange(document.form_arc_packages.child_age1, 'div_infant1');
	childrenChange(document.form_arc_packages.child_age2, 'div_infant2');
	childrenChange(document.form_arc_packages.child_age3, 'div_infant3');
	changeChildrenNumber();
	fixAddInfoBox();

}

function childrenChange(selectElement, divElementId) {
	divElement = document.getElementById(divElementId);
	if (selectElement.value == 1)
	{
		divElement.style.display = 'block';
	} else {
		divElement.style.display = 'none';
	}
	fixAddInfoBox();
}

function selectTab() {
	document.getElementById('home').className = 'navigationBlur';
	document.getElementById('a').className = 'navigationBlur';
	document.getElementById('r').className = 'navigationBlur';
	document.getElementById('c').className = 'navigationBlur';
	document.getElementById('aa').className = 'navigationBlur';
	document.getElementById('act').className = 'navigationBlur';

	document.getElementById('touring').className = 'navigationBlur';
	document.getElementById('cruising').className = 'navigationBlur';
	document.getElementById('flydrives').className = 'navigationBlur';
	document.getElementById('specials').className = 'navigationBlur';
	document.getElementById('des').className = 'navigationBlur';

	selectedTab = getURLParam('tab');
	var filename =location.pathname.substring(location.pathname.lastIndexOf('/')+1);
	
	if (filename == 'destination.htm')
		selectedTab = 'des';		
	if (filename == 'touring.htm')
		selectedTab = 'touring';
	if (filename == 'cruising.htm')
		selectedTab = 'cruising';
	if (filename == 'flydrives.htm')
		selectedTab = 'flydrives';
	if (filename == 'specials.htm')
		selectedTab = 'specials';
	if (filename == 'contact.htm')
		selectedTab = 'contact';
	
	tabElement = document.getElementById(selectedTab);
	if (tabElement != null)
	{
		tabElement.className = 'navigationFocus';
	} else {

		document.getElementById('home').className = 'navigationFocus';
	}
}

function changeChildrenNumber() {	
	for (i=0; i<document.form_arc_packages.book_type.length; i++){
		if(document.form_arc_packages.book_type[i].checked) 
			var bookType = document.form_arc_packages.book_type[i].value;
	}
	numChildren = document.form_arc_packages.dynamic_children.value;
	if (bookType == 'h') {	
		numChildren = 3;		
	}
	if (bookType == 'c')
		numChildren = 0;	
		
//	alert(numChildren);
	document.getElementById('div_childage1').style.display = 'none';
	document.getElementById('div_childage2').style.display = 'none';
	document.getElementById('div_childage3').style.display = 'none';
	for (i=1; i<=numChildren; i++ )
	{
		document.getElementById('div_childage'+i).style.display = 'block';
	}
	fixAddInfoBox();
}

function fixAddInfoBox () {	
	mainDiv = document.getElementById('bookIt');
	infoDiv = document.getElementById('addInfoBox');
	searchDiv = document.getElementById('bookItSearch');
	infoPos = findPos(infoDiv);
	searchPos = findPos(searchDiv);
	mainHeight = mainDiv.offsetHeight;
	divHeight = searchPos[1] - infoPos[1];
	lineHeight = 17;
	for (i=0; i<document.form_arc_packages.book_type.length; i++){
		if(document.form_arc_packages.book_type[i].checked) 
			var bookType = document.form_arc_packages.book_type[i].value;
	}
	lineChars = 45;
	lines = Math.floor(divHeight / lineHeight) -1;
	maxChars = lineChars * lines;
	if (lines == 1)
		maxChars = 0;
	textLink = '<a href="http://www.americanholidays.com/content/amhols/esta.htm" class="presslink"><br><center>ESTA VISA INFORMATION</center></a>';
	text = infoArr[bookType] ;
	text = '<div class="textContainer"> ' + text.substring(0, maxChars) +  ' </div>' +'' + textLink;
	error = getURLParam('error');
	if (error != '')
	{	
		if (error=='display'){
			error_message = getURLParam('error_message');			
			if (error_message.substr(0, 19) == 'you%20must%20delete')
				text = '<div class="alertContainer"> <img src="/content/amhols/images/error.gif" width="15" height="15"> '+ 'You must delete existing air selection prior to searching for air again <a href="http://www.americanholidays.com/travel/itinerary_clear.cfm?redirect_url=http://www.americanholidays.com/content/amhols/index.html">Please click here to search again</a>'	+'&nbsp;<img src="/content/amhols/images/error.gif" width="15" height="15">' +'</div>';
			else 
				text = '<div class="alertContainer"> <img src="/content/amhols/images/error.gif" width="15" height="15"> '+unescape(error_message) +'&nbsp;<img src="/content/amhols/images/error.gif" width="15" height="15">'	+'</div>';
		} else
			text = '<div class="alertContainer"> <img src="/content/amhols/images/error.gif" width="15" height="15"> '+errors[error] +'&nbsp;<img src="/content/amhols/images/error.gif" width="15" height="15">'+'</div>';
	}
	infoDiv.innerHTML = text;
//	mainDiv.style.display = 'table-cell';
	//mainDiv.innerheight = '310px';
}


function openWindow() { 
popupWin = window.open('http://', 'remote', 'width=300,height=400')
}

var newwindow;
function poptastic(url)
{
	newwindow=window.open(url,'name','height=600,width=650,resizable=yes,scrollbars=yes,toolbar=1,menubar=1');
	if (window.focus) {newwindow.focus()}
}
function rte(url)
{
	newwindow=window.open(url,'name','height=650,width=450,resizable=no,scrollbars=no,toolbar=0,menubar=0');
	if (window.focus) {newwindow.focus()}
}
function poptransat(url)
{
	newwindow=window.open(url,'name','height=675,width=800,resizable=no,scrollbars=no,toolbar=0,menubar=0');
	if (window.focus) {newwindow.focus()}
}


function switchMailerDiv (){
	formElement = document.getElementById('mailersContainer');
	linkElement = document.getElementById('mailersLink');
	formElement.style.display = 'inline';
	linkElement.style.display = 'none';
}

function mailersFocus() {
//	Enter your email address
	if (document.mailersForm.email.value == 'Enter your email address')
		document.mailersForm.email.value = '';	
}

function mailersBlur () {
	if (document.mailersForm.email.value == '')
		document.mailersForm.email.value = 'Enter your email address';
	
}

//FAQ Section
function switchFaqDiv (faqId){
	for (i=1; i<23; i++) {
		answerDiv = document.getElementById('answer_'+i);
		if (answerDiv != null && faqId != i)
			answerDiv.style.display='none';
	}

	answerDiv = document.getElementById('answer_'+faqId);
	if (answerDiv != null) {
		if (answerDiv.style.display == 'none') 
			answerDiv.style.display = 'block';
		else 
			answerDiv.style.display='none';
	}
}


