var popupBlockMsgInd = false;

function getSelected(formObj)
{
	for(var x=0;x<formObj.childNodes.length;x++)
	{
		if(formObj.childNodes[x].nodeName=="OPTION" && formObj.childNodes[x].selected)
		{
			return formObj.childNodes[x].value
		}
	}
	return '';
}

function submitBTModule(formName)
{
	popupBlockMsgInd = false
	var popupValue=0;
	var popupIncrValue=40;
	if( formName == 'frm_bookHotels' )
	{
		if ( document.getElementById('btModuleBooking_HotelsChkPriceline').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitPriceLine(formName,popupValue);
		}
		if ( document.getElementById('btModuleBooking_HotelsChkBookingbuddy').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitBookingbuddy(formName,popupValue);
		}
		if ( document.getElementById('btModuleBooking_HotelsChkOrbitz').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitOrbitz(formName,popupValue);
		}
		/*if ( document.getElementById('btModuleBooking_HotelsChkCheaptickets').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitCheaptickets(formName,popupValue);
		}*/		
		if ( document.getElementById('btModuleBooking_HotelsChkGetaroom').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitGetaroom(formName,popupValue);
		}	
		if ( document.getElementById('btModuleBooking_HotelsChkTripadvisor').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitTripadvisor(formName,popupValue);
		}		
		if ( document.getElementById('btModuleBooking_HotelsChkTravelocity').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitTravelocity(formName,popupValue);
		}		
		if ( document.getElementById('btModuleBooking_HotelsChkExpedia').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitExpedia(formName,popupValue);
		}		
		if ( document.getElementById('btModuleBooking_HotelsChkTravelTicker').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitTravelTicker(formName,popupValue);
		}		
		if ( document.getElementById('btModuleBooking_HotelsChkTrip').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitTrip(formName,popupValue);
		}		
		if ( document.getElementById('btModuleBooking_HotelsChkHotwire').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitHotwire(formName,popupValue);
		}

		if( document.getElementById('btModuleBooking_HotelsChkPriceline').checked == false &&
		    document.getElementById('btModuleBooking_HotelsChkTravelocity').checked == false &&  
		    document.getElementById('btModuleBooking_HotelsChkOrbitz').checked == false &&
		    /*document.getElementById('btModuleBooking_HotelsChkCheaptickets').checked == false &&*/
		    document.getElementById('btModuleBooking_HotelsChkBookingBuddy').checked == false &&
		    document.getElementById('btModuleBooking_HotelsChkTripadvisor').checked == false  &&
		    document.getElementById('btModuleBooking_HotelsChkGetaroom').checked == false && 
		    document.getElementById('btModuleBooking_HotelsChkExpedia').checked == false &&
		    document.getElementById('btModuleBooking_HotelsChkTravelTicker').checked == false  &&
		    document.getElementById('btModuleBooking_HotelsChkTrip').checked == false	  &&
		    document.getElementById('btModuleBooking_HotelsChkHotwire').checked == false	    
		)
		{
			document.getElementById('hotels_error').innerHTML = "Please select at least one website to search, and then click the 'Check Rates' button";
		}else{
			document.getElementById('hotels_error').innerHTML = "";
		}
	}
	
	if( formName == 'frm_bookFlights' )
	{
	
		if ( document.getElementById('btModuleBooking_FlightsChkPriceline').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitPriceLine(formName,popupValue);
		}
		if ( document.getElementById('btModuleBooking_FlightsChkBookingBuddy').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitBookingbuddy(formName,popupValue);
		}		
		if ( document.getElementById('btModuleBooking_FlightsChkOrbitz').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitOrbitz(formName,popupValue);
		}
		if ( document.getElementById('btModuleBooking_FlightsChkTripadvisor').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitTripadvisor(formName,popupValue);
		}		
		if ( document.getElementById('btModuleBooking_FlightsChkTravelocity').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitTravelocity(formName,popupValue);
		}		
		if ( document.getElementById('btModuleBooking_FlightsChkExpedia').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitExpedia(formName,popupValue);
		}
		if ( document.getElementById('btModuleBooking_FlightsChkTravelTicker').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitTravelTicker(formName,popupValue);
		}		
		if ( document.getElementById('btModuleBooking_FlightsChkTrip').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitTrip(formName,popupValue);
		}		
		if ( document.getElementById('btModuleBooking_FlightsChkHotwire').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitHotwire(formName,popupValue);
		}		
		if( document.getElementById('btModuleBooking_FlightsChkPriceline').checked == false &&
		    document.getElementById('btModuleBooking_FlightsChkTravelocity').checked == false &&
		    document.getElementById('btModuleBooking_FlightsChkOrbitz').checked == false &&
		    document.getElementById('btModuleBooking_FlightsChkTripadvisor').checked == false && 
		    document.getElementById('btModuleBooking_FlightsChkBookingBuddy').checked == false &&
		    document.getElementById('btModuleBooking_FlightsChkExpedia').checked == false &&
		    document.getElementById('btModuleBooking_FlightsChkTravelTicker').checked == false && 
		    document.getElementById('btModuleBooking_FlightsChkTrip').checked == false && 
		    document.getElementById('btModuleBooking_FlightsChkHotwire').checked == false )
		{
			document.getElementById('flights_error').innerHTML = "Please select at least one website to search, and then click the 'Check Rates' button";
		}else{
			document.getElementById('flights_error').innerHTML = "";
		}
	}
	
	if( formName == 'frm_bookCars' )
	{
	
		if ( document.getElementById('btModuleBooking_CarsChkPriceline').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitPriceLine(formName,popupValue);
		}
		if ( document.getElementById('btModuleBooking_CarsChkBookingBuddy').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitBookingbuddy(formName,popupValue);
		}
		if ( document.getElementById('btModuleBooking_CarsChkOrbitz').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitOrbitz(formName,popupValue);
		}
		if ( document.getElementById('btModuleBooking_CarsChkExpedia').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitExpedia(formName,popupValue);
		}
		if ( document.getElementById('btModuleBooking_CarsChkTravelTicker').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitTravelTicker(formName,popupValue);
		}
		if ( document.getElementById('btModuleBooking_CarsChkCarRentals').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitCarRentals(formName,popupValue);
		}
		if ( document.getElementById('btModuleBooking_CarsChkHotwire').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitHotwire(formName,popupValue);
		}
		if( document.getElementById('btModuleBooking_CarsChkPriceline').checked == false &&
		    document.getElementById('btModuleBooking_CarsChkOrbitz').checked == false &&
		    document.getElementById('btModuleBooking_CarsChkBookingBuddy').checked == false &&
		    document.getElementById('btModuleBooking_CarsChkExpedia').checked == false && 
		    document.getElementById('btModuleBooking_CarsChkTravelTicker').checked == false && 
		    document.getElementById('btModuleBooking_CarsChkCarRentals').checked == false  && 
		    document.getElementById('btModuleBooking_CarsChkHotwire').checked == false)
		{
			document.getElementById('cars_error').innerHTML = "Please select at least one website to search, and then click the 'Check Rates' button";
		}else{
			document.getElementById('cars_error').innerHTML = "";
		}
	}
	
	if( formName == 'frm_bookCruises' )
	{
	
		/*
		if ( document.getElementById('btModuleBooking_CruisesChkPriceline').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitPriceLine(formName,popupValue);
		}
		*/
		if ( document.getElementById('btModuleBooking_CruisesChkBookingBuddy').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitBookingbuddy(formName,popupValue);
		}
		if ( document.getElementById('btModuleBooking_CruisesChkOrbitz').checked == true )
		{
			popupValue=popupValue+popupIncrValue;
			submitOrbitz(formName,popupValue);
		}
		if( /* document.getElementById('btModuleBooking_CruisesChkPriceline').checked == false && */
		    document.getElementById('btModuleBooking_CruisesChkOrbitz').checked == false &&
		    document.getElementById('btModuleBooking_CruisesChkBookingBuddy').checked == false )
		{
			document.getElementById('cruises_error').innerHTML = "Please select at least one website to search, and then click the 'Check Rates' button";
		}else{
			document.getElementById('cruises_error').innerHTML = "";
		}
	}	

}

function submitPriceLine(formName,popupValue)
{
	basicURL = new Array()
	basicURL['frm_bookHotels'] = 'http://ad.doubleclick.net/clk;215012494;32930078;z?http://www.priceline.com/qp.asp?refid=PLBUDGETTRAVEL&refclickid=HOTELSEARCH&ProductID=5'
	basicURL['frm_bookFlights'] = 'http://ad.doubleclick.net/clk;215012490;32930078;v?http://www.priceline.com/qp.asp?ProductID=1&refid=PLBUDGETTRAVEL&refclickid=AIRSEARCH'
	basicURL['frm_bookCars'] = 'http://ad.doubleclick.net/clk;215012486;32930078;a?http://www.priceline.com/qp.asp?refid=PLBUDGETTRAVEL&refclickid=RCSEARCH&ProductID=8&plf=pcln'
	basicURL['frm_bookCruises'] = 'http://ad.doubleclick.net/clk;215012482;32930078;w?http://www.pricelinecruiseoutlet.com/s/c/results.asp?Refid=PLBUDGETTRAVEL&RefClickID=RCSEARCH'
	
	var formObj = eval('document.' + formName)	

	var _qs = basicURL[formName];
	for(x=0;x<formObj.length;x++)

	{
		_qs += "&" + formObj[x].name + "=";
		_qs += (formObj[x].type=="text" || formObj[x].type=="hidden")?formObj[x].value:getSelected(formObj[x]);
	}
	
	// prompt('',_qs);
	win1 = window.open(_qs,'Priceline','menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=825, height=500, left='+popupValue+', top='+popupValue);
	openPopUp(win1);
}

var trvlcityCruiseDest = ["A#2050","AG#2050","AR#2050","BH#1295","BM#1035","NN#1294","C#24","CE#186","CS#189","CW#187","E#23","N#795","W#1465","H#26","EE#407","R#407","EW#407","M#7","T#240","S#1296","TH#579","ET#793","NA#1896","RV#1896","PC#1896","NC#1896","WW#2047"];
var trvlcityCruiseLens = ["","1-2","3-6","7-9","10-14","14+ Nights"];

function submitTravelocity(formName,popupValue)
{
	basicURL = new Array()
	basicURL['frm_bookHotels'] = 'http://ad.doubleclick.net/clk;219430875;32930078;k?http://travel.travelocity.com/hotel/HotelCobrand.do?'
	basicURL['frm_bookFlights'] = 'http://ad.doubleclick.net/clk;219430874;32930078;j?http://travel.travelocity.com/flights/InitialSearch.do?'
	basicURL['frm_bookCars'] = 'http://ad.doubleclick.net/clk;216149866;32930078;o?http://ad.doubleclick.net/clk;215967170;38362344;k?http://travel.travelocity.com/car/PostFrontDoor.do?'
	basicURL['frm_bookCruises'] = 'http://ad.doubleclick.net/clk;216149865;32930078;n?http://ad.doubleclick.net/clk;215967185;38362347;t?http://leisure.travelocity.com/Vacations/Cruise/Finder/Results/1,,TRAVELOCITY,00.html?Service=TRAVELOCITY&Search.x=1&Search.y=1&&'
	
	var formObj = eval('document.' + formName);
	var _qs = basicURL[formName];
	
	if( formName == 'frm_bookHotels' )
	{
 	  _qs += "pax_cnt="+document.forms[formName].ROOMS.value;		
	  _qs += "&city="+document.forms[formName].CITY.value;
	  _qs += "&dateLeavingMonth="+formatDateBT(new Date(document.forms[formName].CheckInDate.value), "m");
	  _qs += "&dateLeavingDay="+formatDateBT(new Date(document.forms[formName].CheckInDate.value), "d");
	  _qs += "&dateReturningMonth="+formatDateBT(new Date(document.forms[formName].CheckOutDate.value), "m");
	  _qs += "&dateReturningDay="+formatDateBT(new Date(document.forms[formName].CheckOutDate.value), "d");	  
	  _qs += "&WA1=03010&WA2=215967132&WA3=38362352&WA4=0&WA5=1653085&WA6=336501";
	}
	
	  
	if( formName == 'frm_bookFlights' )
	{
	  _qs += "leavingFrom="+document.forms[formName].DepCity.value;
	  _qs += "&goingTo="+document.forms[formName].ArrCity.value;
	  _qs += "&leavingDate="+formatDateBT(new Date(document.forms[formName].DepartureDate.value), "m/d/yyyy");
	  _qs += "&returningDate="+formatDateBT(new Date(document.forms[formName].ReturnDate.value), "m/d/yyyy");
	  _qs += "&adults="+document.forms[formName].NUMTICKETS.value;
	  _qs += "&WA1=03010&WA2=215967104&WA3=38362351&WA4=0&WA5=1653085&WA6=336501";
	}
	
	if( formName == 'frm_bookCars' )
	{
	  _qs += "pickupCity="+document.forms[formName].PickUpLoc.value;
	  _qs += "&pickupMonth="+formatDateBT(new Date(document.forms[formName].PickUpDate.value), "m");
	  _qs += "&pickupDayOfMonth="+formatDateBT(new Date(document.forms[formName].PickUpDate.value), "d");
	  _qs += "&dropoffMonth="+formatDateBT(new Date(document.forms[formName].DropOffDate.value), "m");
	  _qs += "&dropoffDayOfMonth="+formatDateBT(new Date(document.forms[formName].DropOffDate.value), "d");
	  _qs += "&pickupTime=17";
	  _qs += "&dropoffTime=17";
	  _qs += "&WA1=03010&WA2=215967170&WA3=38362344&WA4=0&WA5=1653085&WA6=336501";
	}
	
	if( formName == 'frm_bookCruises' )
	{
	  _qs += "destination="+getCruiseDest(document.forms[formName].places.value, trvlcityCruiseDest);;
	  _qs += "&length_of_stay="+getCruiseLen(document.forms[formName].days.value, trvlcityCruiseLens);;
	  _qs += "&month_year="+formatDateBT(new Date(document.forms[formName].month.value), "yyyymm");
	  _qs += "&WA1=03010&WA2=215967185&WA3=38362347&WA4=0&WA5=1653085&WA6=336501";
	}	
	
	// prompt('',_qs)
	// openPopUp(window.open(_qs,'Travelocity','menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=825, height=500, left='+popupValue+', top='+popupValue));
	win2 = window.open(_qs,'Travelocity','menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=825, height=500, left='+popupValue+', top='+popupValue);
	openPopUp(win2);
}

var orbitz_month_names = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");


function submitOrbitz(formName,popupValue)
{
	basicURL = new Array()
	basicURL['frm_bookHotels'] = 'http://ad.doubleclick.net/clk;217150348;32930078;c?http://ad.doubleclick.net/clk;208956841;30970863;s?http://www.orbitz.com/App/ValidateHotelSearch?'
	basicURL['frm_bookFlights'] = 'http://ad.doubleclick.net/clk;217150349;32930078;d?http://ad.doubleclick.net/clk;208956813;30970768;v?http://www.orbitz.com/App/ValidateFlightSearch?'
	basicURL['frm_bookCars'] = 'http://ad.doubleclick.net/clk;217150343;32930078;x?http://ad.doubleclick.net/clk;208956850;30970979;a?http://www.orbitz.com/App/OffsiteCarSearch?'
	basicURL['frm_bookCruises'] = 'http://ad.doubleclick.net/clk;217150345;32930078;z?http://ad.doubleclick.net/clk;216347521;38881940;l?http://www.orbitz.com/App/Landing?placementID=1&pageID=13&IncludeAlumniRates=false&IncludeSeniorRates=false&Search=Search'
	
	var formObj = eval('document.' + formName);
	var _qs = basicURL[formName];
	
	if( formName == 'frm_bookHotels' )
	{
	  _qs += "keywordPIB="+document.forms[formName].CITY.value;
	  _qs += "&monthInPIB="+orbitzMonthYear(document.forms[formName].CheckInDate.value);
	  _qs += "&dayInPIB="+orbitzDay(document.forms[formName].CheckInDate.value);
	  _qs += "&monthOutPIB="+orbitzMonthYear(document.forms[formName].CheckOutDate.value);
	  _qs += "&dayOutPIB="+orbitzDay(document.forms[formName].CheckOutDate.value);
	  _qs += "&numberOfRoomsPIB="+document.forms[formName].ROOMS.value;
	  _qs += "&numberOfGuestsPIB="+document.forms[formName].ROOMS.value;
	  _qs += "&gcid=C11287x728&WT.mc_id=o_bt_hotel&WT.mc_ev=click&DCSext.mc_kw=";
	}
	
	  
	if( formName == 'frm_bookFlights' )
	{
	  _qs += "slice1:departCity="+document.forms[formName].DepCity.value;
	  _qs += "&slice1:arriveCity="+document.forms[formName].ArrCity.value;
	  _qs += "&slice1:month="+orbitzMonthYear(document.forms[formName].DepartureDate.value);
	  _qs += "&slice1:day="+orbitzDay(document.forms[formName].DepartureDate.value);
	  _qs += "&slice2:month="+orbitzMonthYear(document.forms[formName].ReturnDate.value);
	  _qs += "&slice2:day="+orbitzDay(document.forms[formName].ReturnDate.value);
	  _qs += "&adults="+document.forms[formName].NUMTICKETS.value;
	  _qs += "&gcid=C11287x729&WT.mc_id=o_bt_air&WT.mc_ev=click&DCSext.mc_kw=";
	}
	
	if( formName == 'frm_bookCars' )
	{
	  _qs += "pickupLocation="+document.forms[formName].PickUpLoc.value;
	  _qs += "&pickupMonth="+orbitzMonthYear(document.forms[formName].PickUpDate.value);
	  _qs += "&pickupDay="+orbitzDay(document.forms[formName].PickUpDate.value);
	  _qs += "&dropoffMonth="+orbitzMonthYear(document.forms[formName].DropOffDate.value);
	  _qs += "&dropoffDay="+orbitzDay(document.forms[formName].DropOffDate.value);
	  _qs += "&startDate:time=5+pm";
	  _qs += "&endDate:time=5+pm";
	  _qs += "&gcid=C11287x730&WT.mc_id=o_bt_car&WT.mc_ev=click&DCSext.mc_kw=";
	}
	
	if( formName == 'frm_bookCruises' )
	{
	  _qs += "&places="+document.forms[formName].places.value;
	  _qs += "&operator="+document.forms[formName].operator.value;
	  _qs += "&days="+document.forms[formName].days.value;
	  _qs += "&month="+document.forms[formName].month.value;
	  _qs += "&gcid=C11287x758&WT.mc_id=o_bt_crz&WT.mc_ev=click&DCSext.mc_kw=";
	}	
	
	//prompt('',_qs)
	// openPopUp(window.open(_qs,'Orbitz','menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=825, height=500, left='+popupValue+', top='+popupValue));
	win3 = window.open(_qs,'Orbitz','menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=825, height=500, left='+popupValue+', top='+popupValue);
	openPopUp(win3);
}


var bbCruiseDest = ["A#Alaska","AG#Alaska","AR#Alaska","BH#Bahamas","BM#Bermuda","NN#Canada / New England","C#Caribbean","CE#Caribbean - East","CS#Caribbean - South","CW#Caribbean - West","E#Europe","N#Europe","W#Europe","H#Hawaii","EE#Mediterranean","R#Mediterranean","EW#Mediterranean","M#Mexico","T#Panama Canal","S#South America","I#South Pacific","P#South Pacific","TH#South Pacific","ET#Transatlantic","NA#United States","RV#United States","PC#United States","NC#United States","WW#World Cruise"];
var bbCruiseLines = ["ALL#Any Cruise Line","1#Carnival","11#Celebrity","14#Costa Cruises","17#Crystal Cruises","18#Cunard","20#Disney","24#Holland America","34#Norwegian","67#Oceania","36#Orient","40#Princess","41#Radisson Seven Seas","44#Royal Caribbean","48#Seabourn","50#Silversea","64#Windstar"];
var bbCruiseLens = ["Any Length","1-2 Nights","3-6 Nights","7-9 Nights","10-14 Nights","14+ Nights"];

function submitBookingbuddy(formName,popupValue)
{
	basicURL = new Array()
	basicURL['frm_bookHotels'] = 'http://ad.doubleclick.net/clk;213159045;32930078;b?http://rd.bookingbuddy.com/?r=bbs_bt_ros_unchecked-box-h_001'
	basicURL['frm_bookFlights'] = 'http://ad.doubleclick.net/clk;213200298;32930078;y?http://rd.bookingbuddy.com/?r=bbs_bt_ros_unchecked-box-a_001'
	basicURL['frm_bookCars'] = 'http://ad.doubleclick.net/clk;213200302;32930078;k?http://rd.bookingbuddy.com/?r=bbs_bt_ros_unchecked-box-c_001'
	basicURL['frm_bookCruises'] = 'http://ad.doubleclick.net/clk;216345708;32930078;h?http://ad.doubleclick.net/clk;216334424;38869409;p?http://rd.bookingbuddy.com/?r=bbs_bt_ros_unchecked-box-r_001'
	
	var formObj = eval('document.' + formName);
	var _qs = basicURL[formName];
	
	if( formName == 'frm_bookHotels' )
	{
	  _qs += "&arrival_city="+document.forms[formName].CITY.value;
	  _qs += "&arrival_month="+bookingBuddyMonthYear(document.forms[formName].CheckInDate.value);
	  _qs += "&arrival_day="+bookingBuddyDay(document.forms[formName].CheckInDate.value);
	  _qs += "&departure_month="+bookingBuddyMonthYear(document.forms[formName].CheckOutDate.value);
	  _qs += "&departure_day="+bookingBuddyDay(document.forms[formName].CheckOutDate.value);
	  _qs += "&num_rooms="+document.forms[formName].ROOMS.value;
	  _qs += "&num_travelers="+document.forms[formName].ROOMS.value;
	}
	
	if( formName == 'frm_bookFlights' )
	{
	  _qs += "&departure_city="+document.forms[formName].DepCity.value;
	  _qs += "&arrival_city="+document.forms[formName].ArrCity.value;
	  _qs += "&departure_month="+bookingBuddyMonthYear(document.forms[formName].DepartureDate.value);
	  _qs += "&departure_day="+bookingBuddyDay(document.forms[formName].DepartureDate.value);
	  _qs += "&return_month="+bookingBuddyMonthYear(document.forms[formName].ReturnDate.value);
	  _qs += "&return_day="+bookingBuddyDay(document.forms[formName].ReturnDate.value);
	  _qs += "&num_travelers="+document.forms[formName].NUMTICKETS.value;
	}
	
	if( formName == 'frm_bookCars' )
	{
	  _qs += "&pickup_city="+document.forms[formName].PickUpLoc.value;
	  _qs += "&pickup_month="+bookingBuddyMonthYear(document.forms[formName].PickUpDate.value);
	  _qs += "&pickup_day="+bookingBuddyDay(document.forms[formName].PickUpDate.value);
	  _qs += "&dropoff_month="+bookingBuddyMonthYear(document.forms[formName].DropOffDate.value);
	  _qs += "&dropoff_day="+bookingBuddyDay(document.forms[formName].DropOffDate.value);
	  _qs += "&pickup_time:time=17";
	  _qs += "&dropoff_time:time=17";
	}
	
	if( formName == 'frm_bookCruises' )
	{
	  _qs += "&destination="+getCruiseDest(document.forms[formName].places.value, bbCruiseDest);
	  _qs += "&cruise_line="+getCruiseLine(document.forms[formName].operator.value, bbCruiseLines);
	  _qs += "&cruise_length="+getCruiseLen(document.forms[formName].days.value, bbCruiseLens);
	  _qs += "&travel_month="+bookingBuddyYYYYMMDD(document.forms[formName].month.value);
	}	

	//prompt('',_qs)
	// openPopUp(window.open(_qs,'BookingBuddy','menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=825, height=500, left='+popupValue+', top='+popupValue));
	win4 = window.open(_qs,'BookingBuddy','menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=825, height=500, left='+popupValue+', top='+popupValue);
	openPopUp(win4);
}

function submitTripadvisor(formName,popupValue)
{
	basicURL = new Array()
	basicURL['frm_bookHotels'] = 'http://ad.doubleclick.net/clk;216171394;32930078;f?http://www.tripadvisor.com/HACSearch?m=12007'
	basicURL['frm_bookFlights'] = 'http://ad.doubleclick.net/clk;216953734;32930078;l?http://www.tripadvisor.com/CheapFlights?m=12184'	
	
	var formObj = eval('document.' + formName);
	var _qs = basicURL[formName];
	
	if( formName == 'frm_bookHotels' )
	{
	  _qs += "&q="+document.forms[formName].CITY.value;
	  _qs += "&inDay="+formatDateBT(new Date(document.forms[formName].CheckInDate.value), "dd");
	  _qs += "&inMonth="+formatDateBT(new Date(document.forms[formName].CheckInDate.value), "mm/yyyy");
	  _qs += "&outDay="+formatDateBT(new Date(document.forms[formName].CheckOutDate.value), "dd");
	  _qs += "&outMonth="+formatDateBT(new Date(document.forms[formName].CheckOutDate.value), "mm/yyyy");
	  _qs += "&adults="+document.forms[formName].ROOMS.value;
	}
	if( formName == 'frm_bookFlights' )
	{
	  _qs += "&travelers="+document.forms[formName].NUMTICKETS.value;
	  _qs += "&cos=0&nonstop=no";
	  _qs += "&airport[0]="+document.forms[formName].DepCity.value;
	  _qs += "&nearby[0]=no";	  
	  _qs += "&airport[1]="+document.forms[formName].ArrCity.value;
	  _qs += "&nearby[1]=no";	
	  _qs += "&date[0]="+document.forms[formName].DepartureDate.value;
	  _qs += "&time[0]=anytime";	  
	  _qs += "&date[1]="+document.forms[formName].ReturnDate.value;	  
	  _qs += "&time[1]=anytime";		  
	}

	//prompt('',_qs)
	// openPopUp(window.open(_qs,'Tripadvisor','menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=825, height=500, left='+popupValue+', top='+popupValue));
	win5 = window.open(_qs,'Tripadvisor','menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=825, height=500, left='+popupValue+', top='+popupValue);
	openPopUp(win5);
}

function submitGetaroom(formName,popupValue)
{
	basicURL = new Array()
	basicURL['frm_bookHotels'] = 'http://ad.doubleclick.net/clk;216615038;32930078;d?http://www.getaroom.com/searches/show?'
	
	
	var formObj = eval('document.' + formName);
	var _qs = basicURL[formName];
	
	if( formName == 'frm_bookHotels' )
	{
	  _qs += "destination="+document.forms[formName].CITY.value;
	  _qs += "&check_in="+formatDateBT(new Date(document.forms[formName].CheckInDate.value), "mm");
	  _qs += "%2F"+formatDateBT(new Date(document.forms[formName].CheckInDate.value), "dd");
	  _qs += "%2F"+formatDateBT(new Date(document.forms[formName].CheckInDate.value), "yyyy");
	  _qs += "&check_out="+formatDateBT(new Date(document.forms[formName].CheckOutDate.value), "mm");
	  _qs += "%2F"+formatDateBT(new Date(document.forms[formName].CheckOutDate.value), "dd");
	  _qs += "%2F"+formatDateBT(new Date(document.forms[formName].CheckOutDate.value), "yyyy");
	  _qs += "&tracking_id=budgettravel02";
	}

	// prompt('',_qs)	
	// openPopUp(window.open(_qs,'Getaroom','menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=825, height=500, left='+popupValue+', top='+popupValue));
	win6 = window.open(_qs,'Getaroom','menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=825, height=500, left='+popupValue+', top='+popupValue);
	openPopUp(win6);
}

function submitExpedia(formName,popupValue)
{

	basicURL = new Array();
//Click URL - need to check
	basicURL['frm_bookHotels'] = 'http://ad.doubleclick.net/clk;217624389;32930078;n?http://clk.atdmt.com/TC2/go/167219406/direct/01/&http://www.expedia.com/pubspec/scripts/eap.asp?GOTO=HOTSEARCH&SearchType=Destination';
	basicURL['frm_bookFlights'] = 'http://ad.doubleclick.net/clk;217624386;32930078;k?http://clk.atdmt.com/TC2/go/167219407/direct/01/&http://www.expedia.com/pubspec/scripts/eap.asp?GOTO=EXPFLTWIZ&load=1&TripType=Roundtrip';
	basicURL['frm_bookCars'] = 'http://ad.doubleclick.net/clk;217624387;32930078;l?http://clk.atdmt.com/TC2/go/167219408/direct/01/&http://www.expedia.com/pubspec/scripts/eap.asp?GOTO=CARSEARCH&SearchType=Place';
	var formObj = eval('document.' + formName);
	var _qs = basicURL[formName];

	if( formName == 'frm_bookHotels' )
	{
	  _qs += "&CityName="+document.forms[formName].CITY.value;
	  _qs += "&InDate="+document.forms[formName].CheckInDate.value;
	  _qs += "&OutDate="+document.forms[formName].CheckOutDate.value;	  
	  _qs += "&NumRoom="+document.forms[formName].ROOMS.value;	  
	
	}
	if( formName == 'frm_bookFlights' )
	{
	  
	  _qs += "&FrAirport="+document.forms[formName].DepCity.value;
	  _qs += "&ToAirport="+document.forms[formName].ArrCity.value;	   
	  _qs += "&FromDate="+document.forms[formName].DepartureDate.value;
	  _qs += "&FromTime=362";
	  _qs += "&ToDate="+document.forms[formName].ReturnDate.value;	  
	  _qs += "&ToTime=362";
	  _qs += "&NumAdult="+document.forms[formName].NUMTICKETS.value;

	}
	if( formName == 'frm_bookCars' )
	{
	  _qs += "&PickUpLoc="+document.forms[formName].PickUpLoc.value;
	  _qs += "&FromDate="+document.forms[formName].PickUpDate.value;
	  _qs += "&PickUpTime=11AM";
	  _qs += "&ToDate="+document.forms[formName].DropOffDate.value;
	}

//	prompt('',_qs)	
	win7 = window.open(_qs,'Expedia','menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=825, height=500, left='+popupValue+', top='+popupValue);
	openPopUp(win7);


}
function submitTravelTicker(formName,popupValue)
{

	basicURL = new Array();
	basicURL['frm_bookHotels'] = 'http://ad.doubleclick.net/clk;217288028;32930078;j?http://www.travel-ticker.com/category.jsp?actionType=1&categoryType=Type&categoryName=Hotels&vert=hotel';
	basicURL['frm_bookFlights'] = 'http://ad.doubleclick.net/clk;217288029;32930078;k?http://www.travel-ticker.com/category.jsp?actionType=1&categoryType=Type&categoryName=Flights&vert=air';
	basicURL['frm_bookCars'] = 'http://ad.doubleclick.net/clk;217288027;32930078;i?http://www.travel-ticker.com/category.jsp?actionType=1&categoryType=Type&categoryName=Cars&vert=car';

	var formObj = eval('document.' + formName);
	var _qs = basicURL[formName];

	if( formName == 'frm_bookHotels' )
	{
	  _qs += "&dest="+document.forms[formName].CITY.value;
	  _qs += "&startDate="+document.forms[formName].CheckInDate.value;
	  _qs += "&endDate="+document.forms[formName].CheckOutDate.value;	  
	  _qs += "&numRooms="+document.forms[formName].ROOMS.value;	  
  	  _qs += "&sid=S316&bid=B311497";
	}
	if( formName == 'frm_bookFlights' )
	{
	  _qs += "&orig="+document.forms[formName].DepCity.value;
	  _qs += "&dest="+document.forms[formName].ArrCity.value;	   
	  _qs += "&startDate="+document.forms[formName].DepartureDate.value;
	  _qs += "&endDate="+document.forms[formName].ReturnDate.value;	  
	  _qs += "&noOfTickets="+document.forms[formName].NUMTICKETS.value;
	  _qs += "&sid=S316&bid=B311499";
	}
	if( formName == 'frm_bookCars' )
	{
	  _qs += "&dest="+document.forms[formName].PickUpLoc.value;
	  _qs += "&startDate="+document.forms[formName].PickUpDate.value;
	  _qs += "&startTime=1000";
	  _qs += "&endDate="+document.forms[formName].DropOffDate.value;
	  _qs += "&endTime=1000"
	  _qs += "&sid=S316&bid=B311496";
	}

	//prompt('',_qs);	
	win10 = window.open(_qs,'Travel Ticker','menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=825, height=500, left='+popupValue+', top='+popupValue);
	openPopUp(win10);

}
function submitHotwire(formName,popupValue)
{

	basicURL = new Array();
	basicURL['frm_bookHotels'] = 'http://ad.doubleclick.net/clk;217288086;32930078;n?http://www.hotwire.com/hotel/search-options.jsp?sid=S316&bid=B311809&inputid=hotel-index';
	basicURL['frm_bookFlights'] = 'http://ad.doubleclick.net/clk;217288083;32930078;k?http://www.hotwire.com/air/search-options.jsp?sid=S316&bid=B311808&inputId=index';
	basicURL['frm_bookCars'] = 'http://ad.doubleclick.net/clk;217288084;32930078;l?http://www.hotwire.com/car/search-options.jsp?';

	var formObj = eval('document.' + formName);
	var _qs = basicURL[formName];

	if( formName == 'frm_bookHotels' )
	{
	  _qs += "&destCity="+document.forms[formName].CITY.value;
	  _qs += "&startDay="+formatDateBT(new Date(document.forms[formName].CheckInDate.value),"dd");
	  _qs += "&startMonth="+formatDateBT(new Date(document.forms[formName].CheckInDate.value),"mm");
	  _qs += "&endDay="+formatDateBT(new Date(document.forms[formName].CheckOutDate.value),"dd");
	  _qs += "&endmonth="+formatDateBT(new Date(document.forms[formName].CheckOutDate.value),"mm");
	}
	if( formName == 'frm_bookFlights' )
	{
	  _qs += "&origCity="+document.forms[formName].DepCity.value;
	  _qs += "&destinationCity="+document.forms[formName].ArrCity.value;	   
	  _qs += "&startDay="+formatDateBT(new Date(document.forms[formName].DepartureDate.value),"dd");
	  _qs += "&startMonth="+formatDateBT(new Date(document.forms[formName].DepartureDate.value),"mm");
	  _qs += "&endDay="+formatDateBT(new Date(document.forms[formName].ReturnDate.value),"dd");
	  _qs += "&endmonth="+formatDateBT(new Date(document.forms[formName].ReturnDate.value),"mm");
	  _qs += "&noOfTickets="+document.forms[formName].NUMTICKETS.value;
	}
	if( formName == 'frm_bookCars' )
	{
	  _qs += "&startLocation="+document.forms[formName].PickUpLoc.value;
	  _qs += "&startDay="+formatDateBT(new Date(document.forms[formName].PickUpDate.value),"dd");
	  _qs += "&startMonth="+formatDateBT(new Date(document.forms[formName].PickUpDate.value),"mm");
	  _qs += "&endDay="+formatDateBT(new Date(document.forms[formName].DropOffDate.value),"dd");
	  _qs += "&endMonth="+formatDateBT(new Date(document.forms[formName].DropOffDate.value),"mm");
	  _qs += "&startTime=1500";
	  _qs += "&endTime=1500"
	  _qs += "&startSearchType=N&inputId=index&selectedCarTypes=ECAR&sid=s316&bid=B31181";
	}

//	prompt('',_qs);	
	win11 = window.open(_qs,'Hotwire','menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=825, height=500, left='+popupValue+', top='+popupValue);
	openPopUp(win11);

}

function submitTrip(formName,popupValue)
{
	basicURL = new Array();
	basicURL['frm_bookHotels'] = 'http://ad.doubleclick.net/clk;217705496;32930078;m?http://www.trip.com/index.html?type=hotel';
	basicURL['frm_bookFlights'] = 'http://ad.doubleclick.net/clk;217705497;32930078;n?http://www.trip.com/index.html?type=flight';
	var formObj = eval('document.' + formName);
	var _qs = basicURL[formName];

	if( formName == 'frm_bookHotels' )
	{
	  _qs += "&hoWhere="+document.forms[formName].CITY.value;
	  _qs += "&checkIn="+document.forms[formName].CheckInDate.value;
	  _qs += "&checkOut="+document.forms[formName].CheckOutDate.value;	  
	  _qs += "&rooms="+document.forms[formName].ROOMS.value;	  
  	  _qs += "&cmpid=105";
	}
	if( formName == 'frm_bookFlights' )
	{
	  _qs += "&airFrom="+document.forms[formName].DepCity.value;
	  _qs += "&airTo="+document.forms[formName].ArrCity.value;	   
	  _qs += "&deptDate="+document.forms[formName].DepartureDate.value;
	  _qs += "&rtnDate="+document.forms[formName].ReturnDate.value;	  
	  _qs += "&travelers="+document.forms[formName].NUMTICKETS.value;
	  _qs += "&cmpid=104";
	}

//	prompt('',_qs);	
	win9 = window.open(_qs,'Trip','menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=825, height=500, left='+popupValue+', top='+popupValue);
	openPopUp(win9);


}
function submitCarRentals(formName,popupValue)
{

	basicURL = new Array();
	basicURL['frm_bookCars'] = 'http://ad.doubleclick.net/clk;217284236;32930078;g?http://www.carrentals.com/?cid=12329';
	var formObj = eval('document.' + formName);
	var _qs = basicURL[formName];

	if( formName == 'frm_bookCars' )
	{
	  _qs += "&pickupMonthYear="+formatDateBT(new Date(document.forms[formName].PickUpDate.value),"yymm");
	  _qs += "&pickupDay="+formatDateBT(new Date(document.forms[formName].PickUpDate.value),"dd");
	  _qs += "&pickupTime=10";
	  _qs += "&dropoffMonthYear="+formatDateBT(new Date(document.forms[formName].DropOffDate.value),"yymm");
	  _qs += "&dropoffDay="+formatDateBT(new Date(document.forms[formName].DropOffDate.value),"dd");
	  _qs += "&dropoffTime=10";
	  _qs += "&pu="+document.forms[formName].PickUpLoc.value;
	}

//	prompt('',_qs);	
	win8 = window.open(_qs,'CarRentals','menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=825, height=500, left='+popupValue+', top='+popupValue);
	openPopUp(win8);

}
function bookingBuddyMonthYear(date)
{
  var bookingBuddyDt = new Date(date);
  
  if(bookingBuddyDt.getMonth() < 9)  
  {
    formatMonth = bookingBuddyDt.getMonth()+1;
    formatMonth = 0+""+formatMonth;
  }else{
    formatMonth = bookingBuddyDt.getMonth()+1;
  }
  return formatMonth+" "+bookingBuddyDt.getFullYear();
}

function bookingBuddyDay(date)
{
  var bookingBuddyDt = new Date(date);
  return bookingBuddyDt.getDate();
}


function orbitzMonthYear(date)
{
  var orbitzDt = new Date(date);
  return orbitz_month_names[orbitzDt.getMonth()] +"+"+orbitzDt.getFullYear();
}

function orbitzDay(date)
{
  var orbitzDt = new Date(date);
  return orbitzDt.getDate();
}

function getCruiseDest(selectedDest, destList)
{
  //alert("selected Dest:"+selectedDest);
  var bbDest = "";  
  for(i=0; i<destList.length; i++) { 
      if(destList[i].indexOf(selectedDest+"#") == 0)
      {
      	bbDest = destList[i].split("#")[1];
      	break;
      }
  }  
  if(bbDest == "")
  {
    bbDest = selectedDest;
  }
  return bbDest;
}

function getCruiseLine(selectedLine, cruiseLineList)
{  
  //alert("selected line:"+selectedLine);
  var bbCruiseLine = "";  
  for(i=0; i<cruiseLineList.length; i++) {
      if(cruiseLineList[i].indexOf(selectedLine+"#") == 0)
      {
      	bbCruiseLine = cruiseLineList[i].split("#")[1];
      	break;
      }
  }  
  if(bbCruiseLine == "")
  {
    bbCruiseLine = selectedLine;
  }
  return bbCruiseLine;
}


function getCruiseLen(selectedLen, cruiseLenList)
{  
  //alert("selected length:"+selectedLen);
  var bbCruiseLen = "";  
  
  if(selectedLen == "ALL")
  {
    bbCruiseLen = cruiseLenList[0];
  }else if( selectedLen < cruiseLenList.length ){
    bbCruiseLen = cruiseLenList[selectedLen]; 	
  }else{
    bbCruiseLen = selectedLen; 	
  }
  return bbCruiseLen;
}

function bookingBuddyYYYYMMDD(selectedMonth)
{
  //alert("selectedMonth::"+selectedMonth);
  var cruiseDtStr = "";
  if( selectedMonth == "ALL" )
  {
    cruiseDtStr = "";
  }else{
    cruiseDtStr = formatDateBT(new Date(selectedMonth), "yyyy-mm-dd")
  }  
  return cruiseDtStr;
}

function formatDateBT(formatDate, formatString) {
	if(formatDate instanceof Date) {
		var months = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
		var yyyy = formatDate.getFullYear();
		var yy = yyyy.toString().substring(2);
		var m = formatDate.getMonth()+1;
		var mm = m < 10 ? "0" + m : m;
		var mmm = months[m];
		var d = formatDate.getDate();
		var dd = d < 10 ? "0" + d : d;
		
		var h = formatDate.getHours();
		var hh = h < 10 ? "0" + h : h;
		var n = formatDate.getMinutes();
		var nn = n < 10 ? "0" + n : n;
		var s = formatDate.getSeconds();
		var ss = s < 10 ? "0" + s : s;

		formatString = formatString.replace(/yyyy/i, yyyy);
		formatString = formatString.replace(/yy/i, yy);
		formatString = formatString.replace(/mmm/i, mmm);
		formatString = formatString.replace(/mm/i, mm);
		formatString = formatString.replace(/m/i, m);
		formatString = formatString.replace(/dd/i, dd);
		formatString = formatString.replace(/d/i, d);
		formatString = formatString.replace(/hh/i, hh);
		formatString = formatString.replace(/h/i, h);
		formatString = formatString.replace(/nn/i, nn);
		formatString = formatString.replace(/n/i, n);
		formatString = formatString.replace(/ss/i, ss);
		formatString = formatString.replace(/s/i, s);

		return formatString;
	} else {
		return "";
	}
}


var x = navigator;
var browserAgent = x.userAgent;
var browserIE = new RegExp('MSIE');
var browserFF = new RegExp('Firefox');
var browserSF = new RegExp('Safari');
var browserCH = new RegExp('Chrome');
var browserWIN = new RegExp('Windows');

function browserDetect1()
{
	var msgText = '';

	if (browserIE.test(browserAgent) == true)
	{
		// msgText = 'You\'re using IE!';
		msgText = '<div class="msg_browser"><img class="infobar_img" src="http://www.budgettravel.com/bt-srv/includes/global/modules/rr_booking/images/infobar-ie_001.gif" /><p>If you see the "Pop-up blocked" warning bar above, Internet Explorer\'s pop-up blocker is enabled.<br /><br /><strong>To disable it:</strong><br /><strong>1.</strong> Click the warning bar above.<br /><strong>2.</strong> Choose "Always allow pop-ups from this site".<br /><strong>3.</strong> Click "Yes" to allow pop-ups on BudgetTravel.com.<br /><strong>4.</strong> Search again, and you\'ll see your price comparisons!</p></div><div class="msg_other"><p>If you don\'t see the warning bar, check toolbars for popup blocker icons &gt;&gt;</p><img class="otherblockers_img" src="http://www.budgettravel.com/bt-srv/includes/global/modules/rr_booking/images/other-blockers_001.gif" /></div>';
	}
	else if (browserFF.test(browserAgent) == true)
	{
		// msgText = 'You\'re using Firefox!';
		if (browserWIN.test(browserAgent) == true)
		{
			msgText = '<div class="msg_browser"><img class="infobar_img" src="http://www.budgettravel.com/bt-srv/includes/global/modules/rr_booking/images/infobar-ff_001.gif" /><p>If you see the "pop-up window" warning bar above, then Firefox\'s pop-up blocker is enabled.  To disable it:<br /><br /><strong>1.</strong> Click the "Options" button above<br /><strong>2.</strong> Choose "Always allow pop-ups for budgettravel.com".</p></div><div class="msg_other"><img class="otherblockers_img" src="http://www.budgettravel.com/bt-srv/includes/global/modules/rr_booking/images/other-blockers_001.gif" /><p>If you don\'t see the warning bar, check toolbars for popup blocker warnings.</p></div>';
		}
		else
		{
			msgText = '<div class="msg_browser"><img class="infobar_img" src="http://www.budgettravel.com/bt-srv/includes/global/modules/rr_booking/images/infobar-ff_001.gif" /><p>If you see the "pop-up window" warning bar above, then Firefox\'s pop-up blocker is enabled.  To disable it:<br /><br /><strong>1.</strong> Click the "Options" button above<br /><strong>2.</strong> Choose "Always allow pop-ups for budgettravel.com".</p></div><div class="msg_other"><img class="otherblockers_img" src="http://www.budgettravel.com/bt-srv/includes/global/modules/rr_booking/images/other-blockers_001.gif" /><p>If you don\'t see the warning bar, check toolbars for popup blocker warnings.</p></div>';
		}
	}
	else if (browserSF.test(browserAgent) == true && browserCH.test(browserAgent) == false)
	{
		// msgText = 'You\'re using Safari!';
		if (browserWIN.test(browserAgent) == true)
		{
			msgText = '<p>Safari\'s pop-up blocker is enabled.  To disable it, click the "Settings" button above <img src="http://www.budgettravel.com/bt-srv/includes/global/modules/rr_booking/images/safari-settings_001.gif" /> and un-check "Block pop-up windows".</p><p>If it\'s already un-checked, then some other pop-up blocker is enabled on your computer.';
		}
		else
		{
			msgText = '<p>Safari\'s pop-up blocker is enabled.';
		}
	}
	else if (browserCH.test(browserAgent) == true)
	{
		msgText = '';
	}
	else
	{
		msgText = '';
	}

	return msgText;
}

function openPopUp(popUp)
{
	// currentPopUp = popUp;  /* sigh - not working for some reason */
	
	if ( (popUp == null || typeof(popUp) == 'undefined') && !popupBlockMsgInd )
	{
		$(function()
		{
			$('#wrapper_main').lightBox();
			popupBlockMsgInd = true;
			this.focus();
		});
	}
	else
	{
		// return false;
	}
}