(function($)
{

	$.fn.widgetMetaSuppliersPanes = function(options)
	{

		var intPositionX = 0;
		var intPositionY = 0;

		var blnTime  = false;
		var objTime  = null;

		var arrWindows = new Array();
		var intWindow  = 0;
		var objWindow  = null;

		var arrSupplierChecked = new Array();
		var arrSupplierImage   = new Array();
		var arrSupplierName    = new Array();
		var arrSupplierOrder   = new Array();
		var arrSupplierPartner = new Array();
		var arrSupplierType    = new Array();
		var arrSupplierUrl     = new Array();
		var intSupplierTotal   = 0;

		var settings = $.extend(
		{

			divMain:         null,
			divOpen:         null,
			divWatch:        null,
			hotelId:         null,
			hotelName:       null,
			municipalId:     null,
			municipalName:   null,
			platformPage:    null,
			platformSource:  null,
			platformVersion: null,
			showAuto:        false,
			showAutoLinks:   true,
			showClose:       true

		}, options || {} );

		if (settings.showAuto == true)
		{

			_displayWidget();

			try
			{

				_gaq.push(["_trackEvent", "MetaSuppliers (Panes)", "Open (Auto)", settings.platformSource + "-" + settings.platformVersion]);

			} catch (jsError) {}

		}

		$(settings.divOpen).click(function()
		{

			try
			{

				_gaq.push(["_trackEvent", "MetaSuppliers (Panes)", "Open (Manual)", settings.platformSource + "-" + settings.platformVersion]);

			} catch (jsError) {}

			_popupOpen();
			_displayWidget();

		});

		$("#btnClosePanes" + settings.hotelId).live("click", function()
		{

			//TODO: CLOSE ALL OPEN POPUPS

			try
			{

				if (settings.showAuto == true)
				{

					_gaq.push(["_trackEvent", "MetaSuppliers (Panes)", "Close (Auto)", settings.platformSource + "-" + settings.platformVersion]);

				} else
				{

					_gaq.push(["_trackEvent", "MetaSuppliers (Panes)", "Close (Manual)", settings.platformSource + "-" + settings.platformVersion]);

				}

			} catch (jsError) {}

			$(settings.divMain).html("");
			$(settings.divMain).css("display", "none");

		});

		$("#btnSubmitPanes" + settings.hotelId).live("click", function()
		{

			if (($("#txtDatePanes" + settings.hotelId + "a").val() == "") || ($("#txtDatePanes" + settings.hotelId + "b").val() == ""))
			{

				alert("Please enter a date in the specified field.");
				return(false);

			} else
			{

				var blnChecked = false, intChecked = 0;

				if (_checkDate($("#txtDatePanes" + settings.hotelId + "a").val()) == $("#txtDatePanes" + settings.hotelId + "a").val() && _checkDate($("#txtDatePanes" + settings.hotelId + "b").val()) == $("#txtDatePanes" + settings.hotelId + "b").val())
				{

					for (intSupplier = 0;  intSupplier < intSupplierTotal;  intSupplier++)
					{

						if ($("#chkSupplierPanes" + settings.hotelId + "-" + intSupplier).is(":checked"))
						{

							blnChecked = true;
							intChecked = intChecked + 1;

						}

					}

					if (intChecked == 0)
					{

						alert("Please select at least one of our partners to check for hotel deals!");

					} else
					{

						try
						{

							if (settings.showAuto == true)
							{

								_gaq.push(["_trackEvent", "MetaSuppliers (Panes)", "Submit (Auto)", settings.platformSource + "-" + settings.platformVersion]);

							} else
							{

								_gaq.push(["_trackEvent", "MetaSuppliers (Panes)", "Submit (Manual)", settings.platformSource + "-" + settings.platformVersion]);

							}

						} catch (jsError) {}

						if (!$.browser.mozilla)
						{

							if (!$.browser.msie)
							{

								for (intSupplier = intSupplierTotal;  intSupplier >= 0;  intSupplier--)
								{

									arrWindows[intSupplier] = window.open("/Shared/Suppliers/Window.php?Page=" + intSupplier, "winSupplierPanes" + settings.hotelId + intSupplier, "addonbar=no,directories=no,personalbar=no,channelmode=no,dependent=yes,dialog=no,minimizable=no,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,titlebar=no,toolbar=no,left=0,top=200");
									arrWindows[intSupplier].moveTo(0, 0);
									arrWindows[intSupplier].resizeTo(1, 1);

									if ($("#chkSupplierPanes" + settings.hotelId + "-" + intSupplier).is(":checked"))
									{

										try
										{

											if (settings.showAuto == true)
											{

												_gaq.push(["_trackEvent", "MetaSuppliers (Panes)", "Lead (Interface, Auto)", settings.platformSource + "-" + settings.platformVersion]);

											} else
											{

												_gaq.push(["_trackEvent", "MetaSuppliers (Panes)", "Lead (Interface, Manual)", settings.platformSource + "-" + settings.platformVersion]);

											}

										} catch (jsError) {}

									}

								}

							}

							objWindow = window.open("/Shared/Suppliers/Interface.php?Source=" + settings.platformSource + "&Version=" + settings.platformVersion, "frameTabsPanes" + settings.hotelId, "addonbar=no,directories=no,personalbar=no,channelmode=no,dependent=yes,dialog=no,minimizable=no,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,titlebar=no,toolbar=no");
							objWindow.moveTo(0, 0);
							objWindow.resizeTo(screen.availWidth, 200);

							blnTime = false;
							objTime = null;
							_popupTimer();

						} else
						{

							for (intSupplier = 0;  intSupplier < intSupplierTotal;  intSupplier++)
							{

								try
								{

									if ($("#chkSupplierPanes" + settings.hotelId + "-" + intSupplier).is(":checked"))
									{


										if (settings.showAuto == true)
										{

											_gaq.push(["_trackEvent (Panes)", "MetaSuppliers", "Lead (Patch, Auto)", settings.platformSource + "-" + settings.platformVersion]);

										} else
										{

											_gaq.push(["_trackEvent (Panes)", "MetaSuppliers", "Lead (Patch, Manual)", settings.platformSource + "-" + settings.platformVersion]);

										}

										arrWindows[intSupplier] = window.open($("#chkSupplierPanes" + settings.hotelId + "-" + intSupplier).val() + "&inDate=" + $("#txtDatePanes" + settings.hotelId + "a").val() + "&outDate=" + $("#txtDatePanes" + settings.hotelId + "b").val() + "&Guests=" + $("#txtGuestsPanes" + settings.hotelId).val() + "&Rooms=" + $("#txtRoomsPanes" + settings.hotelId).val());

									}

								} catch (jsError) {}

							}

						}

					}

				}

				return(false);

			}

		});

		function _checkDate(dateValue)
		{

			try
			{

				var dateMonth   = dateValue.split("/")[0];
				var dateDay     = dateValue.split("/")[1];
				var dateYear    = dateValue.split("/")[2];
				var dateEntered = new Date(dateYear, (dateMonth - 1), dateDay);

				if (((dateEntered.getMonth() + 1) != dateMonth) || (dateEntered.getDate() != dateDay) || (dateEntered.getFullYear() != dateYear))
				{

					throw new Error("The date specified is not valid.");

				} else
				{

					return(dateValue);

				}

			} catch (jsError)
			{

				alert(jsError.message + "\n\nPlease try again.");
				return(false);

			}

		}

		$(".chkSuppliersPanes" + settings.hotelId).live("click", function()
		{

			_popupOpen();

			if ($("#chkSupplierPanes" + settings.hotelId + "-" + this.alt).is(":checked"))
			{

				arrSupplierChecked[Number(this.alt)] = true;

				var intIndex = $.inArray(Number(this.alt), arrSupplierOrder);

				if (intIndex == -1)
				{

					arrSupplierOrder.push(Number(this.alt));

				}

			} else
			{

				arrSupplierChecked[Number(this.alt)] = false;

				var intIndex = $.inArray(Number(this.alt), arrSupplierOrder);

				if (intIndex >= 0)
				{

					arrSupplierOrder.splice(intIndex, 1);

				}

			}

		})

		$("#txtDatePanes" + settings.hotelId + "a").live("click", function()
		{

			_popupOpen();

		})

		$("#txtDatePanes" + settings.hotelId + "b").live("click", function()
		{

			_popupOpen();

		})

		function _displayWidget()
		{

			strContent = "<div id=\"divWidgetPanes" + settings.hotelId + "\"><form name=\"frmWidgetPanes" + settings.hotelId + "\" method=\"get\" action=\"\">";

			if (settings.hotelName != null)
			{

				strContent += "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>";
				strContent += "<td valign=\"middle\"><div class=\"ms-hotel-text\">" + settings.hotelName + "</div></td>";
				if (settings.showClose == true) strContent += "<td valign=\"top\"><div style=\"padding: 0px; text-align: right;\"><a class=\"ms-button-close\" id=\"btnClosePanes" + settings.hotelId + "\" name=\"btnClosePanes" + settings.hotelId + "\" href=\"javascript:void(0);\">Close</a></div></td>";
				strContent += "</tr></table><br />";

			}

			strContent += "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";

			strContent += "<tr>";

			strContent += "<td valign=\"top\"><div class=\"ms-div-pane1\">";
			strContent += "<div class=\"ms-div-text-steps\">1. Enter Travel Dates</div><div class=\"css-br\">&nbsp;</div>";

			strContent += "<span class=\"ms-date-text\">Check In Date:</span><br />";
			strContent += "<input class=\"ms-date-input\" id=\"txtDatePanes" + settings.hotelId + "a\" name=\"txtDatePanes" + settings.hotelId + "a\" type=\"text\" size=\"8\" maxlength=\"10\" autocomplete=\"off\" value=\"\" style=\"margin-right: 5px;\" /><br /><br />";
			strContent += "<span class=\"ms-date-text\">Check Out Date:</span><br />";
			strContent += "<input class=\"ms-date-input\" id=\"txtDatePanes" + settings.hotelId + "b\" name=\"txtDatePanes" + settings.hotelId + "b\" type=\"text\" size=\"8\" maxlength=\"10\" autocomplete=\"off\" value=\"\" style=\"margin-right: 5px;\" /><br /><br />";

			strContent += "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>";
			strContent += "<td width=\"50%\"><span class=\"ms-date-text\">Guests:</span><br />";
			strContent += "<select class=\"ms-select\" id=\"txtGuestsPanes" + settings.hotelId + "\" name=\"txtGuestsPanes" + settings.hotelId + "\"><option value=\"1\">1</option><option value=\"2\" selected=\"selected\">2</option><option value=\"3\">3</option><option value=\"4\">4</option><option value=\"5\">5</option><option value=\"6\">6</option><option value=\"7\">7</option><option value=\"8\">8</option><option value=\"9\">9</option></select></td>";
			strContent += "<td width=\"50%\"><span class=\"ms-date-text\">Rooms:</span><br />";
			strContent += "<select class=\"ms-select\" id=\"txtRoomsPanes" + settings.hotelId + "\" name=\"txtRoomsPanes" + settings.hotelId + "\"><option value=\"1\" selected=\"selected\">1</option><option value=\"2\">2</option><option value=\"3\">3</option><option value=\"4\">4</option></select></td>";
			strContent += "</tr></table>";

			strContent += "</div></td>";

			strContent += "<td width=\"10\" valign=\"top\"><div class=\"css-br\">&nbsp;</div></td>";

			strContent += "<td width=\"150\" valign=\"top\">";
			strContent += "<div class=\"ms-div-pane2\" id=\"divLinksPanes1" + settings.hotelId + "\"></div>";
			strContent += "</td>";

			strContent += "<td width=\"10\" valign=\"top\"><div class=\"css-br\">&nbsp;</div></td>";

			strContent += "<td valign=\"top\">";
			strContent += "<div class=\"ms-div-pane3\" id=\"divLinksPanes2" + settings.hotelId + "\"></div>";
			strContent += "</td>";

			strContent += "</tr>";

			strContent += "<tr><td colspan=\"5\" valign=\"middle\"><div class=\"css-br\">&nbsp;</div><div style=\"text-align: center;\">";
			strContent += "<img class=\"ms-button-submit\" id=\"btnSubmitPanes" + settings.hotelId + "\" name=\"btnSubmitPanes" + settings.hotelId + "\" src=\"http://m.world.com/Images/Buttons/Compare-Rates-And-Save.gif\" /><br />";
			strContent += "Results will be displayed in a pleasing tabbed environment for easy price comparison!";
			strContent += "</div></td></tr>";

			strContent += "</table>";
			strContent += "</form>";

			if ((settings.showClose == true) && (settings.hotelName == null))
			{

				strContent += "<br /><a class=\"ms-button-close\" id=\"btnClosePanes" + settings.hotelId + "\" name=\"btnClosePanes" + settings.hotelId + "\" href=\"javascript:void(0);\">Close</a>";

			}

			strContent += "</div>";

			$(settings.divMain).html(strContent);
			$(settings.divMain).css("display", "block");

			var dateToday   = new Date();
			var dateFuture1 = new Date(dateToday.getFullYear(), dateToday.getMonth(), dateToday.getDate() + 7);
			var dateFuture2 = new Date(dateToday.getFullYear(), dateToday.getMonth(), dateToday.getDate() + 8);

			$("#txtDatePanes" + settings.hotelId + "a").val((dateFuture1.getMonth() + 1) + "/" + dateFuture1.getDate() + "/" + dateFuture1.getFullYear());
			$("#txtDatePanes" + settings.hotelId + "b").val((dateFuture2.getMonth() + 1) + "/" + dateFuture2.getDate() + "/" + dateFuture2.getFullYear());

			var dates = $("#txtDatePanes" + settings.hotelId + "a, #txtDatePanes" + settings.hotelId + "b").datepicker(
			{

				buttonImage:       "http://m.world.com/Images/jQuery/Calendar.gif",
				buttonImageOnly:   true,
				dateFormat:        "mm/dd/yy",
				maxDate:           365,
				minDate:           0,
				numberOfMonths:    2,
				selectOtherMonths: false,
				showAnim:          "drop",
				showOn:            "both",
				showOtherMonths:   false,

				onSelect: function(selectedDate)
				{

					_popupOpen();

					var option = this.id == "txtDatePanes" + settings.hotelId + "a" ? "minDate" : "maxDate", instance = $(this).data("datepicker");
					date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
					dates.not(this).datepicker("option", option, date);
					if ($("#txtDatePanes" + settings.hotelId + "b").val() == "") $("#txtDatePanes" + settings.hotelId + "b").val("mm/dd/yyyy");

				}

			});

			var instance = $("#txtDatePanes" + settings.hotelId + "a").data("datepicker");
			$("#txtDatePanes" + settings.hotelId + "a").datepicker("option", "minDate", $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, (dateToday.getMonth() + 1) + "/" + dateToday.getDate() + "/" + dateToday.getFullYear(), instance.settings));

			var instance = $("#txtDatePanes" + settings.hotelId + "b").data("datepicker");
			$("#txtDatePanes" + settings.hotelId + "b").datepicker("option", "minDate", $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, $("#txtDatePanes" + settings.hotelId + "b").val(), instance.settings));

			$("#txtDatePanes" + settings.hotelId + "a").val("mm/dd/yyyy");
			$("#txtDatePanes" + settings.hotelId + "b").val("mm/dd/yyyy");

			if (settings.showAutoLinks == true) _getLinks();

			if (intPositionX == 0)
			{

				intPositionX = $(settings.divMain).position().left;
				intPositionY = $(settings.divMain).position().top;

			}

			if (settings.showAuto == false) $(settings.divMain).animate({"left": intPositionX - 250}, "slow");

		}

		function _getLinks()
		{

			$("#divLinksPanes1" + settings.hotelId).html("<div style=\"text-align: center;\"><img src=\"http://m.world.com/Images/Widgets/OneTime/Wait.gif\" /><br />Finding Partners...</div>");
			$("#divLinksPanes2" + settings.hotelId).html("<div style=\"text-align: center;\"><img src=\"http://m.world.com/Images/Widgets/OneTime/Wait.gif\" /><br />Finding Partners...</div>");

			$.getJSON("/Shared/Scripts/jquery.metasuppliers.panes.php?HotelID=" + settings.hotelId + "&Type=Hotel&TypeID=" + settings.hotelId + "&Page=" + settings.platformPage + "&MunicipalID=" + settings.municipalId + "&MunicipalName=" + settings.municipalName, {}, function(jsData)
			{

				try
				{

					intSupplierTotal = jsData.Results.length;

					if ((intSupplierTotal == 0) || (intSupplierTotal == null))
					{

						_logError();

					}

				} catch (jsError)
				{

					intSupplierTotal = 0;
					_logError();

				}

				for (intSupplier = 0;  intSupplier < intSupplierTotal;  intSupplier++)
				{

					arrSupplierChecked[intSupplier] = jsData.Results[intSupplier].SupplierChecked;
					arrSupplierImage[intSupplier]   = jsData.Results[intSupplier].SupplierImage;
					arrSupplierName[intSupplier]    = jsData.Results[intSupplier].SupplierName;
					arrSupplierOrder[intSupplier]   = intSupplier;
					arrSupplierPartner[intSupplier] = jsData.Results[intSupplier].Partner;
					arrSupplierType[intSupplier]    = jsData.Results[intSupplier].SupplierType;
					arrSupplierUrl[intSupplier]     = jsData.Results[intSupplier].SupplierLead + "&Result=" + intSupplier;

				}

				$("#divLinksPanes1" + settings.hotelId).html("");
				$("#divLinksPanes2" + settings.hotelId).html("");

				var strContent = "";
				strContent += "<div class=\"ms-div-text-steps\">2. Select Suppliers</div><div class=\"css-br\">&nbsp;</div>";

				arrSupplierChecked[0] = true;

				strContent += "<table border=\"0\" cellpadding=\"0\" cellspacing=\1\">";

				strContent += "<tr><td colspan=\"2\"><div class=\"ms-div-text\">Compare Hotel Rates at:</div></td></tr>";
				strContent += "<tr>";
				strContent += "<td width=\"5\" valign=\"middle\"><input id=\"chkSupplierPanes" + settings.hotelId + "-0\" class=\"chkSuppliersPanes" + settings.hotelId + "\" type=\"checkbox\" name=\"" + jsData.Results[0].SupplierName + "\" value=\"" + jsData.Results[0].SupplierLead + "&Result=0\" checked=\"checked\" alt=\"0\" /></td>";
				strContent += "<td width=\"*\" valign=\"middle\"><label for=\"chkSupplierPanes" + settings.hotelId + "-0\"><span class=\"ms-link-text\" style=\"border: 0px;\">" + jsData.Results[0].SupplierName + "</span></label></td>";
				strContent += "</tr>";
				strContent += "<tr><td colspan=\"2\"><div class=\"ms-div-text\">To These Providers:</div></td></tr>";

				for (intSupplier = 1;  intSupplier <= (intSupplierTotal - 1);  intSupplier++)
				{

					if (arrSupplierType[intSupplier] == "Hotel")
					{

						if (jsData.Results[intSupplier].SupplierChecked == "TRUE")
						{

							var strChecked = " checked=\"checked\"";
							arrSupplierChecked[intSupplier] = true;
							arrSupplierOrder.push(intSupplier);

						} else
						{

							var strChecked = "";
							arrSupplierChecked[intSupplier] = false;

						}

						strContent += "<tr>";
						strContent += "<td width=\"5\" valign=\"middle\"><input id=\"chkSupplierPanes" + settings.hotelId + "-" + intSupplier + "\" class=\"chkSuppliersPanes" + settings.hotelId + "\" type=\"checkbox\" name=\"" + jsData.Results[intSupplier].SupplierName + "\" value=\"" + jsData.Results[intSupplier].SupplierLead + "&Result=" + intSupplier + "\"" + strChecked + " alt=\"" + intSupplier + "\" /></td>";
						strContent += "<td width=\"*\" valign=\"middle\"><label for=\"chkSupplierPanes" + settings.hotelId + "-" + intSupplier + "\"><span class=\"ms-link-text\" style=\"border: 0px;\">" + jsData.Results[intSupplier].SupplierName + "</span></label></td>";
						strContent += "</tr>";

					}

				}

				strContent += "</table><div class=\"css-br\">&nbsp;</div>";

				$("#divLinksPanes1" + settings.hotelId).html(strContent);

				var strContent = "";
				strContent += "<div class=\"ms-div-text-steps\">3. Check for Car Rentals<br />&nbsp;&nbsp;&nbsp;&nbsp;(Optional)</div><div class=\"css-br\">&nbsp;</div>";
				strContent += "<table border=\"0\" cellpadding=\"0\" cellspacing=\1\">";

				for (intSupplier = 1;  intSupplier <= (intSupplierTotal - 1);  intSupplier++)
				{

					if (arrSupplierType[intSupplier] == "Car+Rental")
					{

						if (jsData.Results[intSupplier].SupplierChecked == "TRUE")
						{

							var strChecked = " checked=\"checked\"";
							arrSupplierChecked[intSupplier] = true;
							arrSupplierOrder.push(intSupplier);

						} else
						{

							var strChecked = "";
							arrSupplierChecked[intSupplier] = false;

						}

						strContent += "<tr>";
						strContent += "<td width=\"5\" valign=\"middle\"><input id=\"chkSupplierPanes" + settings.hotelId + "-" + intSupplier + "\" class=\"chkSuppliersPanes" + settings.hotelId + "\" type=\"checkbox\" name=\"" + jsData.Results[intSupplier].SupplierName + "\" value=\"" + jsData.Results[intSupplier].SupplierLead + "&Result=" + intSupplier + "\"" + strChecked + " alt=\"" + intSupplier + "\" /></td>";
						strContent += "<td width=\"*\" valign=\"middle\"><label for=\"chkSupplierPanes" + settings.hotelId + "-" + intSupplier + "\"><span class=\"ms-link-text\" style=\"border: 0px;\">" + jsData.Results[intSupplier].SupplierName + "</span></label></td>";
						strContent += "</tr>";

					}

				}

				strContent += "</table>";

				$("#divLinksPanes2" + settings.hotelId).html(strContent);

			});

			try
			{

				$(settings.divMain)[0].scrollIntoView();
				window.scrollBy(0, -50);

			} catch (jsError)
			{
			}

		}

		function _logError()
		{

			$.ajax({

				url: "/Shared/Scripts/jquery.metasuppliers.php?Log=Error&HotelID=" + settings.hotelId,

				success: function(jsData)
				{

					if (jsData == "true")
					{

						_getLinks();

					} else
					{

						$(settings.divMain).html("<div style=\"text-align: left;\">We're sorry, but we could not return any results for this hotel.&nbsp; This is a very rare error.&nbsp; Please close this box and select a different hotel to compare results.</div><div style=\"text-align: right;\"><a class=\"ms-button-close\" id=\"btnClosePanes" + settings.hotelId + "\" name=\"btnClosePanes" + settings.hotelId + "\" href=\"javascript:void(0);\">Close</a></div>");
						$("#divLinksPanes" + settings.hotelId).html("");

					}

				}

			});

		}

		function _popupOpen()
		{

			var winX = (document.all) ? window.screenLeft : window.screenX;
			var winY = (document.all) ? window.screenTop  : window.screenY;

			if ($.browser.msie)
			{

				if ((intWindow < intSupplierTotal) || ((intWindow == 0) && (intSupplierTotal == 0)))
				{

					arrWindows[intWindow] = window.open("/Shared/Suppliers/Window.php?Page=" + intWindow, "winSupplierPanes" + settings.hotelId + intWindow, "width=1,height=1,directories=0,menubar=0,status=0,location=0,titlebar=1,resizable=1,toolbar=0,scrollbars=1,left=" + winX + ",top=" + winY);
					arrWindows[intWindow].moveTo(winX, winY);
					arrWindows[intWindow].resizeTo(1, 1);
					arrWindows[intWindow].blur();
					window.focus();

					intWindow = intWindow + 1;

				}

			}

		}

		function _popupTimer()
		{

			if ((typeof(objWindow.blnLoaded) == "undefined") || (objWindow.blnLoaded == false))
			{

				objTime = setTimeout(_popupTimer, 1000);

			} else
			{

				if (blnTime == false)
				{

					blnTime = true;
					clearTimeout(objTime);

					if (intSupplierTotal > 0)
					{

						var intChecked = 0;

						for (intSupplier = 0;  intSupplier < intSupplierTotal;  intSupplier++)
						{

							objWindow.Settings.arrChecked[intSupplier]   = arrSupplierChecked[intSupplier];
							objWindow.Settings.arrSuppliers[intSupplier] = arrSupplierName[intSupplier];
							objWindow.Settings.arrTypes[intSupplier]     = arrSupplierType[intSupplier];
							objWindow.Settings.arrUrls[intSupplier]      = arrSupplierUrl[intSupplier] + "&inDate=" + $("#txtDatePanes" + settings.hotelId + "a").val() + "&outDate=" + $("#txtDatePanes" + settings.hotelId + "b").val() + "&Guests=" + $("#txtGuestsPanes" + settings.hotelId).val() + "&Rooms=" + $("#txtRoomsPanes" + settings.hotelId).val();
							objWindow.Settings.arrImages[intSupplier]    = arrSupplierImage[intSupplier];
							objWindow.Settings.arrPartners[intSupplier]  = arrSupplierPartner[intSupplier];

						}

					}

					objWindow.Settings.arrOrder     = arrSupplierOrder;
					objWindow.Settings.arrWindows   = arrWindows;
					objWindow.Settings.intChecked   = intChecked;
					objWindow.Settings.strDateIn    = $("#txtDatePanes" + settings.hotelId + "a").val();
					objWindow.Settings.strDateOut   = $("#txtDatePanes" + settings.hotelId + "b").val();
					objWindow.Settings.strGuests    = $("#txtGuestsPanes" + settings.hotelId).val();
					objWindow.Settings.strHotelID   = settings.hotelId;
					objWindow.Settings.strHotelName = settings.hotelName;
					objWindow.Settings.strRooms     = $("#txtRoomsPanes" + settings.hotelId).val();

					window.blur();
					objWindow.Ready();

				}

			}

		}

	}

}) (jQuery);
