﻿var timeTemp;
var sysMsg = 0;

function cancelTimeout() {
	window.clearTimeout(timeTemp);
	hideModalTip();
	sysMsg = 0;
}

// Function to display msg`s from xml files
function displayXmlMsgImp_custom(http_request) {
	if ((http_request.readyState == 4) && (http_request.status == 200)) {
		var xmldoc = http_request.responseXML;

		if(xmldoc.getElementsByTagName("msg")[0] != null) {
			var msg = xmldoc.getElementsByTagName("msg")[0].childNodes[0].nodeValue;
			var importance = xmldoc.getElementsByTagName("imp")[0].childNodes[0].nodeValue;
			var time = xmldoc.getElementsByTagName("time")[0].childNodes[0].nodeValue;

			showAlertToolTip(document.getElementById('messagePlaceHolder'), msg, 0, 0, time, null, importance, 1, 1);

			if(importance == 0) {
				if(sysMsg) {
					document.body.onmousewheel = cancelTimeout;
				}
			}
		} else {
			hideBallonToolTips();
		}
	}
}

// Check if can show msg
function avaliateMsgImportance_custom(msg, importance) {
	getXMLHTTPRequest();

	if (http_request) {
		http_request.onreadystatechange = function() { displayXmlMsgImp_custom(http_request); };
		http_request.open('GET', '../Extranet/sysMsgImp_xml.cfm?msg=' + msg + '&imp=' + importance + '&bustcache=' + new Date().getTime(), false);
		http_request.send(null);
	}
}

// Change the settings of low messages
function stopLowMessage_custom(extUser) {
	getXMLHTTPRequest();

	if (http_request) {
		http_request.onreadystatechange = function() { if((typeof(pagIdUrl) != 'undefined') && (typeof(pagIdToStopMsgs) != 'undefined') && (pagIdUrl == pagIdToStopMsgs)) { if(document.form.pagLowMsg) { document.form.pagLowMsg[1].checked = true; cancelTimeout(); } } };

		if(extUser != null && typeof(pagIdToStopMsgs) != 'undefined') {
			http_request.open('GET', '../Extranet/stopLowMessage_xml.cfm?pagId=' + pagIdToStopMsgs + '&extUser=1&bustcache=' + new Date().getTime(), false);
		}
		http_request.send(null);
	}
}

// Show an alert type tooltip with obj centered, text, and the following optionional parameteres width, height, and timeToDisapear
function showAlertToolTip(obj, text, tooltipWidth, tooltipHeight, timeToDisapear, fromMap, msgImportance) {	
	var msgHeight = screen.height;
	var textTip = '';
	var titleTip = 'System Message';
	var maxWidth = 450;
	var maxHeight = 100;
	var onEscKillToolTip = true;

	if(tooltipWidth != 'undefined' && tooltipWidth != null && tooltipWidth != 0)
		maxWidth = tooltipWidth;
	if(tooltipHeight != 'undefined' && tooltipHeight != null && tooltipHeight != 0)
		maxHeight = tooltipHeight;
		
	// If message importance is 0 (not importante)
	if(msgImportance != null && msgImportance == 0) {
		hideBallonToolTips();
	} else {
		onEscKillToolTip = false;
	}

	// System Messages, not called from mapNewPoint_popUp.
	if (!fromMap) {	
		// IF not called from mapNewPoint_popUp page, display this block as a system message ('Information has been Updated!')
		// Else show only the text, that is the html called in the call of the newMapPoint_popUp page
		textTip += '<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" BORDER="0" CLASS="appContent" WIDTH="100%"><TR HEIGHT="55"><TD WIDTH="8%" ALIGN="center" VALIGN="top">';
			if(msgImportance != null && msgImportance == 0) {
				textTip += '<IMG SRC="../intranet/images/low_importance.png" WIDTH="30" HEIGHT="30" BORDER="0" ALIGN="absmiddle">';
			} else {
				textTip += '<IMG SRC="../intranet/images/high_importance.png" WIDTH="30" HEIGHT="30" BORDER="0" ALIGN="absmiddle">';
			}
		textTip += '</TD><TD ALIGN="left" VALIGN="middle">';
			textTip += text;
		textTip += '</TD></TR>';

		if(msgImportance != null && msgImportance == 0) {
			textTip += '<TR><TD COLSPAN="2" BGCOLOR="#808080" STYLE="padding: 5px;">';
				textTip += '<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" BORDER="0" CLASS="appContent" WIDTH="100%">';
				textTip += '<TR><TD ALIGN="right" STYLE="color: #FFFFFF;">';
					textTip += 'Stop showing low priority messages';
				textTip += '</TD><TD WIDTH="20">';
					textTip += '<INPUT CLASS="frmFlds" TYPE="checkbox" NAME="stopLowMessage" SIZE="10" MAXLENGTH="10" STYLE="background-color: #808080;" ONCLICK="alert(\'Low priority messages have been turned off. To see them again, navigate to: &raquo; System &raquo; Users &raquo; Own Detail, and select to display Low Importance Messages in the System Messages section.\'); stopLowMessage();">';
				textTip += '</TD></TR>';
				textTip += '</TABLE>';
			textTip += '</TD></TR>';
		}
		textTip += '</TABLE>';
	// Called from mapNewPoin_popUp.
	} else {
		if(fromMap == 'mapAddress') {
			titleTip = 'Search on Map';
		} else {
			titleTip = 'Instructions';
		}
		textTip += '<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" BORDER="0" CLASS="appContent" WIDTH="100%">';
		textTip += '<TR><TD>';
			textTip += text;
		textTip += '</TD></TR>';
		textTip += '</TABLE>';
	}

	// When tooltip is clicked, close it or not, depending on the sys messages importance
	var clickClose_ = false;
	if(msgImportance != null && msgImportance == 0) {
		clickClose_ = true;
		document.body.onmousewheel = cancelTimeout;
	}

	showModalTip([
		'ttpHtml', textTip,
		'ttpObj', document.getElementById('messagePlaceHolder'),
		'ttpWidth', maxWidth,
		'ttpHeight', maxHeight,
		'ttpOnCloseBtn', 'cancelTimeout();',
		'ttpOnClickClose', clickClose_,
		'ttpName', 'SystemMsg',
		'ttpTimeToDisapear', ((timeToDisapear != null && timeToDisapear != '0' && msgImportance == '0')? timeToDisapear: null),
		'ttpPointerAlign', document.body.scrollTop,
		'ttpHeaderTitle', titleTip,
		'ttpOnEscKillToolTip', onEscKillToolTip
	]);

	sysMsg = 1;

	// After the message is displayed, this will delete the session.message
	getXMLHTTPRequest();

	if (http_request) {
	 	http_request.open("GET", "../intranet/deleteMessageSession_xml.cfm?bustcache=" + new Date().getTime(), false);
	 	http_request.send(null);
	}
}




/*
	Tooltip For suport System Types
	
	@formHtml
	@obj
	@headerTitle
	@currToolWidth
	@ttpScrollDivId	
	@errorImgArray	
**/
function displayTooltip_supSysTypes(formHtml, obj, headerTitle,toolWidth, ttpScrollDivId, errorImgArray ){ 

        var currToolWidth = 300;
        var currErrorImgArray = [];
        var currTtpScrollDivId = null;
        
        if(errorImgArray != 'undefined' && errorImgArray != null) currErrorImgArray = errorImgArray;
        if(toolWidth != 'undefined' && toolWidth != '') currToolWidth = toolWidth;
        if(ttpScrollDivId != 'undefined' && ttpScrollDivId != null) currTtpScrollDivId = ttpScrollDivId;

	return showToolTipBallon([
		'ttpHtml', formHtml,
		'ttpObj', obj,
		'ttpPointer', true,				
		'ttpHeaderTitle', headerTitle,
		'ttpPointerAuto', true,
		'ttpShadow', true,		
		'ttpUnique', false,
		'ttpScrollDivId' , ttpScrollDivId,
		'ttpWidth', currToolWidth,		
		'ttpErrorImgs', currErrorImgArray,
	]);
}

function displayCustomToolTip(formHtml, obj, pointer, objX, objY, opacity, clickClose, tableWidth, tableVAlign, headerTitle, toolWidth, hPointerPadding, vPointerPadding, portal, topBtnCloseEvt, errorImgArray, toolTipAutoPos, toolTipShadow, ttpMainTableId, ttpScrollDivId) {
	var currTableVAlign = 'bottom';
	var currTableWidth = 100;
	var currObjX = 0;
	var currObjY = 0;
	var currOpacity = 97;
	var html = '';
	var currPointer = '';
	var currClickClose = false;
	var currHeaderTitle = '';
	var currToolWidth = 300;
	var currHPointerPadding = '';
	var currVPointerPadding = '';
	var ttpPointerAlign = null;
	// 0 - intranet/extranet; 1 - internet
	var currPortal = 0;
	var currTopBtnCloseEvt = '';
	var currErrorImgArray = [];
	var currToolTipAutoPos = true;
	var currToolTipShadow = false;
	var currTtpMainTableId = 'borderTable';
	var currTtpScrollDivId = null;

	if(tableVAlign != 'undefined' && tableVAlign != null) currTableVAlign = tableVAlign;
	if(tableWidth != 'undefined' && tableWidth != null) currTableWidth = tableWidth;
	if(objX != 'undefined' && objX != null) currObjX = objX;
	// if(objY != 'undefined' && objY != null) currObjY = objY - 120;
	if(objY != 'undefined' && objY != null) currObjY = objY;
	if(opacity != 'undefined' && opacity != null) currOpacity = opacity;
	if(pointer != 'undefined' && pointer != null) currPointer = pointer;
	if(clickClose != 'undefined' && clickClose != null) currClickClose = clickClose;
	if(headerTitle != 'undefined' && headerTitle != '' && headerTitle != null) currHeaderTitle = headerTitle;
	if(toolWidth != 'undefined' && toolWidth != '') currToolWidth = toolWidth;
	if(hPointerPadding != 'undefined' && hPointerPadding != null && hPointerPadding != 0) {
		ttpPointerAlign = hPointerPadding;
	} else if(vPointerPadding != 'undefined' && vPointerPadding != null && vPointerPadding != 0) {
		ttpPointerAlign = vPointerPadding;
	}
	if(portal != 'undefined' && portal != null) currPortal = portal;
	if(topBtnCloseEvt != 'undefined' && topBtnCloseEvt != null) currTopBtnCloseEvt = escape(topBtnCloseEvt);
	if(errorImgArray != 'undefined' && errorImgArray != null) currErrorImgArray = errorImgArray;
	if(toolTipAutoPos != 'undefined' && toolTipAutoPos != null) currToolTipAutoPos = toolTipAutoPos;
	if(toolTipShadow != 'undefined' && toolTipShadow != null) currToolTipShadow = toolTipShadow;
	if(ttpMainTableId != 'undefined' && ttpMainTableId != null) currTtpMainTableId = ttpMainTableId;
	if(ttpScrollDivId != 'undefined' && ttpScrollDivId != null) currTtpScrollDivId = ttpScrollDivId;

	// If tooltip auto position is true then ignore padding
	if(currToolTipAutoPos) {
		ttpPointerAlign = null;
	}

	showToolTipBallon([
		'ttpHtml', formHtml,
		'ttpObj', obj,
		'ttpPointer', true,
		'ttpPointerPosition', currPointer,
		'ttpPointerAlign', ttpPointerAlign,
		'ttpX', currObjX,
		'ttpY', currObjY,
		'ttpOnClickClose', currClickClose,
		'ttpHeaderTitle', currHeaderTitle,
		'ttpWidth', currToolWidth,
		'ttpErrorImgs', currErrorImgArray,
		'ttpPointerAuto', currToolTipAutoPos,
		'ttpShadow', currToolTipShadow,
		'ttpMainTableId', currTtpMainTableId,
		'ttpPortal', currPortal,
		'ttpScrollDivId', currTtpScrollDivId
	]);
}

// Custom function to position the tooltip
function positionToolTip(objX, objY, objName) {
	tt_SetTipPos(objX, objY);
}

// ////////////////////////////////// //
// /// Begin - Currencies Gadject /// //
// ////////////////////////////////// //
function makeRequestGetCurrencies(obj, value, portal) {
	getXMLHTTPRequest();

	if (http_request) {
		var pos = 0;
		var partInt = 0;
		var partDecimal = 0;

		// if first character of the value is not a number then remove the first caracter form the value
		if(isNaN(String(value).charAt(0)))
			value = String(value).substring(1, String(value).length);

		if(isNaN(String(value).charAt(0))) {
			alert('This value is not a currency!');
		} else {
			// if value brings , instead a . then replace with .
			if(String(value).indexOf(",") != -1)
				value = value.replace(",", ".")

			// get integer part
			pos = String(value).indexOf(".");
			if(pos != -1) {
				partInt = String(value).substring(0, pos);
				partDecimal = String(value).substring(pos + 1, String(value).length);
			} else {
				partInt = String(value);
				partDecimal = 00;
			}

			http_request.onreadystatechange = function() { displayCurrenciesTip(obj, value, http_request, portal); }
			http_request.open('GET', '../supsystems/curSrch_xml.cfm?action=getCurrencies&partInt=' + partInt + '&partDecimal=' + partDecimal + '&bustcache=' + new Date().getTime(), false);
			http_request.send(null);
		}
	}
}

// Custom tool tip to the currencies convertes
function displayCurrenciesTip(obj, value, portal) {
	if(http_request.readyState == 4 && http_request.status == 200) {
		var xmldoc = http_request.responseXML;

		if (xmldoc.getElementsByTagName("root")[0]) {
			var currencies = xmldoc.getElementsByTagName('currencies')[0].getElementsByTagName('currency');
			var currLen = currencies.length;

			var html = '';

			html += '<TABLE CLASS="appContent" CELLPADDING="0" CELLSPACING="0" BORDER="0">';
			if(currLen == 0) {
				html += '<TR CLASS="regTextSml"><TD VALIGN="top" WIDTH="250" ALIGN="center">';
					html += 'No currencies available in the system.';
				html += '</TD></TR>';
			} else {
				html += '<TR CLASS="regTextSml"><TD VALIGN="top" WIDTH="250" ALIGN="left">';
					if (navigator.appName == "Microsoft Internet Explorer") {
						html += value + ' ' + xmldoc.getElementsByTagName('currencies')[0].getElementsByTagName('defaultCurrency')[0].text + ' equals';
					} else {
						html += value + ' ' + xmldoc.getElementsByTagName('currencies')[0].getElementsByTagName('defaultCurrency')[0].childNodes[0].nodeValue + ' equals';
					}
				html += '</TD></TR><TR><TD VALIGN="top" WIDTH="250" ALIGN="center">';
					html += '<TABLE CLASS="appContent" CELLPADDING="0" CELLSPACING="0" WIDTH="100%" BORDER="0">';
						for(i = 0; i < currLen; i++) {
							html += '<TR CLASS="regTextSml"' + ((i % 2 != 0)? 'STYLE="background-color: #ECECEC;"': '') + '><TD WIDTH="10%">&nbsp;</TD><TD ALIGN="right">';
								html += '<IMG SRC="../intranet/images/flags/' + currencies[i].getAttribute("flag") + '.png" TITLE="' + currencies[i].getAttribute("abr") + '" ALT="' + currencies[i].getAttribute("abr") + '" WIDTH="16" HEIGHT="11" BORDER="0" ALIGN="absmiddle" STYLE="cursor: default;">&nbsp;&nbsp;';
							html += '</TD><TD NOWRAP>';
								html += currencies[i].getAttribute("abr");
							html += '</TD><TD ALIGN="right">';
								if (navigator.appName == "Microsoft Internet Explorer") {
									html += currencies[i].text;
								} else {
									html += currencies[i].childNodes[0].nodeValue;
								}
							html += '</TD><TD WIDTH="10%">&nbsp;</TD></TR>';
						}
				html += '</TABLE>';
			}
			html += '</TABLE>';

			var portal = 0;
			if(portal != 0) {
				portal = 1;
			}

			showToolTipBallon([
				'ttpHtml', html,
				'ttpObj', obj,
				'ttpPointer', true,
				'ttpPointerPosition', 'UpRight',
				'ttpOnClickClose', true,
				'ttpHeaderTitle', 'Currencies:',
				'ttpWidth', 200,
				'ttpPointerAuto', true,
				'ttpPortal', portal
			]);
		} else {
			alert("There was a problem with the request.");
		}
	}
}

function ObjectPosition(obj) {
	var curleft = 0;
	var curtop = 0;

	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}
	return [curleft,curtop];
}
// //////////////////////////////// //
// /// End - Currencies Gadject /// //
// //////////////////////////////// //

// Display Message Error
function displayMsgErrorToolTip(msg, obj) {
	var msgWidth = 200;
	var output = '';

	output += '<TABLE CLASS="appContent regTextMed" CELLPADDING="0" CELLSPACING="0" WIDTH="100%" BORDER="0">';
	output += '<TR><TD ALIGN="left" WIDTH="' + msgWidth + '" NOWRAP>' + msg + '</TD></TR></TABLE>';

	// check if it's an internet or an intranet page (the table with the ID 'borderTable' only exist on the intranet)
	//if(window.parent.$("#borderTable")) {
		//if(window.parent.$("#borderTable").width()){
	if($("#borderTable")) {
		if($("#borderTable").width()) {
			// intranet 
			/* var docWidth = window.parent.$(window).width();
			var contentWidth = window.parent.$("#borderTable").width();
			var contentLeft = window.parent.$("#borderTable").offset().left;
			var menuWidth = window.parent.$("#GTTMenu").width(); */

			var docWidth = $(window).width();
			var contentWidth = $("#borderTable").width();
			var contentLeft = $("#borderTable").offset().left;
			var menuWidth = $("#GTTMenu").width();
		} else {
			// internet
			var docWidth = window.parent.$(window).width();
			var contentWidth = $("table:first").width();
			var contentLeft = $("table:first").offset().left;
			var menuWidth = 0;
		}

		var objPosLeft = $(obj).offset().left;
		var tipTopPos = $(obj).offset().top + 8;

		// check if there's a parent window (if the window ids are the same, there's none)
		// and set displayingOnTheRight as true or false
		if(window.id == window.parent.id){
			var displayingOnTheRight = (objPosLeft) > (contentLeft + (contentWidth / 2));
		} else {
			var displayingOnTheRight = objPosLeft > docWidth / 2;
		}

		switch(displayingOnTheRight){
			case false:
				// displaying on the left side
				var tipLeftPos = objPosLeft - 2;
				//var pointerPadding = 195; // contentLeft + menuWidth + msgWidth - objPosLeft;
				var pointerType = 'UpLeft';

				break;
			case true:
			default:
				// displaying on the right side or on the middle
				var tipLeftPos = objPosLeft - 210;
				//var pointerPadding = 0; // (tipLeftPos + 200) - objPosLeft - 2;
				var pointerType = 'UpRight';
				break;
		}

		// displaying on the left side
		var pointerPadd = -4;
		//var pointerType = 'UpLeft';
		// displaying on the right side or on the middle
		if(displayingOnTheRight) {
			pointerPadd = -14;
			//pointerType = 'UpRight';
		}

		showToolTipBallon([
			'ttpHtml', output,
			'ttpObj', obj,
			'ttpX', tipLeftPos,
			'ttpY', tipTopPos,
			'ttpPointer', true,
			'ttpPointerPosition', pointerType,
			'ttpPointerAlign', pointerPadd,
			'ttpOnClickClose', true,
			'ttpHeaderTitle', 'Error Message',
			'ttpWidth', msgWidth,
			'ttpPointerAuto', false
		]);
	} else {
		showToolTipBallon([
			'ttpHtml', output,
			'ttpObj', obj,
			'ttpPointer', true,
			'ttpOnClickClose', true,
			'ttpHeaderTitle', 'Error Message',
			'ttpWidth', msgWidth,
			'ttpPointerAuto', true
		]);
	}
}

// General help tooltip
function displayHelpTooltip(obj,title,tableWidth,pointer,objX,objY,hPointerPadding,vPointerPadding,var1,var2,portal){
	// Get 'caller' page name
	var callerPage = window.location.pathname.toLowerCase();
	var currPortal = 0;

	if(portal != 'undefined' && portal != null) currPortal = portal;

	if(tableWidth == null || tableWidth == ''){
		tableWidth = 450;
	}

	var output = '<TABLE CLASS="appContent" CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="' + tableWidth + 'px"><TR CLASS="regTextMed"><TD>';

	switch(title){
		case 'Valid Survey':
			output += 'A Survey is considered <B>Valid</B> when it contains no empty pages or empty sections.';
			break;
		case 'Survey Link':
			output += '<P>The <B>Survey Link</B> is automatically included in the body of the email and will take the individual to the survey.</P>';
			break;
		case 'Event type':
			output += '<B>Select "Without Segments" for:</B><BR>';
			output += '<UL><LI>Single Destination Events - the travelers will overnight in only one destination. Please note that if you are offering multiple hotel selections within a single destination city, this still qualifies as Single Destination and can be built Without Segments.</LI><BR>';
			output += '<LI>For Cruises, <U>except</U> when the cruise has <U>an included</U> pre or post stay at a hotel. If you are offering an optional pre or post hotel stay with the cruise, you may build the cruise Without Segments. Use the pre and post nights function to add optional pre and post stay nights.</LI><BR></UL>'
			output += '<B>Select "With Segments" for:</B><BR><UL>';
			output += '<LI>Events with Multiple Destinations - the travelers will overnight in more than one destination.</LI><BR>';
			output += '<LI>For Cruises with pre or post stay nights at a hotel and they are included (ie. Not optional).</LI><BR></UL>';
			output += 'Please note that these are general guidelines and there may be some exceptions. Please contact your Support person for more information about these options. Also please note that Cruises and "With Segment" events require separate training from the Non-Cruise and "Without Segment" events. If you are building these types of events and did not yet receive training for them, please contact your GroupMInder Support person.';
			break;
		case 'Date types':
			output += '<B>Admin Dates</B> are used only for the Event Building process. All Vendor Products are retrieved for the Event based upon the defined Admin Dates.';
			output += " The Admin Dates must encompass all the dates for your Vendor Products for this Event. This Event's segments and packages must also be created ";
			output += 'within the Admin Date Range.<P><B>Display Dates</B> are the dates that customers and agents will see on the Choose Event page and other reservation pages ';
			output += 'for this Event.<P><B>Why separate fields for Display and Admin Dates?</B> Occasionally, you may have to increase your Admin Event Date Range to accommodate ';
			output += 'special requests by a few customers for extended stays or to accommodate an early arrival for a staff person, for example. These extended date ranges must be ';
			output += 'reflected in the Admin Date in order to build the appropriate products, segments, and packages. However, the Display Date can still reflect the actual advertised Event Date range.';
			break;
		case 'Child Age Limit':
			output += 'Use this field to define the highest age at which an individual can be considered a child for pricing purposes. For example, if you enter 20, then all individuals';
			output += ' under and including 20 will be priced at the child rate.<P>You may enter any age, 20 or below. You may not enter a value of 21 or greater, as GroupMinder always ';
			output += "consider individuals 21 and over to be adults and prices them as such.<P>If you are not offering special child's pricing and want all participants to be charged ";
			output += 'the adult rate, enter 0 in this field.<P>The value in this field affects only this particular Event. You may set a different value for each Event.';
			break;
		case 'Vendor Property Images':
		case 'Segment Images':
		case 'Segment Transports':
		case 'Segment Choice Tickets':
		case 'Segment Optional Tickets':
		case 'Segment Choice Miscellaneous':
		case 'Segment Optional Miscellaneous':
		case 'Segment Nights Order':
		case 'Order Items':
			output += 'Order items by clicking and dragging them.';
			break;
		case 'Reservation Owner Logo':
			output += 'If a reservation owner/travel partner is <I>grayed out</I>, it means that there is no logo image assigned to it.<BR/><BR/>If you want to associate a logo to "Self", go to <I>System -> Intranet -> Settings</I>, select a logo on the "Company Logo" section at the top and then update the profile.<BR/><BR/>If you want to associate a logo with another existing reservation owner, go to <I>External Contacts -> Travel Partners -> Manage</I>, search and select the travel partner you want from the list, add a logo and update the profile.';
			break;
		case 'Web Preview':
			output += 'This feature is only available for events in <I>Pending Status</I>.<P> To change the <I>Event Status</I> to <I>Pending</I>, select <I>Pending</I> ';
			output += 'on the <I>Status</I> select box and click <I>Update</I>.<P> If the event is in <I>Pending Status</I>, you can preview how it will look on the Internet. ';
			output += 'Just enable the <I>Web Preview</I> by clicking the <I>Turn Web Preview On</I> button. A message will confirm that the feature has been turned On, and you can ';
			output += 'then preview and test-book the event on your Internet portal.<P> You should turn <I>Web Preview</I> off as soon as you are done previewing the event.';
			break;
		case 'Internet Event Organizations':
			switch(callerPage){
				case '/events/evtdetail.cfm':
					var source = 'events';
					break;
				case '/events/esrdetail.cfm':
					var source = 'series';
					break;
			}
			output += 'To copy an Internet link that only gives internet reservationists access to ' + source + ' associated with this organization, right-click on the <I>Organization`s Events Internet Link</I> button and select the <I>Copy</I> option from the menu.<P>You can then paste the Internet link into any text editor, your browsers\'s <I>Address Bar</I>, or your email aplication, by pressing the <I>Ctrl + V</I> keys or by selecting the <I>Paste</I> option from the <I>Edit</I> menu.';
			break;
		case 'Email Type':
			output += '<B>Email Type</B> allows users to create and send a test email to one or more recipients so that the email can be viewed and approved prior to sending to the reservation individuals.<P>When the Email Type is set to "Test", the BCC field will become mandatory and the reservation individuals will be disabled for selection.';
			break;
		case 'Email Address':
			output += 'Type each additional Email Address in a new line.';
			break;
		case 'Reservation Streamlining':
			output += 'In order to streamline the booking process, you can now choose to omit pages that normally appear during the reservation process. ';
			output += 'Only pages where one component (package, transport, room, or ticket) is offered and is also mandatory (ie. There is no selection to make), can be omitted. [Please note that Miscellaneous Items marked as Mandatory are automatically removed from the booking process. However, they do display on the Reservation summary page and confirmation].<BR><BR>';
			output += 'Pages cannot be omitted if they display multiple package selections or multiple product options or where there is only one product, but it is optional. Even if you select to omit those pages, they will still be shown during the booking process.<BR><BR>';
			output += 'Please remember that by omitting reservation pages, you are preventing <I>requests</I> and  <I>adjacency</I> requests from being recorded. If you would like to collect that information, do not omit the booking pages.<BR><BR>';
			output += 'Separate settings for Web and Intranet portals are possible, to give you maximum configuration flexibility.';
			break;
		case 'Web Event Categories':
			switch(callerPage){
				case '/events/evtsettings.cfm':
					var type = 'events';
					break;
				case '/events/esrdetail.cfm':
					var type = 'series';
					break;
			}
			output += 'To copy an Internet link that only gives internet reservationists access to ' + type + ' associated with this category, right-click on the <I>Category`s Events Internet Link</I> button and select the <I>Copy Shortcut</I> option from the menu.';
			output += "<P>You can then paste the Internet link into any text editor, your browsers's <I>Address Bar</I>, or your email aplication, by pressing the <I>Ctrl + V</I> keys or by selecting the <I>Paste</I> option from the <I>Edit</I> menu.";
			break;
		case 'Social Networking Interface':
			output += '<p>This setting enables a Social Networking Interface on Event details.</p><p>To authorize Social Networking features you need to:</p><p>1. Select the checkbox "Display"</p><p>2. Optionally you can complete the URL link field with the URL of your Facebok Group or Page. For more information about Facebook Groups and Pages check the Help System for "Page Specific Docs", "Facebook documentation.doc"</p>';		
			break;
		case 'Package Surcharge':
			output += 'The Package Surcharge will be added to the Individual Tour Total for each traveler who books this package. The Package Surcharge is applied to travelers who book after the surcharge is added (ie. it is not applied to bookings made prior to adding the surcharge).';
			output += '<p>Please note: Multiple surcharges added to a package are not cumulative. Only the most recent surcharge added to the package will be applied.</p>';
			break;
		case 'Agency Commissions':
			output += 'The commission structure entered at the package level will override the commission structure specified for each agency.';
			break;
		case 'Package Itinerary':
			output += 'Changes made in a segment itinerary will be reflected on packages that have that segment associated.';
			break;
		case 'Destination Help':
			output += 'The purpose of the Destination designation for the Vendor, is to allow you to later Search for the Vendor by Destination. If you prefer to have the ability to search for your Vendors by the physical location of their offices, then select the office location as the Destination. Use whichever method is most useful to you.<P><B>Helpful Hint:</B> For Vendors that provide Transports, we recommend cataloging them under the Destination area for which they provide transports. In other words, if the Vendor is a bus company that only provides service to a particular region, select that region, or, if the Vendor is an airline that provides service all over the world, use the World designation. However, if you prefer to look up an airline by its main office location, that is ok, just choose the main office location as the Destination.</P>';
			break;
		case 'Save as Template':
			output += 'Checking this box will save this product data as a template for future use.';
			break;
		case 'Event Questions':
			output += '<STRONG>Available to all Events</STRONG><BR>If you will ask the same question in multiple Events and would like to have the customers\' answer stored in the Household record, choose the Available to: All Events option. Questions created for All Events will be stored in the Support Systems and will be available for associating to any Event. The answers will be permanently stored in the customers\' Household Individual file.<BR><BR>Please note that returning customers may change their answers to Miscellaneous Questions, but the most recently selected answer will override any past answers. Therefore, if you anticipate the same customer booking multiple Events and possibly giving a different answer to the same question, you should build the Question for This Event Only.<BR><BR><STRONG>This Event Only</STRONG><BR>Questions created for This Event Only is the correct choice when 1) the Question is Event specific and will not be used again or 2) you may ask the same question again in another Event but customers may be giving different answers each time.<BR><BR>A question selected for This Event Only, will not be available for associating to other Events. In addition, the customers\' answers will not be permanently stored. They answers will be stored in the Reservation file until the Event is Expired and at that time the answers will be deleted.';
			break;
		case 'Event Answers':
			output += '<STRONG>Only on a per Reservation basis</STRONG><BR>Make this selection when answers to this question should be stored only on the Reservation for this traveler and should not stored in their permanent Household file.<BR><BR>This is the preferred selection when it is possible that a single traveler will travel with you on multiple events and could answer this question differently on each Event. Selecting to save the answer "Only on a per Reservation basis", allows the database to store different answers to the same question for the same traveler. Each reservation for a single traveler can have a unique answer to the question.<BR><BR>This selection is the default when questions are built as Questions for "This Event Only".<BR><BR><STRONG>Across All Reservations for the Traveler</STRONG><BR>Make this selection when the answer to the question should be saved in the customer\'s permanent Household file, as well as in the Reservation.<BR><BR>This is the preferred selection when the answer to the question will remain somewhat static and will not change per Event. (Example: dietary restrictions, preferred departure city, membership number).  When the person travels with you again and has the same question posed, the previous given answer will default, so they do not have to fill it in again.<BR><BR><FONT COLOR="#FF0000">Important:</FONT>  When this selection is made, if a traveler has answered the same question on multiple events and gives different answers per each event, <FONT STYLE="text-decoration: underline;">all the Active Reservations for this traveler will be updated with the new answer</FONT>. If you do not want this to happen, as you think the answer to the question could be different per Event, please select to save the answer "Only on a per Reservation basis".';
			break;
		case 'Mailing Labels':
			output += 'For PDF Format:<BR><ul>Be sure to select "none" in the <b>Page Scaling</b> menu on the Print page (shown below) when printing mailing labels in PDF format.<BR><BR><IMG SRC="../intranet/images/mailingLabels.png" BORDER="0" ALIGN="absmiddle"></ul>';
			break;
		case 'Make Active':
			output += 'Use this field to define the number of days prior to the task Due Date that the task will display on the user\'s Welcome Page.<P>For example, if you set the task Due Date to September 25<SUP>th</SUP>, set the task status to display later, and set the "Display"  value to 5, the task will display on the user\'s Welcome Page on September 20<SUP>th</SUP> which is five days prior to the Due Date.';
			break;
		case 'Task Type Id':
			output += 'Use this field to define the ID of the item for the selected System.<P>If you set Item Id to 34 and select <I>Reservations</I> in the Systems field, the task will be created for reservation 34.<P>A zero value means that the task is associated in general to whatever system you selected.';
			break;
		case 'Badge Name':
			output += '<SPAN CLASS="regTextMed">If a name badge is provided with your tour, the name entered in the badge name field will appear on your name badge.</SPAN>';
			break;
		case 'Card Verification Value':
			output += 'CVV Code:</TD></TR><TR CLASS="regTextMed"><TD>For your safety and security, our card processing server requires	that you enter your card verification number. The	verification number is a 3 or 4 digit number printed on your card.<P>If you are using a Visa, Mastercard, or Discover card, it is a 3 digit	number that appears on the back of your card to the right of your card number (see below).<P><IMG SRC="../Intranet/images/Misc_cvvp3.gif" WIDTH="379" HEIGHT="82" ALT="cvv Visa, Mastercard, Discover" BORDER="0"><P>If you are using an American Express card, the verification number	is a 4 digit number that appears on the front of your card, above and	either on the left or right of the card number (see below).<P><IMG SRC="../Intranet/images/Misc_cvvp4.gif" WIDTH="379" HEIGHT="98" ALT="cvv American Express" BORDER="0">';
			break;
		case 'Insurance Company Apply to All':
			output += 'Clicking the Apply to All button will reset <FONT COLOR="red"><U>all Event insurance data</U></FONT> to the current data in the Name and URL Link fields. For existing Events with no insurance data, the new data will be inserted. For existing Events with existing insurance data, the new data will replace it.<BR><BR>To add/change insurance default data without affecting existing Events, change the insurance fields as needed and click the Save button (<U>do not</U> click Apply to All). Only New Events created after the update will be affected. To remove all Insurance Company Event settings, clear the Name and URL Link and then click the Apply to All button.<BR><BR>To change insurance data for a Travel Partner, go to the Travel Partner Detail page, click on the Internet Settings icon at the top of the page, then change the Travel Insurance data per the instructions above.';
			//output += 'Clicking the Apply to Existing button will reset <FONT COLOR="red"><U>all Event insurance data</U></FONT> to the current data in the Name and URL Link fields. For existing Events with no insurance data, the new data will be inserted. For existing Events with existing insurance data, the new data will replace it.<BR><BR>These modifications will impact All Insurance Company Event settings for <FONT COLOR="red"><U>' + var1 + '</U></FONT>.<BR><BR>To add/change insurance default data without affecting existing Event data, change the insurance fields as needed and click the Update button (do not click Apply to Existing). Only New Events created after the update will be affected.<BR><BR>To clear all Insurance Company Event settings for <FONT COLOR="red"><U>' + var1 + '</U></FONT>, clear the Name and URL Link and then click the Apply to Existing button.';
			break;
		case 'Internet Links':
			output += 'There are three links on this section. The first is a link to your Web portal. The other two lead users to GroupMinder Web pages that allow your customers to print updated confirmations, make payments toward existing reservations, or update their household and personal information.<BR><BR>Simply copy and paste the URLs into an email that prompts your users to visit the site, or use it to build a link on your Web site that will direct your customers to GroupMinder\'s Web portal.';
			break;
		case 'Company Name':
			output += 'Will appear in the "from" field in marketing & event emails.';
			break;
		case 'Reservation Individuals not in Households':
			output += 'Select to Add an individual as Reservation Only, if you have no contact information for the traveler and you do not want to keep a permanent record (Household) for them. Res Only would be for used for "one-time" travelers that you do not want to retain in your database. Below is a list of limitations for travelers added as Res Only Individuals:<BR><BR><UL><LI>No information will be stored in the Household database</LI><LI>Data will need to be re-entered if they travel with you again</LI><LI>Marketing Batch Mails cannot be sent</LI><LI>Travel History will not be tracked</LI></UL>If you would like to create a Household for an Individual, but you do not have contact information, you may save as Res Only and then covert them into a Household Individual when you get the data. Another option is to temporarily include the Individual in the Household of one of their traveling companions and use the Household Splitting function to create a new Household when you get the data.<BR><BR>Your company may have its own policies with regard to handling customers who have not provided contact information.';
			break;
		case 'Single Sup':
			output += 'Added to the Double rate if staying alone.';
			break;
		case 'Reservation Merge':
			output += 'This reservation has individuals in a different package.<BR>Multiple packages in a reservation are not allowed for this Event!';
			break;
		case 'No Transports Available':
			output += 'This individual has extra nights. No Transports Available.';
			break;
		case 'Nights Range':
			output += 'This Room can not be reassigned due to Nights Range discrepancy';
			break;
		case 'Agency Agent Credentials':
			output += 'Your current password does not comply with the system security policy.<br>Please update your password to be at least ' + var1 + '-20 characters long,<br>and to include at least one upper case, one lower case and one numeric character.';
			break;
		case 'Report Only Credentials':
			output += 'Your current Username and/or password do not comply with the system security policy.<br>Please update your username to be at least ' + var1 + ' characters long.<br>Please update your password to be at least ' + var2 + '-20 characters long,<br>and to include at least one upper case, one lower case and one numeric character.';
			break;
		case 'Intranet User Credentials':
			output += 'Please insert the login information to meet the following criteria:<OL><LI>Username must be at least ' + var1 + ' characters.</LI><LI>Password must be between ' + var2 + '-20 characters and must contain at least <BR>one upper case letter, one lower case letter and one numeric digit.</LI></OL>';
			break;
		case 'Partner Agent Credentials':
			output += 'Please insert the login information to meet the following criteria:<OL><LI>Username must be at least ' + var1 + ' characters.</LI><LI>Password must be between ' + var2 + '-20 characters and must contain at least <BR>one upper case letter, one lower case letter and one numeric digit.</LI></OL>';
			break;
		case 'Web Booking URL`s':
			output += 'For Self web bookings only.<BR>For Travel Partner web bookings, use the URL`s designated for Partners.';
			break;
		case 'Res Owner':
			output += '<B>Res Owner</B> refers to your company ("Self") and any partnering agencies ("Travel Partners") to which you may have allocated inventory for this event.';
			break;
		case 'Portal':
			output += 'Portal refers to the Intranet booking (for your users) and Web booking (for your online customers).';
			break;
		case 'Changes Report':
			output += 'This allows the creation of a report only with the current changes from the previously saved Report.<br>The report will be produced with the same search criterias than the save one. Click on the the magnifier for details.<br> You can also choose to make this report the new Final Report.';
			break;
		case 'Changes Report Detail':
			output += 'Report Search criterias';
			break;
			
	}
	output += '</TD></TR></TABLE>';

	showToolTipBallon([
		'ttpHtml', output,
		'ttpObj', obj,
		'ttpPointer', true,
		'ttpPointerPosition', null,
		'ttpHeaderTitle', title,
		'ttpWidth', tableWidth,
		'ttpPointerAuto', true,
		'ttpOnClickClose', true,
		'ttpShadow', true,		
		'ttpUnique', false,
		'ttpPortal', currPortal
   ]);
}

