var aDay = 86400000;
var past_date = new Date();
past_date = new Date(past_date.valueOf() - aDay);
//<!--
function ss(w){window.status=w;return true;}
function cs(){window.status='';}
function ga(l){if (l) location.href=l;}
function enabled_searchDateOption(clicked, type)
{
	var f = document.getElementById(type);
	var workRange;
	if (type == "SoldSearch")
	{
		workRange = new Array("FromMonth", "FromDate", "FromYear", "ToMonth", "ToDate", "ToYear");
	}
	else if (type == "BookingSearch")
	{
		workRange = new Array("Month", "Date", "Year");
	}
	if (workRange)
	{
		f['searchByBar'].disabled = !clicked;
		for (i=0; i<workRange.length; i++)
		{
			f[workRange[i]].disabled = clicked;
		}
	}
}	

function Device_OnLoad()
{
	if (navigator.userAgent.indexOf("Windows CE") != -1) 
	{
		window.location="http://www.gotobus.com/palm.html";
	}
}

function Vendor_onLoad(sold, booking)
{
	var s  = document.getElementById('SoldSearch');
	var b = document.getElementById('BookingSearch');
	if (s)
	{
		enabled_searchDateOption(sold, 'SoldSearch');
	}
	if (b)
	{
		enabled_searchDateOption(booking, 'BookingSearch');
	}
}

function opener_url(url)
{
        var target = window;
        if (window.opener != null && window.opener.closed == false)
        {
                target = window.opener;
        }
        target.location.href=url;
        target.focus();
        return false;
}


function open_url_param(url, date)
{
	var lnk = url;
	if (date != "")
	{
		if (lnk.match(/\?/))
		{
			lnk += "&d="+date;
		}
		else
		{
			lnk += "?"+date;
		}
	}
	opener_url(lnk);
}

function set_gid_cookie(value, expires)
{
	var name = "gid";
    var today = new Date();
    today.setTime(today.getTime());
    if (!expires)
    {
    	expires = 7;
    }
    expires = expires * 1000 * 60 * 60 * 24;
    var expires_date = new Date(today.getTime() + expires);
    document.cookie = name + "=" +escape(value) + (expires ? ";expires=" + expires_date.toGMTString() : "") + ";path=/;domain=gotobus.com";
}

function pre_set_data()
{
	var date = null;
	if (window.location.search.length>0)
	{
		data = window.location.search.substring(1);
		if (data.match(/-/))
		{
			var s  = document.getElementById('Date');
			set_tour_date (s, data);
		}
		else
		{
			set_gid_cookie(data);
		}
	}
}


function pre_set_date()
{
	var date = null;
	if (window.location.search.length>0)
	{
		date = window.location.search.substring(1);
		var s  = document.getElementById('Date');
		set_tour_date (s, date);
	}
}

function set_tour_date(obj, selected_date)
{
	if (obj == null || selected_date == null || selected_date == "")
	{
		return;
	}

	var sdate = selected_date.substr(0, 10);
	for (var i=0; i< obj.options.length; i++)
	{
		var val = obj.options[i].value;
		if (val != "")
		{
			val = val.substr(0,10);
			if (sdate.match(val))
			{
				obj.options.selectedIndex = i;
				return;
			}
		}
	}
}

function OnCalendarClick()
{
        window.open("http://www.gotobus.com/calendar/calendar.html", "calendar", 'width=240,height=200');
}

var browser = window.navigator.appName;
var isIE = false;
var Win = navigator.userAgent.indexOf("Win") > -1;
var MSIE = navigator.appName == "Microsoft Internet Explorer";

if (Win && MSIE)
{
    var n = navigator.userAgent;
    var MSIEVer = n.substr(n.indexOf("MSIE ")+("MSIE ").length, 4);
    MSIEVer = parseFloat(MSIEVer); 
    if (MSIEVer > 5.0)
	isIE = true;
}

function addToFavorites(url, title)
{
    if (window.external)
    {
        window.external.AddFavorite(url, title)
    }
    else
    { 
        alert("Sorry! Your browser doesn't support this function.");
    }
}

var d_about_up = "http://www.gotobus.com/images/explore_up.gif";
var d_about_down = "http://www.gotobus.com/images/explore_down.gif";
function changeImage_aboutus()
{
    if (document.images) {
        if (document.myImage_aboutus.src == d_about_up)
            document.myImage_aboutus.src = d_about_down;
        else
            document.myImage_aboutus.src = d_about_up;
    }
}

function SwitchMenu(obj)
{
    if(document.getElementById) {
        var el = document.getElementById(obj);
        if(el.style.display != "block")
            el.style.display = "block";
        else
            el.style.display = "none";
        changeImage_aboutus();
    }
}

function set_selected(obj, v)
{
    for (var i=0; i<obj.options.length; i++)
    {
        if (obj.options[i].value == v)
        {
            obj.options.selectedIndex = i;
            return i;
        }
    }
    return -1;
}

function clear_show_all_text(obj)
{
        if (obj && obj.value == "Show All")
        {
                obj.value = "";
        }
}

function set_cookie(name, value, expires) 
{
    var today = new Date();
    today.setTime(today.getTime());
    if (expires)
    {
        expires = expires * 1000 * 60 * 60 * 24;
    }
    var expires_date = new Date(today.getTime() + expires);
    document.cookie = name + "=" +escape(value) + (expires ? ";expires=" + expires_date.toGMTString() : "") + ";path=/;domain=gotobus.com";
}

function get_cookie(name)
{
    var start = document.cookie.indexOf( name + "=" );
    var len = start + name.length + 1;
    if ((!start) && (name != document.cookie.substring(0, name.length)))
    {
        return null;
    }
    if (start == -1) return null;
    var end = document.cookie.indexOf(";", len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len, end));
}

function Trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

//-->

// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. 
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================

/* SOURCE FILE: AnchorPosition.js */
function getAnchorPosition(anchorname){var useWindow=false;var coordinates=new Object();var x=0,y=0;var use_gebi=false, use_css=false, use_layers=false;if(document.getElementById){use_gebi=true;}else if(document.all){use_css=true;}else if(document.layers){use_layers=true;}if(use_gebi && document.all){x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);}else if(use_gebi){var o=document.getElementById(anchorname);x=AnchorPosition_getPageOffsetLeft(o);y=AnchorPosition_getPageOffsetTop(o);}else if(use_css){x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);}else if(use_layers){var found=0;for(var i=0;i<document.anchors.length;i++){if(document.anchors[i].name==anchorname){found=1;break;}}if(found==0){coordinates.x=0;coordinates.y=0;return coordinates;}x=document.anchors[i].x;y=document.anchors[i].y;}else{coordinates.x=0;coordinates.y=0;return coordinates;}coordinates.x=x;coordinates.y=y;return coordinates;}
function getAnchorWindowPosition(anchorname){var coordinates=getAnchorPosition(anchorname);var x=0;var y=0;if(document.getElementById){if(isNaN(window.screenX)){x=coordinates.x-document.body.scrollLeft+window.screenLeft;y=coordinates.y-document.body.scrollTop+window.screenTop;}else{x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;}}else if(document.all){x=coordinates.x-document.body.scrollLeft+window.screenLeft;y=coordinates.y-document.body.scrollTop+window.screenTop;}else if(document.layers){x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;}coordinates.x=x;coordinates.y=y;return coordinates;}
function AnchorPosition_getPageOffsetLeft(el){var ol=el.offsetLeft;while((el=el.offsetParent) != null){ol += el.offsetLeft;}return ol;}
function AnchorPosition_getWindowOffsetLeft(el){return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;}
function AnchorPosition_getPageOffsetTop(el){var ot=el.offsetTop;while((el=el.offsetParent) != null){ot += el.offsetTop;}return ot;}
function AnchorPosition_getWindowOffsetTop(el){return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;}

/* SOURCE FILE: date.js */
var MONTH_NAMES=new Array('January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');var DAY_NAMES=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sun','Mon','Tue','Wed','Thu','Fri','Sat');
function LZ(x){return(x<0||x>9?"":"0")+x}
function isDate(val,format){var date=getDateFromFormat(val,format);if(date==0){return false;}return true;}
function compareDates(date1,dateformat1,date2,dateformat2){var d1=getDateFromFormat(date1,dateformat1);var d2=getDateFromFormat(date2,dateformat2);if(d1==0 || d2==0){return -1;}else if(d1 > d2){return 1;}return 0;}
function formatDate(date,format){format=format+"";var result="";var i_format=0;var c="";var token="";var y=date.getYear()+"";var M=date.getMonth()+1;var d=date.getDate();var E=date.getDay();var H=date.getHours();var m=date.getMinutes();var s=date.getSeconds();var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;var value=new Object();if(y.length < 4){y=""+(y-0+1900);}value["y"]=""+y;value["yyyy"]=y;value["yy"]=y.substring(2,4);value["M"]=M;value["MM"]=LZ(M);value["MMM"]=MONTH_NAMES[M-1];value["NNN"]=MONTH_NAMES[M+11];value["d"]=d;value["dd"]=LZ(d);value["E"]=DAY_NAMES[E+7];value["EE"]=DAY_NAMES[E];value["H"]=H;value["HH"]=LZ(H);if(H==0){value["h"]=12;}else if(H>12){value["h"]=H-12;}else{value["h"]=H;}value["hh"]=LZ(value["h"]);if(H>11){value["K"]=H-12;}else{value["K"]=H;}value["k"]=H+1;value["KK"]=LZ(value["K"]);value["kk"]=LZ(value["k"]);if(H > 11){value["a"]="PM";}else{value["a"]="AM";}value["m"]=m;value["mm"]=LZ(m);value["s"]=s;value["ss"]=LZ(s);while(i_format < format.length){c=format.charAt(i_format);token="";while((format.charAt(i_format)==c) &&(i_format < format.length)){token += format.charAt(i_format++);}if(value[token] != null){result=result + value[token];}else{result=result + token;}}return result;}
function _isInteger(val){var digits="1234567890";for(var i=0;i < val.length;i++){if(digits.indexOf(val.charAt(i))==-1){return false;}}return true;}
function _getInt(str,i,minlength,maxlength){for(var x=maxlength;x>=minlength;x--){var token=str.substring(i,i+x);if(token.length < minlength){return null;}if(_isInteger(token)){return token;}}return null;}
function getDateFromFormat(val,format){val=val+"";format=format+"";var i_val=0;var i_format=0;var c="";var token="";var token2="";var x,y;var now=new Date();var year=now.getYear();var month=now.getMonth()+1;var date=1;var hh=now.getHours();var mm=now.getMinutes();var ss=now.getSeconds();var ampm="";while(i_format < format.length){c=format.charAt(i_format);token="";while((format.charAt(i_format)==c) &&(i_format < format.length)){token += format.charAt(i_format++);}if(token=="yyyy" || token=="yy" || token=="y"){if(token=="yyyy"){x=4;y=4;}if(token=="yy"){x=2;y=2;}if(token=="y"){x=2;y=4;}year=_getInt(val,i_val,x,y);if(year==null){return 0;}i_val += year.length;if(year.length==2){if(year > 70){year=1900+(year-0);}else{year=2000+(year-0);}}}else if(token=="MMM"||token=="NNN"){month=0;for(var i=0;i<MONTH_NAMES.length;i++){var month_name=MONTH_NAMES[i];if(val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()){if(token=="MMM"||(token=="NNN"&&i>11)){month=i+1;if(month>12){month -= 12;}i_val += month_name.length;break;}}}if((month < 1)||(month>12)){return 0;}}else if(token=="EE"||token=="E"){for(var i=0;i<DAY_NAMES.length;i++){var day_name=DAY_NAMES[i];if(val.substring(i_val,i_val+day_name.length).toLowerCase()==day_name.toLowerCase()){i_val += day_name.length;break;}}}else if(token=="MM"||token=="M"){month=_getInt(val,i_val,token.length,2);if(month==null||(month<1)||(month>12)){return 0;}i_val+=month.length;}else if(token=="dd"||token=="d"){date=_getInt(val,i_val,token.length,2);if(date==null||(date<1)||(date>31)){return 0;}i_val+=date.length;}else if(token=="hh"||token=="h"){hh=_getInt(val,i_val,token.length,2);if(hh==null||(hh<1)||(hh>12)){return 0;}i_val+=hh.length;}else if(token=="HH"||token=="H"){hh=_getInt(val,i_val,token.length,2);if(hh==null||(hh<0)||(hh>23)){return 0;}i_val+=hh.length;}else if(token=="KK"||token=="K"){hh=_getInt(val,i_val,token.length,2);if(hh==null||(hh<0)||(hh>11)){return 0;}i_val+=hh.length;}else if(token=="kk"||token=="k"){hh=_getInt(val,i_val,token.length,2);if(hh==null||(hh<1)||(hh>24)){return 0;}i_val+=hh.length;hh--;}else if(token=="mm"||token=="m"){mm=_getInt(val,i_val,token.length,2);if(mm==null||(mm<0)||(mm>59)){return 0;}i_val+=mm.length;}else if(token=="ss"||token=="s"){ss=_getInt(val,i_val,token.length,2);if(ss==null||(ss<0)||(ss>59)){return 0;}i_val+=ss.length;}else if(token=="a"){if(val.substring(i_val,i_val+2).toLowerCase()=="am"){ampm="AM";}else if(val.substring(i_val,i_val+2).toLowerCase()=="pm"){ampm="PM";}else{return 0;}i_val+=2;}else{if(val.substring(i_val,i_val+token.length)!=token){return 0;}else{i_val+=token.length;}}}if(i_val != val.length){return 0;}if(month==2){if( ((year%4==0)&&(year%100 != 0) ) ||(year%400==0) ){if(date > 29){return 0;}}else{if(date > 28){return 0;}}}if((month==4)||(month==6)||(month==9)||(month==11)){if(date > 30){return 0;}}if(hh<12 && ampm=="PM"){hh=hh-0+12;}else if(hh>11 && ampm=="AM"){hh-=12;}var newdate=new Date(year,month-1,date,hh,mm,ss);return newdate.getTime();}
function parseDate(val){var preferEuro=(arguments.length==2)?arguments[1]:false;generalFormats=new Array('y-M-d','MMM d, y','MMM d,y','y-MMM-d','d-MMM-y','MMM d');monthFirst=new Array('M/d/y','M-d-y','M.d.y','MMM-d','M/d','M-d');dateFirst =new Array('d/M/y','d-M-y','d.M.y','d-MMM','d/M','d-M');var checkList=new Array('generalFormats',preferEuro?'dateFirst':'monthFirst',preferEuro?'monthFirst':'dateFirst');var d=null;for(var i=0;i<checkList.length;i++){var l=window[checkList[i]];for(var j=0;j<l.length;j++){d=getDateFromFormat(val,l[j]);if(d!=0){return new Date(d);}}}return null;}

/* SOURCE FILE: PopupWindow.js */
function PopupWindow_getXYPosition(anchorname){var coordinates;if(this.type == "WINDOW"){coordinates = getAnchorWindowPosition(anchorname);}else{coordinates = getAnchorPosition(anchorname);}this.x = coordinates.x;this.y = coordinates.y;}
function PopupWindow_setSize(width,height){this.width = width;this.height = height;}
function PopupWindow_populate(contents){this.contents = contents;this.populated = false;}
function PopupWindow_setUrl(url){this.url = url;}
function PopupWindow_setWindowProperties(props){this.windowProperties = props;}
function PopupWindow_refresh(){if(this.divName != null){if(this.use_gebi){document.getElementById(this.divName).innerHTML = this.contents;}else if(this.use_css){document.all[this.divName].innerHTML = this.contents;}else if(this.use_layers){var d = document.layers[this.divName];d.document.open();d.document.writeln(this.contents);d.document.close();}}else{if(this.popupWindow != null && !this.popupWindow.closed){if(this.url!=""){this.popupWindow.location.href=this.url;}else{this.popupWindow.document.open();this.popupWindow.document.writeln(this.contents);this.popupWindow.document.close();}this.popupWindow.focus();}}}
function PopupWindow_showPopup(anchorname){this.getXYPosition(anchorname);this.x += this.offsetX;this.y += this.offsetY;if(!this.populated &&(this.contents != "")){this.populated = true;this.refresh();}if(this.divName != null){if(this.use_gebi){document.getElementById(this.divName).style.left = this.x + "px";document.getElementById(this.divName).style.top = this.y + "px";document.getElementById(this.divName).style.visibility = "visible";}else if(this.use_css){document.all[this.divName].style.left = this.x;document.all[this.divName].style.top = this.y;document.all[this.divName].style.visibility = "visible";}else if(this.use_layers){document.layers[this.divName].left = this.x;document.layers[this.divName].top = this.y;document.layers[this.divName].visibility = "visible";}}else{if(this.popupWindow == null || this.popupWindow.closed){if(this.x<0){this.x=0;}if(this.y<0){this.y=0;}if(screen && screen.availHeight){if((this.y + this.height) > screen.availHeight){this.y = screen.availHeight - this.height;}}if(screen && screen.availWidth){if((this.x + this.width) > screen.availWidth){this.x = screen.availWidth - this.width;}}var avoidAboutBlank = window.opera ||( document.layers && !navigator.mimeTypes['*']) || navigator.vendor == 'KDE' ||( document.childNodes && !document.all && !navigator.taintEnabled);this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"");}this.refresh();}}
function PopupWindow_hidePopup(){if(this.divName != null){if(this.use_gebi){document.getElementById(this.divName).style.visibility = "hidden";}else if(this.use_css){document.all[this.divName].style.visibility = "hidden";}else if(this.use_layers){document.layers[this.divName].visibility = "hidden";}}else{if(this.popupWindow && !this.popupWindow.closed){this.popupWindow.close();this.popupWindow = null;}}}
function PopupWindow_isClicked(e){if(this.divName != null){if(this.use_layers){var clickX = e.pageX;var clickY = e.pageY;var t = document.layers[this.divName];if((clickX > t.left) &&(clickX < t.left+t.clip.width) &&(clickY > t.top) &&(clickY < t.top+t.clip.height)){return true;}else{return false;}}else if(document.all){var t = window.event.srcElement;while(t.parentElement != null){if(t.id==this.divName){return true;}t = t.parentElement;}return false;}else if(this.use_gebi && e){var t = e.originalTarget;while(t.parentNode != null){if(t.id==this.divName){return true;}t = t.parentNode;}return false;}return false;}return false;}
function PopupWindow_hideIfNotClicked(e){if(this.autoHideEnabled && !this.isClicked(e)){this.hidePopup();}}
function PopupWindow_autoHide(){this.autoHideEnabled = true;}
function PopupWindow_hidePopupWindows(e){for(var i=0;i<popupWindowObjects.length;i++){if(popupWindowObjects[i] != null){var p = popupWindowObjects[i];p.hideIfNotClicked(e);}}}
function PopupWindow_attachListener(){if(document.layers){document.captureEvents(Event.MOUSEUP);}window.popupWindowOldEventListener = document.onmouseup;if(window.popupWindowOldEventListener != null){document.onmouseup = new Function("window.popupWindowOldEventListener();PopupWindow_hidePopupWindows();");}else{document.onmouseup = PopupWindow_hidePopupWindows;}}
function PopupWindow(){if(!window.popupWindowIndex){window.popupWindowIndex = 0;}if(!window.popupWindowObjects){window.popupWindowObjects = new Array();}if(!window.listenerAttached){window.listenerAttached = true;PopupWindow_attachListener();}this.index = popupWindowIndex++;popupWindowObjects[this.index] = this;this.divName = null;this.popupWindow = null;this.width=0;this.height=0;this.populated = false;this.visible = false;this.autoHideEnabled = false;this.contents = "";this.url="";this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";if(arguments.length>0){this.type="DIV";this.divName = arguments[0];}else{this.type="WINDOW";}this.use_gebi = false;this.use_css = false;this.use_layers = false;if(document.getElementById){this.use_gebi = true;}else if(document.all){this.use_css = true;}else if(document.layers){this.use_layers = true;}else{this.type = "WINDOW";}this.offsetX = 0;this.offsetY = 0;this.getXYPosition = PopupWindow_getXYPosition;this.populate = PopupWindow_populate;this.setUrl = PopupWindow_setUrl;this.setWindowProperties = PopupWindow_setWindowProperties;this.refresh = PopupWindow_refresh;this.showPopup = PopupWindow_showPopup;this.hidePopup = PopupWindow_hidePopup;this.setSize = PopupWindow_setSize;this.isClicked = PopupWindow_isClicked;this.autoHide = PopupWindow_autoHide;this.hideIfNotClicked = PopupWindow_hideIfNotClicked;}


/* SOURCE FILE: CalendarPopup.js */

function CalendarPopup(){var c;if(arguments.length>0){c = new PopupWindow(arguments[0]);}else{c = new PopupWindow();c.setSize(150,175);}c.offsetX = -152;c.offsetY = 25;c.autoHide();c.monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");c.monthAbbreviations = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");c.dayHeaders = new Array("S","M","T","W","T","F","S");c.returnFunction = "CP_tmpReturnFunction";c.returnMonthFunction = "CP_tmpReturnMonthFunction";c.returnQuarterFunction = "CP_tmpReturnQuarterFunction";c.returnYearFunction = "CP_tmpReturnYearFunction";c.weekStartDay = 0;c.isShowYearNavigation = false;c.displayType = "date";c.disabledWeekDays = new Object();c.disabledDatesExpression = "";c.yearSelectStartOffset = 2;c.currentDate = null;c.todayText="Today";c.cssPrefix="";c.isShowNavigationDropdowns=false;c.isShowYearNavigationInput=false;window.CP_calendarObject = null;window.CP_targetInput = null;window.CP_dateFormat = "MM/dd/yyyy";c.copyMonthNamesToWindow = CP_copyMonthNamesToWindow;c.setReturnFunction = CP_setReturnFunction;c.setReturnMonthFunction = CP_setReturnMonthFunction;c.setReturnQuarterFunction = CP_setReturnQuarterFunction;c.setReturnYearFunction = CP_setReturnYearFunction;c.setMonthNames = CP_setMonthNames;c.setMonthAbbreviations = CP_setMonthAbbreviations;c.setDayHeaders = CP_setDayHeaders;c.setWeekStartDay = CP_setWeekStartDay;c.setDisplayType = CP_setDisplayType;c.setDisabledWeekDays = CP_setDisabledWeekDays;c.addDisabledDates = CP_addDisabledDates;c.setYearSelectStartOffset = CP_setYearSelectStartOffset;c.setTodayText = CP_setTodayText;c.showYearNavigation = CP_showYearNavigation;c.showCalendar = CP_showCalendar;c.hideCalendar = CP_hideCalendar;c.getStyles = getCalendarStyles;c.refreshCalendar = CP_refreshCalendar;c.getCalendar = CP_getCalendar;c.select = CP_select;c.setCssPrefix = CP_setCssPrefix;c.showNavigationDropdowns = CP_showNavigationDropdowns;c.showYearNavigationInput = CP_showYearNavigationInput;c.copyMonthNamesToWindow();return c;}
function CP_copyMonthNamesToWindow(){if(typeof(window.MONTH_NAMES)!="undefined" && window.MONTH_NAMES!=null){window.MONTH_NAMES = new Array();for(var i=0;i<this.monthNames.length;i++){window.MONTH_NAMES[window.MONTH_NAMES.length] = this.monthNames[i];}for(var i=0;i<this.monthAbbreviations.length;i++){window.MONTH_NAMES[window.MONTH_NAMES.length] = this.monthAbbreviations[i];}}}
function CP_tmpReturnFunction(y,m,d){if(window.CP_targetInput!=null){var dt = new Date(y,m-1,d,0,0,0);if(window.CP_calendarObject!=null){window.CP_calendarObject.copyMonthNamesToWindow();}window.CP_targetInput.value = formatDate(dt,window.CP_dateFormat);}else{alert('Use setReturnFunction() to define which function will get the clicked results!');}}
function CP_tmpReturnMonthFunction(y,m){alert('Use setReturnMonthFunction() to define which function will get the clicked results!\nYou clicked: year='+y+' , month='+m);}
function CP_tmpReturnQuarterFunction(y,q){alert('Use setReturnQuarterFunction() to define which function will get the clicked results!\nYou clicked: year='+y+' , quarter='+q);}
function CP_tmpReturnYearFunction(y){alert('Use setReturnYearFunction() to define which function will get the clicked results!\nYou clicked: year='+y);}
function CP_setReturnFunction(name){this.returnFunction = name;}
function CP_setReturnMonthFunction(name){this.returnMonthFunction = name;}
function CP_setReturnQuarterFunction(name){this.returnQuarterFunction = name;}
function CP_setReturnYearFunction(name){this.returnYearFunction = name;}
function CP_setMonthNames(){for(var i=0;i<arguments.length;i++){this.monthNames[i] = arguments[i];}this.copyMonthNamesToWindow();}
function CP_setMonthAbbreviations(){for(var i=0;i<arguments.length;i++){this.monthAbbreviations[i] = arguments[i];}this.copyMonthNamesToWindow();}
function CP_setDayHeaders(){for(var i=0;i<arguments.length;i++){this.dayHeaders[i] = arguments[i];}}
function CP_setWeekStartDay(day){this.weekStartDay = day;}
function CP_showYearNavigation(){this.isShowYearNavigation =(arguments.length>0)?arguments[0]:true;}
function CP_setDisplayType(type){if(type!="date"&&type!="week-end"&&type!="month"&&type!="quarter"&&type!="year"){alert("Invalid display type! Must be one of: date,week-end,month,quarter,year");return false;}this.displayType=type;}
function CP_setYearSelectStartOffset(num){this.yearSelectStartOffset=num;}
function CP_setDisabledWeekDays(){this.disabledWeekDays = new Object();for(var i=0;i<arguments.length;i++){this.disabledWeekDays[arguments[i]] = true;}}
function CP_addDisabledDates(start, end){if(arguments.length==1){end=start;}if(start==null && end==null){return;}if(this.disabledDatesExpression!=""){this.disabledDatesExpression+= "||";}if(start!=null){start = parseDate(start);start=""+start.getFullYear()+LZ(start.getMonth()+1)+LZ(start.getDate());}if(end!=null){end=parseDate(end);end=""+end.getFullYear()+LZ(end.getMonth()+1)+LZ(end.getDate());}if(start==null){this.disabledDatesExpression+="(ds<="+end+")";}else if(end  ==null){this.disabledDatesExpression+="(ds>="+start+")";}else{this.disabledDatesExpression+="(ds>="+start+"&&ds<="+end+")";}}
function CP_setTodayText(text){this.todayText = text;}
function CP_setCssPrefix(val){this.cssPrefix = val;}
function CP_showNavigationDropdowns(){this.isShowNavigationDropdowns =(arguments.length>0)?arguments[0]:true;}
function CP_showYearNavigationInput(){this.isShowYearNavigationInput =(arguments.length>0)?arguments[0]:true;}
function CP_hideCalendar(){if(arguments.length > 0){window.popupWindowObjects[arguments[0]].hidePopup();}else{this.hidePopup();}}
function CP_refreshCalendar(index){var calObject = window.popupWindowObjects[index];if(arguments.length>1){calObject.populate(calObject.getCalendar(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]));}else{calObject.populate(calObject.getCalendar());}calObject.refresh();}
function CP_showCalendar(anchorname){if(arguments.length>1){if(arguments[1]==null||arguments[1]==""){this.currentDate=new Date();}else{this.currentDate=new Date(parseDate(arguments[1]));}}this.populate(this.getCalendar());this.showPopup(anchorname);}
function CP_select(inputobj, linkname, format){var selectedDate=(arguments.length>3)?arguments[3]:null;if(!window.getDateFromFormat){alert("calendar.select: To use this method you must also include 'date.js' for date formatting");return;}if(this.displayType!="date"&&this.displayType!="week-end"){alert("calendar.select: This function can only be used with displayType 'date' or 'week-end'");return;}if(inputobj.type!="text" && inputobj.type!="hidden" && inputobj.type!="textarea"){alert("calendar.select: Input object passed is not a valid form input object");window.CP_targetInput=null;return;}if(inputobj.disabled){return;}window.CP_targetInput = inputobj;window.CP_calendarObject = this;this.currentDate=null;var time=0;if(selectedDate!=null){time = getDateFromFormat(selectedDate,format)}else if(inputobj.value!=""){time = getDateFromFormat(inputobj.value,format);}if(selectedDate!=null || inputobj.value!=""){if(time==0){this.currentDate=null;}else{this.currentDate=new Date(time);}}window.CP_dateFormat = format;this.showCalendar(linkname);}
function getCalendarStyles(){var result = "";var p = "";if(this!=null && typeof(this.cssPrefix)!="undefined" && this.cssPrefix!=null && this.cssPrefix!=""){p=this.cssPrefix;}result += "<STYLE>\n";result += "."+p+"cpYearNavigation,."+p+"cpMonthNavigation{background-color:#C0C0C0;text-align:center;vertical-align:center;text-decoration:none;color:#000000;font-weight:bold;}\n";result += "."+p+"cpDayColumnHeader, ."+p+"cpYearNavigation,."+p+"cpMonthNavigation,."+p+"cpCurrentMonthDate,."+p+"cpCurrentMonthDateDisabled,."+p+"cpOtherMonthDate,."+p+"cpOtherMonthDateDisabled,."+p+"cpCurrentDate,."+p+"cpCurrentDateDisabled,."+p+"cpTodayText,."+p+"cpTodayTextDisabled,."+p+"cpText{font-family:arial;font-size:8pt;}\n";result += "TD."+p+"cpDayColumnHeader{text-align:right;border:solid thin #C0C0C0;border-width:0px 0px 1px 0px;}\n";result += "."+p+"cpCurrentMonthDate, ."+p+"cpOtherMonthDate, ."+p+"cpCurrentDate{text-align:right;text-decoration:none;}\n";result += "."+p+"cpCurrentMonthDateDisabled, ."+p+"cpOtherMonthDateDisabled, ."+p+"cpCurrentDateDisabled{color:#D0D0D0;text-align:right;text-decoration:line-through;}\n";result += "."+p+"cpCurrentMonthDate, .cpCurrentDate{color:#000000;}\n";result += "."+p+"cpOtherMonthDate{color:#808080;}\n";result += "TD."+p+"cpCurrentDate{color:white;background-color: #C0C0C0;border-width:1px;border:solid thin #800000;}\n";result += "TD."+p+"cpCurrentDateDisabled{border-width:1px;border:solid thin #FFAAAA;}\n";result += "TD."+p+"cpTodayText, TD."+p+"cpTodayTextDisabled{border:solid thin #C0C0C0;border-width:1px 0px 0px 0px;}\n";result += "A."+p+"cpTodayText, SPAN."+p+"cpTodayTextDisabled{height:20px;}\n";result += "A."+p+"cpTodayText{color:black;}\n";result += "."+p+"cpTodayTextDisabled{color:#D0D0D0;}\n";result += "."+p+"cpBorder{border:solid thin #808080;}\n";result += "</STYLE>\n";return result;}
function CP_getCalendar(){var now = new Date();if(this.type == "WINDOW"){var windowref = "window.opener.";}else{var windowref = "";}var result = "";if(this.type == "WINDOW"){result += "<HTML><HEAD><TITLE>Calendar</TITLE>"+this.getStyles()+"</HEAD><BODY MARGINWIDTH=0 MARGINHEIGHT=0 TOPMARGIN=0 RIGHTMARGIN=0 LEFTMARGIN=0>\n";result += '<CENTER><TABLE WIDTH=100% BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>\n';}else{result += '<TABLE CLASS="'+this.cssPrefix+'cpBorder" WIDTH=144 BORDER=1 BORDERWIDTH=1 CELLSPACING=0 CELLPADDING=1>\n';result += '<TR><TD ALIGN=CENTER>\n';result += '<CENTER>\n';}if(this.displayType=="date" || this.displayType=="week-end"){if(this.currentDate==null){this.currentDate = now;}if(arguments.length > 0){var month = arguments[0];}else{var month = this.currentDate.getMonth()+1;}if(arguments.length > 1 && arguments[1]>0 && arguments[1]-0==arguments[1]){var year = arguments[1];}else{var year = this.currentDate.getFullYear();}var daysinmonth= new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);if( ((year%4 == 0)&&(year%100 != 0) ) ||(year%400 == 0) ){daysinmonth[2] = 29;}var current_month = new Date(year,month-1,1);var display_year = year;var display_month = month;var display_date = 1;var weekday= current_month.getDay();var offset = 0;offset =(weekday >= this.weekStartDay) ? weekday-this.weekStartDay : 7-this.weekStartDay+weekday ;if(offset > 0){display_month--;if(display_month < 1){display_month = 12;display_year--;}display_date = daysinmonth[display_month]-offset+1;}var next_month = month+1;var next_month_year = year;if(next_month > 12){next_month=1;next_month_year++;}var last_month = month-1;var last_month_year = year;if(last_month < 1){last_month=12;last_month_year--;}var date_class;if(this.type!="WINDOW"){result += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";}result += '<TR>\n';var refresh = windowref+'CP_refreshCalendar';var refreshLink = 'javascript:' + refresh;if(this.isShowNavigationDropdowns){result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="78" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpMonthNavigation" name="cpMonth" onChange="'+refresh+'('+this.index+',this.options[this.selectedIndex].value-0,'+(year-0)+');">';for( var monthCounter=1;monthCounter<=12;monthCounter++){var selected =(monthCounter==month) ? 'SELECTED' : '';result += '<option value="'+monthCounter+'" '+selected+'>'+this.monthNames[monthCounter-1]+'</option>';}result += '</select></TD>';result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="56" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpYearNavigation" name="cpYear" onChange="'+refresh+'('+this.index+','+month+',this.options[this.selectedIndex].value-0);">';for( var yearCounter=year-this.yearSelectStartOffset;yearCounter<=year+this.yearSelectStartOffset;yearCounter++){var selected =(yearCounter==year) ? 'SELECTED' : '';result += '<option value="'+yearCounter+'" '+selected+'>'+yearCounter+'</option>';}result += '</select></TD>';}else{if(this.isShowYearNavigation){result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+last_month+','+last_month_year+');">&lt;</A></TD>';result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="58"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+'</SPAN></TD>';result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+next_month+','+next_month_year+');">&gt;</A></TD>';result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+'('+this.index+','+month+','+(year-1)+');">&lt;</A></TD>';if(this.isShowYearNavigationInput){result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><INPUT NAME="cpYear" CLASS="'+this.cssPrefix+'cpYearNavigation" SIZE="4" MAXLENGTH="4" VALUE="'+year+'" onBlur="'+refresh+'('+this.index+','+month+',this.value-0);"></TD>';}else{result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><SPAN CLASS="'+this.cssPrefix+'cpYearNavigation">'+year+'</SPAN></TD>';}result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+'('+this.index+','+month+','+(year+1)+');">&gt;</A></TD>';}else{result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+last_month+','+last_month_year+');">&lt;&lt;</A></TD>\n';result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="100"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+' '+year+'</SPAN></TD>\n';result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+next_month+','+next_month_year+');">&gt;&gt;</A></TD>\n';}}result += '</TR></TABLE>\n';result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=0 CELLPADDING=1 ALIGN=CENTER>\n';result += '<TR>\n';for(var j=0;j<7;j++){result += '<TD CLASS="'+this.cssPrefix+'cpDayColumnHeader" WIDTH="14%"><SPAN CLASS="'+this.cssPrefix+'cpDayColumnHeader">'+this.dayHeaders[(this.weekStartDay+j)%7]+'</TD>\n';}result += '</TR>\n';for(var row=1;row<=6;row++){result += '<TR>\n';for(var col=1;col<=7;col++){var disabled=false;if(this.disabledDatesExpression!=""){var ds=""+display_year+LZ(display_month)+LZ(display_date);eval("disabled=("+this.disabledDatesExpression+")");}var dateClass = "";if((display_month == this.currentDate.getMonth()+1) &&(display_date==this.currentDate.getDate()) &&(display_year==this.currentDate.getFullYear())){dateClass = "cpCurrentDate";}else if(display_month == month){dateClass = "cpCurrentMonthDate";}else{dateClass = "cpOtherMonthDate";}if(disabled || this.disabledWeekDays[col-1]){result += '	<TD CLASS="'+this.cssPrefix+dateClass+'"><SPAN CLASS="'+this.cssPrefix+dateClass+'Disabled">'+display_date+'</SPAN></TD>\n';}else{var selected_date = display_date;var selected_month = display_month;var selected_year = display_year;if(this.displayType=="week-end"){var d = new Date(selected_year,selected_month-1,selected_date,0,0,0,0);d.setDate(d.getDate() +(7-col));selected_year = d.getYear();if(selected_year < 1000){selected_year += 1900;}selected_month = d.getMonth()+1;selected_date = d.getDate();}result += '	<TD CLASS="'+this.cssPrefix+dateClass+'"><A HREF="javascript:'+windowref+this.returnFunction+'('+selected_year+','+selected_month+','+selected_date+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+this.cssPrefix+dateClass+'">'+display_date+'</A></TD>\n';}display_date++;if(display_date > daysinmonth[display_month]){display_date=1;display_month++;}if(display_month > 12){display_month=1;display_year++;}}result += '</TR>';}var current_weekday = now.getDay() - this.weekStartDay;if(current_weekday < 0){current_weekday += 7;}result += '<TR>\n';result += '	<TD COLSPAN=7 ALIGN=CENTER CLASS="'+this.cssPrefix+'cpTodayText">\n';if(this.disabledDatesExpression!=""){var ds=""+now.getFullYear()+LZ(now.getMonth()+1)+LZ(now.getDate());eval("disabled=("+this.disabledDatesExpression+")");}if(disabled || this.disabledWeekDays[current_weekday+1]){result += '		<SPAN CLASS="'+this.cssPrefix+'cpTodayTextDisabled">'+this.todayText+'</SPAN>\n';}else{result += '		<A CLASS="'+this.cssPrefix+'cpTodayText" HREF="javascript:'+windowref+this.returnFunction+'(\''+now.getFullYear()+'\',\''+(now.getMonth()+1)+'\',\''+now.getDate()+'\');'+windowref+'CP_hideCalendar(\''+this.index+'\');">'+this.todayText+'</A>\n';}result += '		<BR>\n';result += '	</TD></TR></TABLE></CENTER></TD></TR></TABLE>\n';}if(this.displayType=="month" || this.displayType=="quarter" || this.displayType=="year"){if(arguments.length > 0){var year = arguments[0];}else{if(this.displayType=="year"){var year = now.getFullYear()-this.yearSelectStartOffset;}else{var year = now.getFullYear();}}if(this.displayType!="year" && this.isShowYearNavigation){result += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";result += '<TR>\n';result += '	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year-1)+');">&lt;&lt;</A></TD>\n';result += '	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="100">'+year+'</TD>\n';result += '	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year+1)+');">&gt;&gt;</A></TD>\n';result += '</TR></TABLE>\n';}}if(this.displayType=="month"){result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n';for(var i=0;i<4;i++){result += '<TR>';for(var j=0;j<3;j++){var monthindex =((i*3)+j);result += '<TD WIDTH=33% ALIGN=CENTER><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnMonthFunction+'('+year+','+(monthindex+1)+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+date_class+'">'+this.monthAbbreviations[monthindex]+'</A></TD>';}result += '</TR>';}result += '</TABLE></CENTER></TD></TR></TABLE>\n';}if(this.displayType=="quarter"){result += '<BR><TABLE WIDTH=120 BORDER=1 CELLSPACING=0 CELLPADDING=0 ALIGN=CENTER>\n';for(var i=0;i<2;i++){result += '<TR>';for(var j=0;j<2;j++){var quarter =((i*2)+j+1);result += '<TD WIDTH=50% ALIGN=CENTER><BR><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnQuarterFunction+'('+year+','+quarter+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+date_class+'">Q'+quarter+'</A><BR><BR></TD>';}result += '</TR>';}result += '</TABLE></CENTER></TD></TR></TABLE>\n';}if(this.displayType=="year"){var yearColumnSize = 4;result += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";result += '<TR>\n';result += '	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year-(yearColumnSize*2))+');">&lt;&lt;</A></TD>\n';result += '	<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year+(yearColumnSize*2))+');">&gt;&gt;</A></TD>\n';result += '</TR></TABLE>\n';result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n';for(var i=0;i<yearColumnSize;i++){for(var j=0;j<2;j++){var currentyear = year+(j*yearColumnSize)+i;result += '<TD WIDTH=50% ALIGN=CENTER><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnYearFunction+'('+currentyear+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+date_class+'">'+currentyear+'</A></TD>';}result += '</TR>';}result += '</TABLE></CENTER></TD></TR></TABLE>\n';}if(this.type == "WINDOW"){result += "</BODY></HTML>\n";}return result;}

<!-- 

var listing_style = "states";
var state = new Array(); 
state["USA"] = "----United States----";
state["CA"] = "California";
state["CO"] = "Colorado";
state["CT"] = "Connecticut";
state["DC"] = "District of Columbia";
state["FL"] = "Florida";
state["GA"] = "Georgia";
state["HI"] = "Hawaii";
state["IL"] = "Illinois";
state["KY"] = "Kentucky";
state["LA"] = "Louisiana";
state["MA"] = "Massachusetts";
state["MD"] = "Maryland";
state["MO"] = "Missouri";
state["NJ"] = "New Jersey";
state["NV"] = "Nevada";
state["NY"] = "New York";
state["PA"] = "Pennsylvania";
state["UT"] = "Utah";
state["WA"] = "Washington";
state["CND"] = "-----Canada-----";
state["AB"] = "Alberta";
state["BC"] = "British Columbia";
state["ON"] = "Ontario";
state["QC"] = "Quebec";
state["EU"] = "-----Europe-----";
state["CN"] = "-----China-----";
state["MX"] = "-----Mexico-----";
state["AU"] = "-----Australia-----";
 
 //-->
<!--
var tcities = new Array('Acapulco, MX', 'Amsterdam, EU', 'Anaheim, CA', 'Athens, EU', 'Baltimore, MD', 'Beijing, CN', 'Boston, MA', 'Branson, MO', 'Brussels, EU', 'Budapest, EU', 'Cabo San Lucas, MX', 'Calgary, AB', 'Cancun, MX', 'Charlton, MA', 'Chengdu, CN', 'Chicago, IL', 'Cologne, EU', 'Denver, CO', 'Dublin, EU', 'Edinburgh, EU', 'Edison, NJ', 'Florence, EU', 'Flushing, NY', 'Frankfurt, EU', 'Guilin, CN', 'Hawaii, HI', 'Hong Kong, CN', 'Jiayuguan, CN', 'Key West, FL', 'Kissimmee, FL', 'Kunming, CN', 'Lanzhou, CN', 'Las Vegas, NV', 'London, EU', 'Los Angeles, CA', 'Luxembourg, EU', 'Lyon, EU', 'Madrid, EU', 'Marseille, EU', 'Mexico City, MX', 'Miami, FL', 'Milan, EU', 'Milford, CT', 'Montreal, QC', 'Munich, EU', 'Nanjing, CN', 'New Orleans, LA', 'New York, NY', 'Newport, KY', 'Niagara Falls, NY', 'Nice, EU', 'Orlando, FL', 'Ottawa, ON', 'Palm Springs, CA', 'Palm Springs, FL', 'Paris, EU', 'Parsippany, NJ', 'Philadelphia, PA', 'Pisa, EU', 'Prague, EU', 'Puerto Vallarta, MX', 'Reykjavik, EU', 'Rome, EU', 'Salt Lake City, UT', 'Salzburg, EU', 'San Diego, CA', 'San Francisco, CA', 'San Jose, CA', 'Savannah, GA', 'Seattle, WA', 'Shanghai, CN', 'Silver Springs, FL', 'St Augustine, FL', 'Tibet, CN', 'Toronto, ON', 'Tuxtla Gutierrez, MX', 'Vancouver, BC', 'Venice, EU', 'Vienna, EU', 'Washington, DC', 'Worcester, MA', 'Xian, CN', 'Zurich, EU');
var tcities_eu = new Array('Amsterdam, EU', 'Athens, EU', 'Brussels, EU', 'Budapest, EU', 'Cologne, EU', 'Dublin, EU', 'Edinburgh, EU', 'Florence, EU', 'Frankfurt, EU', 'London, EU', 'Luxembourg, EU', 'Lyon, EU', 'Madrid, EU', 'Marseille, EU', 'Milan, EU', 'Munich, EU', 'Nice, EU', 'Paris, EU', 'Pisa, EU', 'Prague, EU', 'Reykjavik, EU', 'Rome, EU', 'Salzburg, EU', 'Venice, EU', 'Vienna, EU', 'Zurich, EU');
var tcities_cn = new Array('Beijing, CN', 'Chengdu, CN', 'Guilin, CN', 'Hong Kong, CN', 'Jiayuguan, CN', 'Kunming, CN', 'Lanzhou, CN', 'Nanjing, CN', 'Shanghai, CN', 'Tibet, CN', 'Xian, CN');
var tcities_mx = new Array('Acapulco, MX', 'Cabo San Lucas, MX', 'Cancun, MX', 'Mexico City, MX', 'Puerto Vallarta, MX', 'Tuxtla Gutierrez, MX');
var tcities_au = new Array('Adelaide, AU', 'Alice Spring, AU', 'Brisbane, AU', 'Darwin, AU', 'Gold Coast, AU', 'Hobart, AU', 'Melbourne, AU', 'Perth, AU', 'Sydney, AU');
var tgroup = new Object;
var attrGroup = new Object;
var attrGroupValue = new Object;
var tour_length = tcities.length;
var tour_length_eu = tcities_eu.length;
var tour_length_cn = tcities_cn.length;
var tour_length_mx = tcities_mx.length;
var tour_length_au = tcities_au.length;
for (i=0; i<tour_length; i++)
  tgroup[tcities[i]]=new Array();
for (i=0; i<tour_length_eu; i++)
  tgroup[tcities_eu[i]]=new Array();
for (i=0; i<tour_length_cn; i++)
  tgroup[tcities_cn[i]]=new Array();
for (i=0; i<tour_length_mx; i++)
  tgroup[tcities_mx[i]]=new Array();
  for (i=0; i<tour_length_au; i++)
  tgroup[tcities_au[i]]=new Array();
tgroup["Acapulco, MX"][0] = new Option("No preference", "")

tgroup["Adelaide, AU"][0] = new Option("No preference", "")

tgroup["Alice Spring, AU"][0] = new Option("No preference", "")

tgroup["Amsterdam, EU"][0] = new Option("No preference", "")

tgroup["Anaheim, CA"][0] = new Option("No preference", "")
tgroup["Anaheim, CA"][1] = new Option("Show All", "duration")
tgroup["Anaheim, CA"][2] = new Option("LA and Hollywood", "Hollywood")
tgroup["Anaheim, CA"][3] = new Option("Movie Stars' Homes", "Homes")
tgroup["Anaheim, CA"][4] = new Option("Orange County (OC)", "O.C.")
tgroup["Anaheim, CA"][5] = new Option("Tijuana and Mexico", "Mexico")
tgroup["Anaheim, CA"][6] = new Option("Knott's Berry Farm", "Berry")
tgroup["Anaheim, CA"][7] = new Option("Universal Studios", "Universal")
tgroup["Anaheim, CA"][8] = new Option("San Diego Zoo", "Zoo")
tgroup["Anaheim, CA"][9] = new Option("SeaWorld", "Sea World")
tgroup["Anaheim, CA"][10] = new Option("Six Flags Magic Mt", "Six Flags")
tgroup["Anaheim, CA"][11] = new Option("Grand Canyon", "Grand Canyon")
tgroup["Anaheim, CA"][12] = new Option("Las Vegas Overnight", "Las Vegas")
tgroup["Anaheim, CA"][13] = new Option("San Diego Overnight", "San Diego")
tgroup["Anaheim, CA"][14] = new Option("Medieval Times", "Medieval")
tgroup["Anaheim, CA"][15] = new Option("Los Angles by Night", "Night")
tgroup["Anaheim, CA"][16] = new Option("Pirate's Dinner", "Dinner")
tgroup["Anaheim, CA"][17] = new Option("Beverly Hills", "Beverly")
tgroup["Anaheim, CA"][18] = new Option("Citadel Outlets", "Citadel ")

attrGroup["Anaheim, CA"] = new Array();
attrGroupValue["Anaheim, CA"] = new Array();
attrGroup["Anaheim, CA"][0] = new Array("Tours & Sightseeing", "Show All", "LA and Hollywood", "Movie Stars' Homes", "Orange County (OC)", "Tijuana and Mexico");
attrGroupValue["Anaheim, CA"][0] = new Array("", "duration", "Hollywood", "Homes", "O.C.", "Mexico");
attrGroup["Anaheim, CA"][1] = new Array("Theme Parks Day Trips", "Knott's Berry Farm", "Universal Studios", "San Diego Zoo", "SeaWorld", "Six Flags Magic Mt");
attrGroupValue["Anaheim, CA"][1] = new Array("", "Berry", "Universal", "Zoo", "Sea World", "Six Flags");
attrGroup["Anaheim, CA"][2] = new Array("Multi-day Tours", "Grand Canyon", "Las Vegas Overnight", "San Diego Overnight");
attrGroupValue["Anaheim, CA"][2] = new Array("", "Grand Canyon", "Las Vegas", "San Diego");
attrGroup["Anaheim, CA"][3] = new Array("Food, Wine & Nightlife", "Medieval Times", "Los Angles by Night", "Pirate's Dinner");
attrGroupValue["Anaheim, CA"][3] = new Array("", "Medieval", "Night", "Dinner");
attrGroup["Anaheim, CA"][4] = new Array("Shopping & Fashion", "Beverly Hills", "Citadel Outlets");
attrGroupValue["Anaheim, CA"][4] = new Array("", "Beverly", "Citadel ");

tgroup["Athens, EU"][0] = new Option("No preference", "")

tgroup["Baltimore, MD"][0] = new Option("No preference", "")

tgroup["Beijing, CN"][0] = new Option("No preference", "")

tgroup["Boston, MA"][0] = new Option("No preference", "")
tgroup["Boston, MA"][1] = new Option("City Passes", "card")
tgroup["Boston, MA"][2] = new Option("City Tours", "duration")
tgroup["Boston, MA"][3] = new Option("Chicago", "chicago")
tgroup["Boston, MA"][4] = new Option("Duck tours", "duck")
tgroup["Boston, MA"][5] = new Option("Helicopter Tours", "helicopter")
tgroup["Boston, MA"][6] = new Option("Trolley tours", "trolley")
tgroup["Boston, MA"][7] = new Option("1000 Islands", "1000")
tgroup["Boston, MA"][8] = new Option("Cape Cod", "cape cod")
tgroup["Boston, MA"][9] = new Option("Concord", "concord")
tgroup["Boston, MA"][10] = new Option("Canada", "canada")
tgroup["Boston, MA"][11] = new Option("Disney World", "disney")
tgroup["Boston, MA"][12] = new Option("Montreal", "montreal")
tgroup["Boston, MA"][13] = new Option("New York", "new york")
tgroup["Boston, MA"][14] = new Option("Newport", "newport")
tgroup["Boston, MA"][15] = new Option("Niagara Falls", "niagara")
tgroup["Boston, MA"][16] = new Option("Philadelphia", "Philadelphia")
tgroup["Boston, MA"][17] = new Option("Pilgrim's Path", "pilgrim")
tgroup["Boston, MA"][18] = new Option("Plimoth Plantation", "plimoth")
tgroup["Boston, MA"][19] = new Option("Salem", "salem")
tgroup["Boston, MA"][20] = new Option("Quebec City", "Quebec City")
tgroup["Boston, MA"][21] = new Option("Tennessee", "Tennessee")
tgroup["Boston, MA"][22] = new Option("Toronto", "Toronto")
tgroup["Boston, MA"][23] = new Option("Washington DC", "washington")
tgroup["Boston, MA"][24] = new Option("Wrentham Factory Outlets", "wrentham")

tgroup["Branson, MO"][0] = new Option("No preference", "")

tgroup["Brisbane, AU"][0] = new Option("No preference", "")

tgroup["Brussels, EU"][0] = new Option("No preference", "")

tgroup["Budapest, EU"][0] = new Option("No preference", "")

tgroup["Cabo San Lucas, MX"][0] = new Option("No preference", "")

tgroup["Calgary, AB"][0] = new Option("No preference", "")

tgroup["Cancun, MX"][0] = new Option("No preference", "")

tgroup["Charlton, MA"][0] = new Option("No preference", "")
tgroup["Charlton, MA"][1] = new Option("1000 Islands Region", "1000")
tgroup["Charlton, MA"][2] = new Option("Canada", "Canada")
tgroup["Charlton, MA"][3] = new Option("Corning Glass Center", "Corning")
tgroup["Charlton, MA"][4] = new Option("Niagara Falls", "Niagara")
tgroup["Charlton, MA"][5] = new Option("Toronto", "Toronto")

tgroup["Chengdu, CN"][0] = new Option("No preference", "")

tgroup["Chicago, IL"][0] = new Option("No preference", "")
tgroup["Chicago, IL"][1] = new Option("City Passes", "card")
tgroup["Chicago, IL"][2] = new Option("Trolley Tours", "trolley")
tgroup["Chicago, IL"][3] = new Option("City Tours", "duration")
tgroup["Chicago, IL"][4] = new Option("Wine Tours", "wine")

tgroup["Cologne, EU"][0] = new Option("No preference", "")

tgroup["Darwin, AU"][0] = new Option("No preference", "")

tgroup["Denver, CO"][0] = new Option("No preference", "")
tgroup["Denver, CO"][1] = new Option("Yellowstone", "Yellowstone")
tgroup["Denver, CO"][2] = new Option("Arch National Park", "arch")
tgroup["Denver, CO"][3] = new Option("Mt Rushmore", "Rushmore")

tgroup["Dublin, EU"][0] = new Option("No preference", "")

tgroup["Edinburgh, EU"][0] = new Option("No preference", "")
tgroup["Edinburgh, EU"][1] = new Option("View All", "duration")
tgroup["Edinburgh, EU"][2] = new Option("Edinburgh City Tour ", "Edinburgh")
tgroup["Edinburgh, EU"][3] = new Option("Highlands of Scotland", "Highlands")
tgroup["Edinburgh, EU"][4] = new Option("Loch Lomond", "Loch")
tgroup["Edinburgh, EU"][5] = new Option("Rosslyn Chapel ", "Rosslyn")
tgroup["Edinburgh, EU"][6] = new Option("Stirling Castle ", "Stirling")
tgroup["Edinburgh, EU"][7] = new Option("Trossachs", "Trossachs")

tgroup["Edison, NJ"][0] = new Option("No preference", "")
tgroup["Edison, NJ"][1] = new Option("Baltimore", "Baltimore")
tgroup["Edison, NJ"][2] = new Option("Boston", "boston")
tgroup["Edison, NJ"][3] = new Option("Busch Gardens", "Busch")
tgroup["Edison, NJ"][4] = new Option("Canada", "canada")
tgroup["Edison, NJ"][5] = new Option("Chesapeake Bay", "Chesapeake Bay")
tgroup["Edison, NJ"][6] = new Option("Corning Glass Museum", "corning")
tgroup["Edison, NJ"][7] = new Option("Hershey's Chocolate Factory", "Chocolate")
tgroup["Edison, NJ"][8] = new Option("Newport, RI", "Rhode Island")
tgroup["Edison, NJ"][9] = new Option("Niagara Falls", "niagara")
tgroup["Edison, NJ"][10] = new Option("Philadelphia", "Philadelphia")
tgroup["Edison, NJ"][11] = new Option("Shenandoah Caverns", "Shenandoah")
tgroup["Edison, NJ"][12] = new Option("Tennessee", "Tennessee")
tgroup["Edison, NJ"][13] = new Option("Toronto", "toronto")
tgroup["Edison, NJ"][14] = new Option("Washington DC", "washington")

tgroup["Florence, EU"][0] = new Option("No preference", "")

tgroup["Flushing, NY"][0] = new Option("No preference", "")

tgroup["Frankfurt, EU"][0] = new Option("No preference", "")

tgroup["Gold Coast, AU"][0] = new Option("No preference", "")

tgroup["Guilin, CN"][0] = new Option("No preference", "")

tgroup["Hawaii, HI"][0] = new Option("No preference", "")
tgroup["Hawaii, HI"][1] = new Option("City Tours", "duration")
tgroup["Hawaii, HI"][2] = new Option("Dinners show/cruise", "dinner")
tgroup["Hawaii, HI"][3] = new Option("Big Island Overnight", "big island")
tgroup["Hawaii, HI"][4] = new Option("Kualoa Ranch & Secret Island ", "kualoa")
tgroup["Hawaii, HI"][5] = new Option("Maui Overnight", "maui")
tgroup["Hawaii, HI"][6] = new Option("Pearl Harbor, City Tour", "pearl")
tgroup["Hawaii, HI"][7] = new Option("Polynesian shows", "polynesian")

tgroup["Hobart, AU"][0] = new Option("No preference", "")

tgroup["Hong Kong, CN"][0] = new Option("No preference", "")

tgroup["Jiayuguan, CN"][0] = new Option("No preference", "")

tgroup["Key West, FL"][0] = new Option("No preference", "")
tgroup["Key West, FL"][1] = new Option("City Tours", "duration")
tgroup["Key West, FL"][2] = new Option("Trolley Tours", "trolley")
tgroup["Key West, FL"][3] = new Option("Conch Tour Train", "conch")
tgroup["Key West, FL"][4] = new Option("Aquarium", "aquarium")
tgroup["Key West, FL"][5] = new Option("Shipwreck Historeum", "shipwreck")
tgroup["Key West, FL"][6] = new Option("Yankee Freedom Dry Tortugas Ferry", "yankee")

tgroup["Kissimmee, FL"][0] = new Option("No preference", "")
tgroup["Kissimmee, FL"][1] = new Option("Show All", "duration")

tgroup["Kunming, CN"][0] = new Option("No preference", "")

tgroup["Lanzhou, CN"][0] = new Option("No preference", "")

tgroup["Las Vegas, NV"][0] = new Option("No preference", "")
tgroup["Las Vegas, NV"][1] = new Option("City Tours", "duration")
tgroup["Las Vegas, NV"][2] = new Option("Anaheim Overnight", "Anaheim")
tgroup["Las Vegas, NV"][3] = new Option("Bryce Canyon", "bryce")
tgroup["Las Vegas, NV"][4] = new Option("Death Valley", "death")
tgroup["Las Vegas, NV"][5] = new Option("California Disneyland", "Disneyland")
tgroup["Las Vegas, NV"][6] = new Option("Eldorado Canyon", "Eldorado Canyon")
tgroup["Las Vegas, NV"][7] = new Option("Hoover Dam", "dam")
tgroup["Las Vegas, NV"][8] = new Option("Grand Canyon S Rim", "south rim")
tgroup["Las Vegas, NV"][9] = new Option("Grand Canyon W Rim", "west rim")
tgroup["Las Vegas, NV"][10] = new Option("Grand Teton ", "teton")
tgroup["Las Vegas, NV"][11] = new Option("Haunted Tours ", "haunted")
tgroup["Las Vegas, NV"][12] = new Option("Lake Mead", "mead")
tgroup["Las Vegas, NV"][13] = new Option("Mt Charleston", "Charleston")
tgroup["Las Vegas, NV"][14] = new Option("Mt Rushmore", "rushmore")
tgroup["Las Vegas, NV"][15] = new Option("Mob Tours", "mob")
tgroup["Las Vegas, NV"][16] = new Option("Red Rock Mt", "red rock")
tgroup["Las Vegas, NV"][17] = new Option("Red Rock Canyon", "Red Rock Canyon")
tgroup["Las Vegas, NV"][18] = new Option("River Rafting", "river")
tgroup["Las Vegas, NV"][19] = new Option("Yellowstone", "yellowstone")
tgroup["Las Vegas, NV"][20] = new Option("Zion National Park", "zion")

tgroup["London, EU"][0] = new Option("No preference", "")

tgroup["Los Angeles, CA"][0] = new Option("No preference", "")
tgroup["Los Angeles, CA"][1] = new Option("Fully Escorted", "fully")
tgroup["Los Angeles, CA"][2] = new Option("Arches Nt'l Park", "Arches")
tgroup["Los Angeles, CA"][3] = new Option("Bryce Canyon", "Bryce Canyon")
tgroup["Los Angeles, CA"][4] = new Option("Grand Canyon", "Grand Canyon")
tgroup["Los Angeles, CA"][5] = new Option("Grand Teton", "Grand Teton")
tgroup["Los Angeles, CA"][6] = new Option("Las Vegas", "Las Vegas")
tgroup["Los Angeles, CA"][7] = new Option("Lake Tahoe", "Tahoe")
tgroup["Los Angeles, CA"][8] = new Option("Monterey & Napa", "Monterey")
tgroup["Los Angeles, CA"][9] = new Option("Mexico Ensenada", "Mexico")
tgroup["Los Angeles, CA"][10] = new Option("Mt Rushmore", "Rushmore")
tgroup["Los Angeles, CA"][11] = new Option("San Francisco", "San Francisco")
tgroup["Los Angeles, CA"][12] = new Option("Sequoia Nt'l Park", "Sequoia")
tgroup["Los Angeles, CA"][13] = new Option("Theme Parks", "Disneyland")
tgroup["Los Angeles, CA"][14] = new Option("Yellowstone", "Yellowstone")
tgroup["Los Angeles, CA"][15] = new Option("Yosemite Nt'l Park", "Yosemite")
tgroup["Los Angeles, CA"][16] = new Option("Zion Nt'l Park", "Zion")
tgroup["Los Angeles, CA"][17] = new Option("Disneyland", "Disneyland")
tgroup["Los Angeles, CA"][18] = new Option("Knott's Berry Farm", "Berry")
tgroup["Los Angeles, CA"][19] = new Option("Universal Studios", "Universal")
tgroup["Los Angeles, CA"][20] = new Option("SeaWorld", "World")
tgroup["Los Angeles, CA"][21] = new Option("Six Flags Magic Mt", "Six Flags")
tgroup["Los Angeles, CA"][22] = new Option("San Diego Zoo", "Zoo")
tgroup["Los Angeles, CA"][23] = new Option("All LA City Tours ", "Hollywood")
tgroup["Los Angeles, CA"][24] = new Option("Getty Museum", "Getty")
tgroup["Los Angeles, CA"][25] = new Option("LA Walking Tours", "Walking")
tgroup["Los Angeles, CA"][26] = new Option("LA City Pass", "Card")
tgroup["Los Angeles, CA"][27] = new Option("Museums", "Museum")
tgroup["Los Angeles, CA"][28] = new Option("Outlet Malls", "Outlet")
tgroup["Los Angeles, CA"][29] = new Option("Theme Parks", "Shuttle")
tgroup["Los Angeles, CA"][30] = new Option("Palms Springs", "Palms Springs")
tgroup["Los Angeles, CA"][31] = new Option("Santa Barbara", "Santa Barbara")

attrGroup["Los Angeles, CA"] = new Array();
attrGroupValue["Los Angeles, CA"] = new Array();
attrGroup["Los Angeles, CA"][0] = new Array("Multi-day Tours", "Fully Escorted", "Arches Nt'l Park", "Bryce Canyon", "Grand Canyon", "Grand Teton", "Las Vegas", "Lake Tahoe", "Monterey & Napa", "Mexico Ensenada", "Mt Rushmore", "San Francisco", "Sequoia Nt'l Park", "Theme Parks", "Yellowstone", "Yosemite Nt'l Park", "Zion Nt'l Park");
attrGroupValue["Los Angeles, CA"][0] = new Array("", "fully", "Arches", "Bryce Canyon", "Grand Canyon", "Grand Teton", "Las Vegas", "Tahoe", "Monterey", "Mexico", "Rushmore", "San Francisco", "Sequoia", "Disneyland", "Yellowstone", "Yosemite", "Zion");
attrGroup["Los Angeles, CA"][1] = new Array("Theme Parks Trips", "Disneyland", "Knott's Berry Farm", "Universal Studios", "SeaWorld", "Six Flags Magic Mt", "San Diego Zoo");
attrGroupValue["Los Angeles, CA"][1] = new Array("", "Disneyland", "Berry", "Universal", "World", "Six Flags", "Zoo");
attrGroup["Los Angeles, CA"][2] = new Array("Tours & Sightseeing", "All LA City Tours ", "Getty Museum", "LA Walking Tours");
attrGroupValue["Los Angeles, CA"][2] = new Array("", "Hollywood", "Getty", "Walking");
attrGroup["Los Angeles, CA"][3] = new Array("Tickets & Passes", "LA City Pass");
attrGroupValue["Los Angeles, CA"][3] = new Array("", "Card");
attrGroup["Los Angeles, CA"][4] = new Array("Transfers", "Museums", "Outlet Malls", "Theme Parks", "Palms Springs", "Santa Barbara");
attrGroupValue["Los Angeles, CA"][4] = new Array("", "Museum", "Outlet", "Shuttle", "Palms Springs", "Santa Barbara");

tgroup["Luxembourg, EU"][0] = new Option("No preference", "")

tgroup["Lyon, EU"][0] = new Option("No preference", "")

tgroup["Madrid, EU"][0] = new Option("No preference", "")

tgroup["Marseille, EU"][0] = new Option("No preference", "")

tgroup["Melbourne, AU"][0] = new Option("No preference", "")

tgroup["Mexico City, MX"][0] = new Option("No preference", "")

tgroup["Miami, FL"][0] = new Option("No preference", "")
tgroup["Miami, FL"][1] = new Option("Cruise Tours", "cruise")
tgroup["Miami, FL"][2] = new Option("City Tours", "duration")
tgroup["Miami, FL"][3] = new Option("City Tours", "duration")
tgroup["Miami, FL"][4] = new Option("Airboat ride ", "airboat")
tgroup["Miami, FL"][5] = new Option("Blizzard Beach ", "Blizzard")
tgroup["Miami, FL"][6] = new Option("Busch Gardens", "Busch")
tgroup["Miami, FL"][7] = new Option("Disney World ", "Disney")
tgroup["Miami, FL"][8] = new Option("Everglade Park", "everglade")
tgroup["Miami, FL"][9] = new Option("Kennedy Space Center", "Kennedy")
tgroup["Miami, FL"][10] = new Option("Island Of Adventure", "Island")
tgroup["Miami, FL"][11] = new Option("Key West", "key west")
tgroup["Miami, FL"][12] = new Option("Orlando Overnight", "Orlando")
tgroup["Miami, FL"][13] = new Option("Parrot Jungle Island", "parrot")
tgroup["Miami, FL"][14] = new Option("Seaquarium", "Seaquarium")
tgroup["Miami, FL"][15] = new Option("Sea World", "Sea")
tgroup["Miami, FL"][16] = new Option("Snorkeling", "snorkeling")
tgroup["Miami, FL"][17] = new Option("Typhoon Lagoon", "Typhoon")
tgroup["Miami, FL"][18] = new Option("Universal Studios", "Universal")
tgroup["Miami, FL"][19] = new Option("Wet'N Wild", "Wild")

tgroup["Milan, EU"][0] = new Option("No preference", "")

tgroup["Milford, CT"][0] = new Option("No preference", "")
tgroup["Milford, CT"][1] = new Option("Baltimore", "Baltimore")
tgroup["Milford, CT"][2] = new Option("New York City", "New York")
tgroup["Milford, CT"][3] = new Option("Philadelphia", "Philadelphia")
tgroup["Milford, CT"][4] = new Option("Washington DC", "Washington")
tgroup["Milford, CT"][5] = new Option("Shenandoah Carven", "Shenandoah")
tgroup["Milford, CT"][6] = new Option("Tennessee", "Tennessee")

tgroup["Montreal, QC"][0] = new Option("No preference", "")
tgroup["Montreal, QC"][1] = new Option("City Tours", "duration")
tgroup["Montreal, QC"][2] = new Option("New York", "new york")
tgroup["Montreal, QC"][3] = new Option("1000 Islands", "island")
tgroup["Montreal, QC"][4] = new Option("Niagara Falls", "Niagara")
tgroup["Montreal, QC"][5] = new Option("Toronto", "Toronto")
tgroup["Montreal, QC"][6] = new Option("Rhode Island", "rhode")

tgroup["Munich, EU"][0] = new Option("No preference", "")

tgroup["Nanjing, CN"][0] = new Option("No preference", "")

tgroup["New Orleans, LA"][0] = new Option("No preference", "")
tgroup["New Orleans, LA"][1] = new Option("City Tours", "duration")

tgroup["New York, NY"][0] = new Option("No preference", "")
tgroup["New York, NY"][1] = new Option("Fully Escorted", "Fully")
tgroup["New York, NY"][2] = new Option("1000 Islands", "Islands")
tgroup["New York, NY"][3] = new Option("Acadia Nt'l Park", "Acadia")
tgroup["New York, NY"][4] = new Option("Atlantic City", "Atlantic")
tgroup["New York, NY"][5] = new Option("Busch Gardens", "Busch")
tgroup["New York, NY"][6] = new Option("Boston", "Boston")
tgroup["New York, NY"][7] = new Option("Chesapeake Bay", "Chesapeake")
tgroup["New York, NY"][8] = new Option("Lake Placid", "Lake")
tgroup["New York, NY"][9] = new Option("Lake George", "Lake")
tgroup["New York, NY"][10] = new Option("Long Island", "Long Island")
tgroup["New York, NY"][11] = new Option("Niagara Falls", "Niagara")
tgroup["New York, NY"][12] = new Option("Montreal, Canada", "Montreal")
tgroup["New York, NY"][13] = new Option("Orlando Florida", "Orlando")
tgroup["New York, NY"][14] = new Option("Philadelphia", "Philadelphia")
tgroup["New York, NY"][15] = new Option("Quebec City", "Quebec")
tgroup["New York, NY"][16] = new Option("Rhode Island", "Rhode")
tgroup["New York, NY"][17] = new Option("Tennessee", "Tennessee")
tgroup["New York, NY"][18] = new Option("Toronto, Canada", "Toronto")
tgroup["New York, NY"][19] = new Option("Upstate New York", "SHL")
tgroup["New York, NY"][20] = new Option("Washington DC", "Washington")
tgroup["New York, NY"][21] = new Option("All NYC Tours", "duration")
tgroup["New York, NY"][22] = new Option("Double Decker", "Loop")
tgroup["New York, NY"][23] = new Option("Harlem & Gospel", "Harlem")
tgroup["New York, NY"][24] = new Option("Helicopter Tours", "Helicopter")
tgroup["New York, NY"][25] = new Option("Movie Sites Tours", "Movie")
tgroup["New York, NY"][26] = new Option("Harbor Cruises ", "Cruise")
tgroup["New York, NY"][27] = new Option("NY Duck Tours", "Duck")
tgroup["New York, NY"][28] = new Option("NYC City Pass", "Pass")
tgroup["New York, NY"][29] = new Option("Hamptons", "Hamptons")
tgroup["New York, NY"][30] = new Option("Wineries", "Wineries")
tgroup["New York, NY"][31] = new Option("Woodbury Outlets", "Woodbury")

attrGroup["New York, NY"] = new Array();
attrGroupValue["New York, NY"] = new Array();
attrGroup["New York, NY"][0] = new Array("Multi-day Tours", "Fully Escorted", "1000 Islands", "Acadia Nt'l Park", "Atlantic City", "Busch Gardens", "Boston", "Chesapeake Bay", "Lake Placid", "Lake George", "Long Island", "Niagara Falls", "Montreal, Canada", "Orlando Florida", "Philadelphia", "Quebec City", "Rhode Island", "Tennessee", "Toronto, Canada", "Upstate New York", "Washington DC");
attrGroupValue["New York, NY"][0] = new Array("", "Fully", "Islands", "Acadia", "Atlantic", "Busch", "Boston", "Chesapeake", "Lake", "Lake", "Long Island", "Niagara", "Montreal", "Orlando", "Philadelphia", "Quebec", "Rhode", "Tennessee", "Toronto", "SHL", "Washington");
attrGroup["New York, NY"][1] = new Array("Tours & Sightseeing", "All NYC Tours", "Double Decker", "Harlem & Gospel", "Helicopter Tours", "Movie Sites Tours");
attrGroupValue["New York, NY"][1] = new Array("", "duration", "Loop", "Harlem", "Helicopter", "Movie");
attrGroup["New York, NY"][2] = new Array("Cruise Tours", "Harbor Cruises ", "NY Duck Tours");
attrGroupValue["New York, NY"][2] = new Array("", "Cruise", "Duck");
attrGroup["New York, NY"][3] = new Array("Tickets & Passes", "NYC City Pass");
attrGroupValue["New York, NY"][3] = new Array("", "Pass");
attrGroup["New York, NY"][4] = new Array("Shopping & Fashion", "Hamptons", "Wineries", "Woodbury Outlets");
attrGroupValue["New York, NY"][4] = new Array("", "Hamptons", "Wineries", "Woodbury");

tgroup["Newport, KY"][0] = new Option("No preference", "")

tgroup["Niagara Falls, NY"][0] = new Option("No preference", "")
tgroup["Niagara Falls, NY"][1] = new Option("City Tours", "duration")
tgroup["Niagara Falls, NY"][2] = new Option("Night Tours", "evening")
tgroup["Niagara Falls, NY"][3] = new Option("Tour to Canadian side", "canada")
tgroup["Niagara Falls, NY"][4] = new Option("Cave of the Winds ", "cave")
tgroup["Niagara Falls, NY"][5] = new Option("Maid of the Mist", "maid")
tgroup["Niagara Falls, NY"][6] = new Option("N.Y.S. Observation Tower ", "observation")
tgroup["Niagara Falls, NY"][7] = new Option("Skylon Tower (Canada) ", "skylon")

tgroup["Nice, EU"][0] = new Option("No preference", "")

tgroup["Orlando, FL"][0] = new Option("No preference", "")
tgroup["Orlando, FL"][1] = new Option("City Tours", "duration")
tgroup["Orlando, FL"][2] = new Option("Airboat Safari", "Airboat")
tgroup["Orlando, FL"][3] = new Option("Busch Gardens", "busch")
tgroup["Orlando, FL"][4] = new Option("Cypress Gardens", "cypress")
tgroup["Orlando, FL"][5] = new Option("Everglades & Naples", "everglades")
tgroup["Orlando, FL"][6] = new Option("Gatorland", "gatorland")
tgroup["Orlando, FL"][7] = new Option("Gospel Brunch", "Gospel Brunch")
tgroup["Orlando, FL"][8] = new Option("Miami", "Miami")
tgroup["Orlando, FL"][9] = new Option("Kennedy Space Center", "space")
tgroup["Orlando, FL"][10] = new Option("Silver Springs", "silver")

tgroup["Ottawa, ON"][0] = new Option("No preference", "")
tgroup["Ottawa, ON"][1] = new Option("All City Tours", "duration")
tgroup["Ottawa, ON"][2] = new Option("Comprehensive City Tour", "grand")
tgroup["Ottawa, ON"][3] = new Option("Hop On Hop Off", "hop")
tgroup["Ottawa, ON"][4] = new Option("Montreal", "Montreal")
tgroup["Ottawa, ON"][5] = new Option("Sightseeing Cruise", "cruise")

tgroup["Palm Springs, CA"][0] = new Option("No preference", "")
tgroup["Palm Springs, CA"][1] = new Option("All City Tours", "duration")
tgroup["Palm Springs, CA"][2] = new Option("San Andreas Fault", "San Andreas Fault")
tgroup["Palm Springs, CA"][3] = new Option("Joshua Trees ", "Joshua")
tgroup["Palm Springs, CA"][4] = new Option("Maggie Mine", "Maggie Mine")
tgroup["Palm Springs, CA"][5] = new Option("Ghost Town-Calico", "Calico")
tgroup["Palm Springs, CA"][6] = new Option("Odessa Train Ride", "Odessa")
tgroup["Palm Springs, CA"][7] = new Option("Mystery Shack", "Mystery Shack")
tgroup["Palm Springs, CA"][8] = new Option("Gold Panning", "Gold Panning")
tgroup["Palm Springs, CA"][9] = new Option("NASA complex", "NASA")
tgroup["Palm Springs, CA"][10] = new Option("Safari Trips", "Safari")
tgroup["Palm Springs, CA"][11] = new Option("Helicopter and Hummer", "Helicopter")
tgroup["Palm Springs, CA"][12] = new Option("Sonoran Desert", "Sonoran")
tgroup["Palm Springs, CA"][13] = new Option("Paleontogical Adventure ", "Paleontologist")

tgroup["Palm Springs, FL"][0] = new Option("No preference", "")
tgroup["Palm Springs, FL"][1] = new Option("City Tours", "duration")
tgroup["Palm Springs, FL"][2] = new Option("Celebrity Homes  ", "Celebrity")
tgroup["Palm Springs, FL"][3] = new Option("Grand Valley", "valley")

tgroup["Paris, EU"][0] = new Option("No preference", "")

tgroup["Parsippany, NJ"][0] = new Option("No preference", "")
tgroup["Parsippany, NJ"][1] = new Option("Boston", "boston")
tgroup["Parsippany, NJ"][2] = new Option("Canada", "canada")
tgroup["Parsippany, NJ"][3] = new Option("Corning Glass Museum", "corning")
tgroup["Parsippany, NJ"][4] = new Option("Niagara Falls", "niagara")
tgroup["Parsippany, NJ"][5] = new Option("Toronto", "toronto")

tgroup["Perth, AU"][0] = new Option("No preference", "")

tgroup["Philadelphia, PA"][0] = new Option("No preference", "")
tgroup["Philadelphia, PA"][1] = new Option("Double Decker Tour", "Decker")
tgroup["Philadelphia, PA"][2] = new Option("Amish Experience", "amish")
tgroup["Philadelphia, PA"][3] = new Option("Boston", "boston")
tgroup["Philadelphia, PA"][4] = new Option("Canada", "canada")
tgroup["Philadelphia, PA"][5] = new Option("Montreal", "montreal")
tgroup["Philadelphia, PA"][6] = new Option("New York City", "New York")
tgroup["Philadelphia, PA"][7] = new Option("Niagara Falls", "Niagara Falls")
tgroup["Philadelphia, PA"][8] = new Option("Toronto", "Toronto")
tgroup["Philadelphia, PA"][9] = new Option("Washington DC", "Washington")

tgroup["Pisa, EU"][0] = new Option("No preference", "")

tgroup["Prague, EU"][0] = new Option("No preference", "")

tgroup["Puerto Vallarta, MX"][0] = new Option("No preference", "")

tgroup["Reykjavik, EU"][0] = new Option("No preference", "")
tgroup["Reykjavik, EU"][1] = new Option("City Tours", "duration")
tgroup["Reykjavik, EU"][2] = new Option("Jeep Tours", "jeep")
tgroup["Reykjavik, EU"][3] = new Option("Blue Lagoon", "Blue Lagoon")
tgroup["Reykjavik, EU"][4] = new Option("Diving Tours", "diving")

tgroup["Rome, EU"][0] = new Option("No preference", "")

tgroup["Salt Lake City, UT"][0] = new Option("No preference", "")
tgroup["Salt Lake City, UT"][1] = new Option("Dinosaur Nat'l Monument", "Dinosaur")
tgroup["Salt Lake City, UT"][2] = new Option("Grand Teton", "teton")
tgroup["Salt Lake City, UT"][3] = new Option("Mt Rushmore", "rushmore")
tgroup["Salt Lake City, UT"][4] = new Option("Rocky Mountain", "rocky")
tgroup["Salt Lake City, UT"][5] = new Option("Yellowstone", "yellowstone")

tgroup["Salzburg, EU"][0] = new Option("No preference", "")

tgroup["San Diego, CA"][0] = new Option("No preference", "")
tgroup["San Diego, CA"][1] = new Option("City Tours", "duration")
tgroup["San Diego, CA"][2] = new Option("City Pass", "card")
tgroup["San Diego, CA"][3] = new Option("Double Decker Tours", "double decker")
tgroup["San Diego, CA"][4] = new Option("Trolley Tours", "trolley")
tgroup["San Diego, CA"][5] = new Option("Disneyland", "disneyland")
tgroup["San Diego, CA"][6] = new Option("Ensenada", "ensenada")
tgroup["San Diego, CA"][7] = new Option("Legoland", "legoland")
tgroup["San Diego, CA"][8] = new Option("Rosarito Beach", "rosarito")
tgroup["San Diego, CA"][9] = new Option("San Diego Zoo", "zoo")
tgroup["San Diego, CA"][10] = new Option("Sea World", "sea world")
tgroup["San Diego, CA"][11] = new Option("Seaport Village", "Seaport")
tgroup["San Diego, CA"][12] = new Option("Sycuan", "sycuan")
tgroup["San Diego, CA"][13] = new Option("Tijuana", "tijuana")
tgroup["San Diego, CA"][14] = new Option("Universal Studio", "universal")
tgroup["San Diego, CA"][15] = new Option("Viejas Casino", "viejas")
tgroup["San Diego, CA"][16] = new Option("Wild Animal Park", "animal")

tgroup["San Francisco, CA"][0] = new Option("No preference", "")
tgroup["San Francisco, CA"][1] = new Option("Bay Cruise", "cruise")
tgroup["San Francisco, CA"][2] = new Option("City Tours", "duration")
tgroup["San Francisco, CA"][3] = new Option("City Pass", "card")
tgroup["San Francisco, CA"][4] = new Option("Double Decker Tour", "double decker")
tgroup["San Francisco, CA"][5] = new Option("Disneyland", "Disneyland")
tgroup["San Francisco, CA"][6] = new Option("Trolley Tours", "trolley")
tgroup["San Francisco, CA"][7] = new Option("Segway Tours", "segway")
tgroup["San Francisco, CA"][8] = new Option("Bryce Canyon", "bryce")
tgroup["San Francisco, CA"][9] = new Option("Carmel", "Carmel")
tgroup["San Francisco, CA"][10] = new Option("Grand Canyon", "canyon")
tgroup["San Francisco, CA"][11] = new Option("Grand Canyon Skywalk", "Skywalk")
tgroup["San Francisco, CA"][12] = new Option("Los Angeles", "angeles")
tgroup["San Francisco, CA"][13] = new Option("Las Vegas", "vegas")
tgroup["San Francisco, CA"][14] = new Option("Lake Powell", "powell")
tgroup["San Francisco, CA"][15] = new Option("Mexico Ensenada", "ensenada")
tgroup["San Francisco, CA"][16] = new Option("Monterey Bay", "monterey")
tgroup["San Francisco, CA"][17] = new Option("Muir Woods", "muir woods")
tgroup["San Francisco, CA"][18] = new Option("Napa Valley", "Napa")
tgroup["San Francisco, CA"][19] = new Option("Redwood Sequoias", "sequoias")
tgroup["San Francisco, CA"][20] = new Option("San Diego", "san diego")
tgroup["San Francisco, CA"][21] = new Option("Sausalito", "sausalito")
tgroup["San Francisco, CA"][22] = new Option("Sea World", "Sea World")
tgroup["San Francisco, CA"][23] = new Option("Sequoia", "sequoia")
tgroup["San Francisco, CA"][24] = new Option("Southern California", "California")
tgroup["San Francisco, CA"][25] = new Option("Universal Studios", "Universal")
tgroup["San Francisco, CA"][26] = new Option("Yellowstone", "Yellowstone")
tgroup["San Francisco, CA"][27] = new Option("Yosemite", "yosemite")
tgroup["San Francisco, CA"][28] = new Option("Zion Nt'l Park", "zion")

tgroup["San Jose, CA"][0] = new Option("No preference", "")
tgroup["San Jose, CA"][1] = new Option("Bay Cruise", "cruise")
tgroup["San Jose, CA"][2] = new Option("Disneyland", "Disneyland")
tgroup["San Jose, CA"][3] = new Option("Bryce Canyon", "bryce")
tgroup["San Jose, CA"][4] = new Option("Carmel", "Carmel")
tgroup["San Jose, CA"][5] = new Option("Grand Canyon", "canyon")
tgroup["San Jose, CA"][6] = new Option("Grand Canyon Skywalk", "Skywalk")
tgroup["San Jose, CA"][7] = new Option("Los Angeles", "angeles")
tgroup["San Jose, CA"][8] = new Option("Las Vegas", "vegas")
tgroup["San Jose, CA"][9] = new Option("Lake Powell", "powell")
tgroup["San Jose, CA"][10] = new Option("Mexico Ensenada", "ensenada")
tgroup["San Jose, CA"][11] = new Option("Monterey Bay", "monterey")
tgroup["San Jose, CA"][12] = new Option("Muir Woods", "muir woods")
tgroup["San Jose, CA"][13] = new Option("Napa Valley", "Napa")
tgroup["San Jose, CA"][14] = new Option("Redwood Sequoias", "sequoias")
tgroup["San Jose, CA"][15] = new Option("San Diego", "san diego")
tgroup["San Jose, CA"][16] = new Option("Sausalito", "sausalito")
tgroup["San Jose, CA"][17] = new Option("Sea World", "Sea World")
tgroup["San Jose, CA"][18] = new Option("Sequoia", "sequoia")
tgroup["San Jose, CA"][19] = new Option("Southern California", "California")
tgroup["San Jose, CA"][20] = new Option("Universal Studios", "Universal")
tgroup["San Jose, CA"][21] = new Option("Yellowstone", "Yellowstone")
tgroup["San Jose, CA"][22] = new Option("Yosemite", "yosemite")

tgroup["Savannah, GA"][0] = new Option("No preference", "")
tgroup["Savannah, GA"][1] = new Option("City Tours", "duration")
tgroup["Savannah, GA"][2] = new Option("Trolley Tours", "trolley")

tgroup["Seattle, WA"][0] = new Option("No preference", "")
tgroup["Seattle, WA"][1] = new Option("City Passes", "card")
tgroup["Seattle, WA"][2] = new Option("City Tours", "duration")
tgroup["Seattle, WA"][3] = new Option("Double Decker Bus", "decker")
tgroup["Seattle, WA"][4] = new Option("Boeing Factory ", "boeing")
tgroup["Seattle, WA"][5] = new Option("Rocky Mountain ", "rocky")
tgroup["Seattle, WA"][6] = new Option("Vancouver/Victoria", "vancouver")

tgroup["Shanghai, CN"][0] = new Option("No preference", "")

tgroup["Silver Springs, FL"][0] = new Option("No preference", "")

tgroup["St Augustine, FL"][0] = new Option("No preference", "")
tgroup["St Augustine, FL"][1] = new Option("City Tours", "duration")
tgroup["St Augustine, FL"][2] = new Option("Helicopter Tour", "miles")

tgroup["Sydney, AU"][0] = new Option("No preference", "")

tgroup["Tibet, CN"][0] = new Option("No preference", "")

tgroup["Toronto, ON"][0] = new Option("No preference", "")
tgroup["Toronto, ON"][1] = new Option("City Tours", "duration")
tgroup["Toronto, ON"][2] = new Option("Harbor Cruise", "cruise")
tgroup["Toronto, ON"][3] = new Option("Niagara Falls", "niagara")

attrGroup["Toronto, ON"] = new Array();
attrGroupValue["Toronto, ON"] = new Array();
attrGroup["Toronto, ON"][0] = new Array("City Tours", "City Tours");
attrGroupValue["Toronto, ON"][0] = new Array("", "duration");
attrGroup["Toronto, ON"][1] = new Array("Other Attractions", "Harbor Cruise", "Niagara Falls");
attrGroupValue["Toronto, ON"][1] = new Array("", "cruise", "niagara");

tgroup["Tuxtla Gutierrez, MX"][0] = new Option("No preference", "")

tgroup["Vancouver, BC"][0] = new Option("No preference", "")
tgroup["Vancouver, BC"][1] = new Option("City Tours", "duration")
tgroup["Vancouver, BC"][2] = new Option("Dinner Cruises", "cruise")
tgroup["Vancouver, BC"][3] = new Option("Double Decker ", "decker")
tgroup["Vancouver, BC"][4] = new Option("Floatplane", "floatplane")
tgroup["Vancouver, BC"][5] = new Option("Trolley Tours", "trolley")
tgroup["Vancouver, BC"][6] = new Option("Butchart Gardens", "butchart")
tgroup["Vancouver, BC"][7] = new Option("Capilano Salmon Hatchery", "salmon")
tgroup["Vancouver, BC"][8] = new Option("Rocky Mountain", "rocky")
tgroup["Vancouver, BC"][9] = new Option("Seattle Excursion", "seattle")
tgroup["Vancouver, BC"][10] = new Option("Sulohur Mountain", "sulohur")
tgroup["Vancouver, BC"][11] = new Option("Victoria Excursion", "victoria")
tgroup["Vancouver, BC"][12] = new Option("Whale Watching", "whale")
tgroup["Vancouver, BC"][13] = new Option("Whistler Excursion", "whistler")

tgroup["Venice, EU"][0] = new Option("No preference", "")

tgroup["Vienna, EU"][0] = new Option("No preference", "")

tgroup["Washington, DC"][0] = new Option("No preference", "")
tgroup["Washington, DC"][1] = new Option("City Tours", "duration")
tgroup["Washington, DC"][2] = new Option("Night Tours", "monuments")
tgroup["Washington, DC"][3] = new Option("Trolley Tours", "trolley")
tgroup["Washington, DC"][4] = new Option("Alexandria, VA", "Alexandria")
tgroup["Washington, DC"][5] = new Option("Boston", "boston")
tgroup["Washington, DC"][6] = new Option("Busch Gardens", "busch")
tgroup["Washington, DC"][7] = new Option("Canada", "Canada")
tgroup["Washington, DC"][8] = new Option("Gettysburg", "gettysburg")
tgroup["Washington, DC"][9] = new Option("Monticello", "monticello")
tgroup["Washington, DC"][10] = new Option("Montreal", "Montreal")
tgroup["Washington, DC"][11] = new Option("Mt. Vernon", "Vernon")
tgroup["Washington, DC"][12] = new Option("Niagara Falls", "Niagara Falls")
tgroup["Washington, DC"][13] = new Option("Ottawa", "Ottawa")
tgroup["Washington, DC"][14] = new Option("Philadelphia", "Philadelphia")
tgroup["Washington, DC"][15] = new Option("Thomas Jefferson Country", "Jefferson")
tgroup["Washington, DC"][16] = new Option("Quebec City", "Quebec City")
tgroup["Washington, DC"][17] = new Option("Williamsburg, VA ", "Williamsburg")

tgroup["Worcester, MA"][0] = new Option("No preference", "")
tgroup["Worcester, MA"][1] = new Option("1000 Islands Region", "1000")
tgroup["Worcester, MA"][2] = new Option("Canada", "Canada")
tgroup["Worcester, MA"][3] = new Option("Corning Glass Center", "Corning")
tgroup["Worcester, MA"][4] = new Option("Niagara Falls", "Niagara")
tgroup["Worcester, MA"][5] = new Option("Toronto", "Toronto")

tgroup["Xian, CN"][0] = new Option("No preference", "")

tgroup["Zurich, EU"][0] = new Option("No preference", "")




function update_tour_depart()
{
        var tf_obj = get_tour_depart_obj();

		if(listing_style == 'states'){

			listing_states(tf_obj);

		} else {

			listing_citys(tf_obj);
		}
}

function listing_citys(tf_obj)
{

        for (var i=tf_obj.options.length-1; i>0; i--)
        {
        tf_obj.options[i]=null;
        }
        for (var i=0; i<tcities.length; i++)
        {
                var j = i+1;
        tf_obj.options[j] = new Option(tcities[i], tcities[i]);
        }
}

function listing_citys_au(tf_obj)
{
    for (var i=0; i<tour_length_au; i++)
    {
    	var arr = tcities_au[i].split(/,\s+/);
    	tf_obj.options[tf_obj.options.length] = new Option(arr[0],tcities_au[i]);
    }
}

function listing_states(tf_obj)
{
	while(tf_obj.hasChildNodes && tf_obj.lastChild)
	{
		tf_obj.removeChild(tf_obj.lastChild);

	}

	var opg_arr = new Array();

	for (var opg in state )
	{
		opg_arr[opg] = document.createElement("optgroup");

		opg_arr[opg].label = state[opg];
	}

	for (var i=0; i<tcities.length; i++)
	{
		var j = i+1;

		var o = document.createElement("option");

		var arr = tcities[i].split(/,\s+/);

		o.value = tcities[i];

		o.innerHTML = arr[0];

		var short_state = arr[1];

		if(opg_arr[short_state])
			opg_arr[short_state].appendChild(o);

	}

	for(var opg in opg_arr) {

		opg_arr[opg].label = state[opg];

		if(opg_arr[opg].hasChildNodes)
			tf_obj.appendChild(opg_arr[opg]);

	}

	listing_citys_au(tf_obj);
}

function get_tour_from_obj()
{
	return get_tour_depart_obj();
}

function get_tour_to_obj()
{
        return get_tour_attraction_obj();
}

function get_tour_depart_obj()
{
	return document.tour_search.depart;
}

function get_tour_attraction_obj()
{
	return document.tour_search.attraction;
}

function get_tour_days_obj()
{
        return document.tour_search.days;
}

function update_tour(depart, attr, keywords, days, jump)
{
	var depart_obj = get_tour_depart_obj();
	var index;
	if (depart)
	{
		index = set_selected(depart_obj, depart);
	}
	else
	{
		index = depart_obj.options.selectedIndex;
		if (index > 0)
        	{
			depart = depart_obj.options[index].value;
		}
	}
	if (index >= 0)
	{
		if (tgroup[depart] instanceof Array && tgroup[depart].length > 1)
		{
			update_tour_to(depart, jump);
			if (attr)
			{
				var attr_obj = get_tour_attraction_obj();
				set_selected(attr_obj, attr);
			}
		}
	}
        if (days)
	{
		var days_obj = get_tour_days_obj();
		set_selected(days_obj, days);
	}
	if (keywords && document.tour_search.keywords)
	{
		document.tour_search.keywords.value = keywords;
	}
}

function update_tour_to(city, jump)
{
	if (city != '' && tgroup[city] instanceof Array)
	{
		var attr_obj = get_tour_attraction_obj();
		var opt_len = tgroup[city].length;
		if (opt_len == 1 && jump)
		{
			return ga("http://www.gotobus.com/cgi-bin/tour.cgi?depart=" + city);
		}
  		attr_obj.innerHTML="";
   		attr_obj.options[0] = new Option(tgroup[city][0].text, tgroup[city][0].value);
   		if (attrGroup[city] instanceof Array)
		{
			var attr_group = attrGroup[city];
			var opg_arr = new Array();
			for (var len=0;len<attr_group.length;len++)
			{
				opg_arr[len] = document.createElement("optgroup");
				opg_arr[len].label = attr_group[len][0];
				var attractionValue = attrGroupValue[city];
				for (var attrlen=1;attrlen<attr_group[len].length;attrlen++)
				{
					var objOption=document.createElement("option");
					objOption.value = attractionValue[len][attrlen];
					objOption.innerHTML = attr_group[len][attrlen];
					opg_arr[len].appendChild(objOption);
				}
   		}
			for(var opg in opg_arr)
			{
				attr_obj.appendChild(opg_arr[opg]);
			}
		}
		else
		{	  		
   		for (var i=0; i<opt_len; i++)
		{
       			attr_obj.options[i] = new Option(tgroup[city][i].text, tgroup[city][i].value);
		}
	}
	}
	tour_clear();
}

function set_tour_dates(obj, selected_date)
{
	var wdays= new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");
	var d = new Date();
	var aDay=86400000;
	var selected = 0;
	for (var i=0; i<60; i++)
	{
		var m = d.getMonth() + 1;
		if (m < 10)
		{
			m = "0" + m;
		}
		var dt = d.getDate();
		if (dt < 10)
		{
			dt = "0" + dt;
		}
		var fdv = d.getFullYear() + "-" + m + "-" + dt + " " + wdays[d.getDay()];
		var fd = d.getFullYear() + "-" + m + "-" + dt;
		obj.options[i+1] = new Option(fdv, fd, true);
		d = new Date(d.valueOf() + aDay);
		if (selected_date == fd)
		{
			selected = i+1;
		}
	}
	obj.options.selectedIndex = selected;
}

function tour_clear()
{
	var t_obj = document.getElementById("itemList");
	if (t_obj)
	{
	    t_obj.innerHTML = "";
	}
}

function tour_conditional_regen()
{
	var t_obj = document.getElementById("itemList");
	if (t_obj && t_obj.innerHTML != "")
	{
		tour_regen();
	}
}

function tour_regen()
{
	var depart_obj = document.tour_search.depart;
	var depart = "";
	if (depart_obj && depart_obj.value)
	{
		depart = depart_obj.value;
	}
	else
	{
		tour_clear();
		return;
	}
	var attr = "";
	var promotion_type = "";
	var promotion_obj = document.tour_search.promotion_type;
	if (promotion_obj)
	{
		promotion_type = promotion_obj.value;
	}
	var attr_obj = document.tour_search.attraction;
	if (attr_obj && attr_obj.value)
	{
		attr = attr_obj.value;
	}
	var max_price = "";
	var max_price_obj = document.tour_search.max_price;
	if (max_price_obj && max_price_obj.value)
	{
		max_price = max_price_obj.value;
	}
	var lowest_price = "";
	var lowest_price_obj = document.tour_search.lowest_price;
	if (lowest_price_obj && lowest_price_obj.value)
	{
		lowest_price = lowest_price_obj.value;
	}
	var left_point = "";
	var left_point_obj = document.tour_search.left_point;
	if (left_point_obj && left_point_obj.value)
	{
		left_point = left_point_obj.value;
	}
	var right_point = "";
	var right_point_obj = document.tour_search.right_point;
	if (right_point_obj && right_point_obj.value)
	{
		right_point = right_point_obj.value;
	}
	var date_obj = document.tour_search.date;
	var d = "";
	if (date_obj && date_obj.value)
	{
		d = date_obj.value;
	}
	var ignore = "";
	var ignore_obj = document.tour_search.ignore;
	if (ignore_obj && ignore_obj.checked == true)
	{
		ignore = 1;
	}
	var days_obj = document.tour_search.days;
	var days = "";
	if (days_obj && days_obj.value)
	{
		days = days_obj.value;
	}
	var keywords = "";
	var keywords_obj = document.tour_search.keywords;
	if (keywords_obj && keywords_obj.value)
	{
		keywords = keywords_obj.value;
	}
        var order = "";
        var order_obj = document.tour_search.order;
        if (order_obj && order_obj.value)
        {
                order = order_obj.value;
        }
        ga("/cgi-bin/tour.cgi?depart=" + depart + "&attraction=" + attr + "&date=" + d + "&ignore=" + ignore + "&days=" + days + "&keywords=" + keywords + "&order=" + order + "&max_price=" + max_price + "&lowest_price=" + lowest_price + "&left_point=" + left_point + "&right_point=" + right_point + "&promotion_type=" + promotion_type);
}

function check_tour_input()
{
        var depart_obj = document.tour_search.depart;
        var depart = '';
        if (depart_obj && depart_obj.value)
        {
                depart = depart_obj.value;
        }
        if (depart == '')
        {
                alert("Please select a departure city!");
                depart_obj.focus();
                return false;
        }
        var date_obj = document.tour_search.date;
        var d = '';
        if (date_obj && date_obj.value)
        {
                d = date_obj.value;
        }
        if (d && !d.match(/\d\d\d\d-\d\d-\d\d/))
        {
                alert("Date (" + d + ") must be either empty or in the format: YYYY-MM-DD");
                date_obj.focus();
                return false;
        }
}

function tour_date_clicked(y,m,d)
{
	if (m < 10) m = '0' + m;
	if (d < 10) d = '0' + d;
	document.tour_search.date.value = y + '-' + m + '-' + d;
	if (document.tour_search.ignore.checked == false)
	{
		tour_conditional_regen();
	}
}

function empty_tour_date()
{
        document.tour_search.date.value = '';
        tour_conditional_regen();
}

function check_tour_ignore()
{
        if (document.tour_search.ignore.checked == false)
        {
                document.tour_search.date.disabled = false;

                if (document.tour_search.date.value == '')
                {
                        var t_date = new Date(past_date.valueOf() + 3 * aDay);
                        document.tour_search.date.value = formatDate(t_date, "yyyy-MM-dd");
			return;
                }
        }
        else
        {
                document.tour_search.date.value = "";
                document.tour_search.date.disabled = true;

        }
        tour_conditional_regen();
}

function sort_tours(order_by)
{
	var min_price_temp = 0;
	if (typeof(price) != 'undefined')
	{
		if (document.tour_search && document.tour_search.min_price)
		{
			min_price_temp = parseInt(document.tour_search.min_price.value);
		}
		if (document.tour_search && document.tour_search.left_point)
		{
			document.tour_search.left_point.value = price.getSldPoint();
		}
		if (document.tour_search && document.tour_search.right_point)
		{
			document.tour_search.right_point.value = price.getSldRightPoint();
		}
		if (document.tour_search && document.tour_search.max_price)
		{
			document.tour_search.max_price.value = price.getSldRightPoint() + min_price_temp;
		}
		if (document.tour_search && document.tour_search.lowest_price)
		{
			document.tour_search.lowest_price.value = price.getSldPoint() + min_price_temp;
		}
	}	
	if (document.tour_search && document.tour_search.order)
	{
		document.tour_search.order.value = order_by;
		tour_conditional_regen();
	}
	if (document.sight_search && document.sight_search.order)
	{
		document.sight_search.order.value = order_by;
		sight_conditional_regen();
	}
}

function get_dynamic_price(pid)
{
	document.getElementById("dynamic_price" + pid).innerHTML = "<font color='red'>Loading..</font>";
	if(window.XMLHttpRequest) {
		dynamic_xml = new XMLHttpRequest();
	} else {
		dynamic_xml = new ActiveXObject("MSXML2.XMLHTTP");
	}
	var url = 'ajax.cgi?type=dynamic_price&pid=' + pid;
	dynamic_xml.open("GET", url, true);
	dynamic_xml.onreadystatechange = response_dynamic_price;
	dynamic_xml.setRequestHeader("If-Modified-Since","0");
	dynamic_xml.send("");
}

function response_dynamic_price()
{
	if (dynamic_xml.readyState == 4)
	{
		var response = "<strong>Price:&nbsp;<span class='r11'>" + dynamic_xml.responseText + "</span></strong>";
		var pid = document.getElementById("pid_hidden").value;
		document.getElementById("dynamic_price" + pid).innerHTML = response;
	}
}


function dynamic_image(pid)
{
	var dynamic_image_html = document.getElementById("dynamic_price_hidden" + pid).innerHTML;
	document.getElementById("dynamic_price" + pid).innerHTML = dynamic_image_html;

}

function set_pid_value(pid)
{
	document.getElementById("pid_hidden").value = pid;
}
//-->
// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. 
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================


/* SOURCE FILE: AnchorPosition.js */

/* 
AnchorPosition.js
Author: Matt Kruse
Last modified: 10/11/02

DESCRIPTION: These functions find the position of an <A> tag in a document,
so other elements can be positioned relative to it.

COMPATABILITY: Netscape 4.x,6.x,Mozilla, IE 5.x,6.x on Windows. Some small
positioning errors - usually with Window positioning - occur on the 
Macintosh platform.

FUNCTIONS:
getAnchorPosition(anchorname)
  Returns an Object() having .x and .y properties of the pixel coordinates
  of the upper-left corner of the anchor. Position is relative to the PAGE.

getAnchorWindowPosition(anchorname)
  Returns an Object() having .x and .y properties of the pixel coordinates
  of the upper-left corner of the anchor, relative to the WHOLE SCREEN.

NOTES:

1) For popping up separate browser windows, use getAnchorWindowPosition. 
   Otherwise, use getAnchorPosition

2) Your anchor tag MUST contain both NAME and ID attributes which are the 
   same. For example:
   <A NAME="test" ID="test"> </A>

3) There must be at least a space between <A> </A> for IE5.5 to see the 
   anchor tag correctly. Do not do <A></A> with no space.
*/ 

// getAnchorPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the page.
function getAnchorPosition(anchorname) {
	// This function will return an Object with x and y properties
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	// Browser capability sniffing
	var use_gebi=false, use_css=false, use_layers=false;
	if (document.getElementById) { use_gebi=true; }
	else if (document.all) { use_css=true; }
	else if (document.layers) { use_layers=true; }
	// Logic to find position
 	if (use_gebi && document.all) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_gebi) {
		var o=document.getElementById(anchorname);
		x=AnchorPosition_getPageOffsetLeft(o);
		y=AnchorPosition_getPageOffsetTop(o);
		}
 	else if (use_css) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_layers) {
		var found=0;
		for (var i=0; i<document.anchors.length; i++) {
			if (document.anchors[i].name==anchorname) { found=1; break; }
			}
		if (found==0) {
			coordinates.x=0; coordinates.y=0; return coordinates;
			}
		x=document.anchors[i].x;
		y=document.anchors[i].y;
		}
	else {
		coordinates.x=0; coordinates.y=0; return coordinates;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// getAnchorWindowPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the window
function getAnchorWindowPosition(anchorname) {
	var coordinates=getAnchorPosition(anchorname);
	var x=0;
	var y=0;
	if (document.getElementById) {
		if (isNaN(window.screenX)) {
			x=coordinates.x-document.body.scrollLeft+window.screenLeft;
			y=coordinates.y-document.body.scrollTop+window.screenTop;
			}
		else {
			x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
			y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
			}
		}
	else if (document.all) {
		x=coordinates.x-document.body.scrollLeft+window.screenLeft;
		y=coordinates.y-document.body.scrollTop+window.screenTop;
		}
	else if (document.layers) {
		x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
		y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// Functions for IE to get position of an object
function AnchorPosition_getPageOffsetLeft (el) {
	var ol=el.offsetLeft;
	while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
	return ol;
	}
function AnchorPosition_getWindowOffsetLeft (el) {
	return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
	}	
function AnchorPosition_getPageOffsetTop (el) {
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null) { ot += el.offsetTop; }
	return ot;
	}
function AnchorPosition_getWindowOffsetTop (el) {
	return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
	}

/* 
PopupWindow.js
Author: Matt Kruse
Last modified: 02/16/04

DESCRIPTION: This object allows you to easily and quickly popup a window
in a certain place. The window can either be a DIV or a separate browser
window.

COMPATABILITY: Works with Netscape 4.x, 6.x, IE 5.x on Windows. Some small
positioning errors - usually with Window positioning - occur on the 
Macintosh platform. Due to bugs in Netscape 4.x, populating the popup 
window with <STYLE> tags may cause errors.

USAGE:
// Create an object for a WINDOW popup
var win = new PopupWindow(); 

// Create an object for a DIV window using the DIV named 'mydiv'
var win = new PopupWindow('mydiv'); 

// Set the window to automatically hide itself when the user clicks 
// anywhere else on the page except the popup
win.autoHide(); 

// Show the window relative to the anchor name passed in
win.showPopup(anchorname);

// Hide the popup
win.hidePopup();

// Set the size of the popup window (only applies to WINDOW popups
win.setSize(width,height);

// Populate the contents of the popup window that will be shown. If you 
// change the contents while it is displayed, you will need to refresh()
win.populate(string);

// set the URL of the window, rather than populating its contents
// manually
win.setUrl("http://www.site.com/");

// Refresh the contents of the popup
win.refresh();

// Specify how many pixels to the right of the anchor the popup will appear
win.offsetX = 50;

// Specify how many pixels below the anchor the popup will appear
win.offsetY = 100;

NOTES:
1) Requires the functions in AnchorPosition.js

2) Your anchor tag MUST contain both NAME and ID attributes which are the 
   same. For example:
   <A NAME="test" ID="test"> </A>

3) There must be at least a space between <A> </A> for IE5.5 to see the 
   anchor tag correctly. Do not do <A></A> with no space.

4) When a PopupWindow object is created, a handler for 'onmouseup' is
   attached to any event handler you may have already defined. Do NOT define
   an event handler for 'onmouseup' after you define a PopupWindow object or
   the autoHide() will not work correctly.
*/ 

// Set the position of the popup window based on the anchor
function PopupWindow_getXYPosition(anchorname) {
	var coordinates;
	if (this.type == "WINDOW") {
		coordinates = getAnchorWindowPosition(anchorname);
		}
	else {
		coordinates = getAnchorPosition(anchorname);
		}
	this.x = coordinates.x;
	this.y = coordinates.y;
	}
// Set width/height of DIV/popup window
function PopupWindow_setSize(width,height) {
	this.width = width;
	this.height = height;
	}
// Fill the window with contents
function PopupWindow_populate(contents) {
	this.contents = contents;
	this.populated = false;
	}
// Set the URL to go to
function PopupWindow_setUrl(url) {
	this.url = url;
	}
// Set the window popup properties
function PopupWindow_setWindowProperties(props) {
	this.windowProperties = props;
	}
// Refresh the displayed contents of the popup
function PopupWindow_refresh() {
	if (this.divName != null) {
		// refresh the DIV object
		if (this.use_gebi) {
			document.getElementById(this.divName).innerHTML = this.contents;
			}
		else if (this.use_css) { 
			document.all[this.divName].innerHTML = this.contents;
			}
		else if (this.use_layers) { 
			var d = document.layers[this.divName]; 
			d.document.open();
			d.document.writeln(this.contents);
			d.document.close();
			}
		}
	else {
		if (this.popupWindow != null && !this.popupWindow.closed) {
			if (this.url!="") {
				this.popupWindow.location.href=this.url;
				}
			else {
				this.popupWindow.document.open();
				this.popupWindow.document.writeln(this.contents);
				this.popupWindow.document.close();
			}
			this.popupWindow.focus();
			}
		}
	}
// Position and show the popup, relative to an anchor object
function PopupWindow_showPopup(anchorname) {
	this.getXYPosition(anchorname);
	this.x += this.offsetX;
	this.y += this.offsetY;
	if (!this.populated && (this.contents != "")) {
		this.populated = true;
		this.refresh();
		}
	if (this.divName != null) {
		// Show the DIV object
		if (this.use_gebi) {
			document.getElementById(this.divName).style.left = this.x + "px";
			document.getElementById(this.divName).style.top = this.y + "px";
			document.getElementById(this.divName).style.visibility = "visible";
			}
		else if (this.use_css) {
			document.all[this.divName].style.left = this.x + 'px';
			document.all[this.divName].style.top = this.y + 'px';
			document.all[this.divName].style.visibility = "visible";
			}
		else if (this.use_layers) {
			document.layers[this.divName].left = this.x + 'px';
			document.layers[this.divName].top = this.y + 'px';
			document.layers[this.divName].visibility = "visible";
			}
		}
	else {
		if (this.popupWindow == null || this.popupWindow.closed) {
			// If the popup window will go off-screen, move it so it doesn't
			if (this.x<0) { this.x=0; }
			if (this.y<0) { this.y=0; }
			if (screen && screen.availHeight) {
				if ((this.y + this.height) > screen.availHeight) {
					this.y = screen.availHeight - this.height;
					}
				}
			if (screen && screen.availWidth) {
				if ((this.x + this.width) > screen.availWidth) {
					this.x = screen.availWidth - this.width;
					}
				}
			var avoidAboutBlank = window.opera || ( document.layers && !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled );
			this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"");
			}
		this.refresh();
		}
	}
// Hide the popup
function PopupWindow_hidePopup() {
	if (this.divName != null) {
		if (this.use_gebi) {
			if (document.getElementById(this.divName))
			{
				document.getElementById(this.divName).style.visibility = "hidden";
			}
			}
		else if (this.use_css) {
			document.all[this.divName].style.visibility = "hidden";
			}
		else if (this.use_layers) {
			document.layers[this.divName].visibility = "hidden";
			}
		}
	else {
		if (this.popupWindow && !this.popupWindow.closed) {
			this.popupWindow.close();
			this.popupWindow = null;
			}
		}
	}
// Pass an event and return whether or not it was the popup DIV that was clicked
function PopupWindow_isClicked(e) {
	if (this.divName != null) {
		if (this.use_layers) {
			var clickX = e.pageX;
			var clickY = e.pageY;
			var t = document.layers[this.divName];
			if ((clickX > t.left) && (clickX < t.left+t.clip.width) && (clickY > t.top) && (clickY < t.top+t.clip.height)) {
				return true;
				}
			else { return false; }
			}
		else if (document.all) { // Need to hard-code this to trap IE for error-handling
			var t = window.event.srcElement;
			while (t.parentElement != null) {
				if (t.id==this.divName) {
					return true;
					}
				t = t.parentElement;
				}
			return false;
			}
		else if (this.use_gebi && e) {
			var t = e.originalTarget;
			while (t.parentNode != null) {
				if (t.id==this.divName) {
					return true;
					}
				t = t.parentNode;
				}
			return false;
			}
		return false;
		}
	return false;
	}

// Check an onMouseDown event to see if we should hide
function PopupWindow_hideIfNotClicked(e) {
	if (this.autoHideEnabled && !this.isClicked(e)) {
		this.hidePopup();
		}
	}
// Call this to make the DIV disable automatically when mouse is clicked outside it
function PopupWindow_autoHide() {
	this.autoHideEnabled = true;
	}
// This global function checks all PopupWindow objects onmouseup to see if they should be hidden
function PopupWindow_hidePopupWindows(e) {
	for (var i=0; i<popupWindowObjects.length; i++) {
		if (popupWindowObjects[i] != null) {
			var p = popupWindowObjects[i];
			p.hideIfNotClicked(e);
			}
		}
	}
// Run this immediately to attach the event listener
function PopupWindow_attachListener() {
	if (document.layers) {
		document.captureEvents(Event.MOUSEUP);
		}
	window.popupWindowOldEventListener = document.onmouseup;
	if (window.popupWindowOldEventListener != null) {
		document.onmouseup = new Function("window.popupWindowOldEventListener(); PopupWindow_hidePopupWindows();");
		}
	else {
		document.onmouseup = PopupWindow_hidePopupWindows;
		}
	}
// CONSTRUCTOR for the PopupWindow object
// Pass it a DIV name to use a DHTML popup, otherwise will default to window popup
function PopupWindow() {
	if (!window.popupWindowIndex) { window.popupWindowIndex = 0; }
	if (!window.popupWindowObjects) { window.popupWindowObjects = new Array(); }
	if (!window.listenerAttached) {
		window.listenerAttached = true;
		PopupWindow_attachListener();
		}
	this.index = popupWindowIndex++;
	popupWindowObjects[this.index] = this;
	this.divName = null;
	this.popupWindow = null;
	this.width=0;
	this.height=0;
	this.populated = false;
	this.visible = false;
	this.autoHideEnabled = false;
	
	this.contents = "";
	this.url="";
	this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";
	if (arguments.length>0) {
		this.type="DIV";
		this.divName = arguments[0];
		}
	else {
		this.type="WINDOW";
		}
	this.use_gebi = false;
	this.use_css = false;
	this.use_layers = false;
	if (document.getElementById) { this.use_gebi = true; }
	else if (document.all) { this.use_css = true; }
	else if (document.layers) { this.use_layers = true; }
	else { this.type = "WINDOW"; }
	this.offsetX = 0;
	this.offsetY = 0;
	// Method mappings
	this.getXYPosition = PopupWindow_getXYPosition;
	this.populate = PopupWindow_populate;
	this.setUrl = PopupWindow_setUrl;
	this.setWindowProperties = PopupWindow_setWindowProperties;
	this.refresh = PopupWindow_refresh;
	this.showPopup = PopupWindow_showPopup;
	this.hidePopup = PopupWindow_hidePopup;
	this.setSize = PopupWindow_setSize;
	this.isClicked = PopupWindow_isClicked;
	this.autoHide = PopupWindow_autoHide;
	this.hideIfNotClicked = PopupWindow_hideIfNotClicked;
	}

function b_text(obj, text,event)
{
	var b_obj = document.getElementById('balloon').style;
	var tt = "<table bgcolor=#999999 width=100% cellpadding=3 cellspacing=1><tr><td bgcolor=#ffffff class=\"balloon_text\">" + text + "</td></tr></table>";
	document.getElementById('balloon').innerHTML = tt;
	var pos = el_pos(obj,event);
	b_obj.top = document.documentElement.scrollTop + pos.y + 4 + 'px';
	b_obj.left = pos.x + 4 + 'px';
	b_obj.visibility = "visible";
	b_obj.display = "block";
}

function show_bus_station_info(diplay_obj,text,mark)
{
	var counts_str = "counts" + mark;
	var counts_obj = document.getElementById(counts_str);
	var count=counts_obj.value;
	var display_value = "display_value" + mark + diplay_obj;
	var current_display = "display" +  mark + diplay_obj;
	var div_listarea = document.getElementById("listarea");
	var div_listarea_return = document.getElementById("listarea_return");
	var radselect_objs = document.getElementsByName("radselect");
	var count1=radselect_objs.length;	
	document.getElementById(display_value).innerHTML = text;	
	for (var i=1; i<=count; i++)
    {
    	var display_id = "display" + mark + i;
    	if (document.getElementById(display_id) && display_id != current_display)
    	{
	    	var div_display = document.getElementById(display_id).style;
	    	if (div_display.display != "none")
	    	{
	    		div_display.display = "none";
	    	}
	    }
    }    
    var current_div = document.getElementById(current_display).style;
    if (current_div.display != "")
	{
		if (div_listarea != null && mark == 'b')
		{
			var listarea_height
			listarea_height = 14 * 28 + 50;
			if ( count1 <= 14 )
			{
				listarea_height = count1 * 28 + 180;		    	
				div_listarea.style.overflow = "auto";
			}			
			div_listarea.style.height = listarea_height + 'px';	
		}
		if (div_listarea_return != null && mark == 'c')
		{
			var listarea_height
			listarea_height = 10 * 28 + 50;
			if ( count1 <= 10 )
			{
				listarea_height = count1 * 28 + 180;		    	
				div_listarea_return.style.overflow = "auto";
			}			
			div_listarea_return.style.height = listarea_height + 'px';	
		}
		current_div.display = "";
	}
	else
	{
		if (div_listarea != null && mark == 'b')
		{
			var listarea_height
			listarea_height = 14 * 28 + 50;
			if ( count1 <= 14 )
			{
				listarea_height = count1 * 28 + 10;	
				div_listarea.style.overflow = "hidden";
			}
			div_listarea.style.height = listarea_height + 'px';
		}
		if (div_listarea_return != null && mark == 'c')
		{
			var listarea_height
			listarea_height = 10 * 28 + 50;
			if ( count1 <= 10 )
			{
				listarea_height = count1 * 28 + 10;	
				div_listarea_return.style.overflow = "hidden";
			}
			div_listarea_return.style.height = listarea_height + 'px';
		}
		current_div.display = "none";
	}		
}

function no_b_text()
{
	var b_obj = document.getElementById('balloon').style;
	b_obj.visibility = "hidden";
	b_obj.display = "none";
}

function onBalloonOver()
{
	var b_obj = document.getElementById('balloon').style;
	b_obj.visibility = "visible";
	b_obj.display = "block";
}

function onBalloonOut()
{
        var b_obj = document.getElementById('balloon').style;
        b_obj.visibility = "hidden";
        b_obj.display = "none";
}

function el_pos(obj,event)
{
    var xOffset, yOffset;
	if (event)
	{
		xOffset =  event.clientX + document.body.scrollLeft -10;
		yOffset = event.clientY + document.body.scrollTop -10;
	}
	else
	{
    	if(obj.offsetTop != 'undefined'){
        	yOffset = (obj.offsetTop?obj.offsetTop:0);
        	xOffset = (obj.offsetLeft?obj.offsetLeft:0);
        	yOffset -= (obj.scrollTop?obj.scrollTop:0);
        	xOffset -= (obj.scrollLeft?obj.scrollLeft:0);
        	elParent = obj.offsetParent;
        	while(elParent){
            	yOffset += (elParent.offsetTop?elParent.offsetTop:0);
            	xOffset += (elParent.offsetLeft?elParent.offsetLeft:0);
	    		yOffset -= (elParent.scrollTop?elParent.scrollTop:0);
            	xOffset -= (elParent.scrollLeft?elParent.scrollLeft:0);
            elParent = elParent.offsetParent;
        }
    	} else if(typeof obj.y != 'undefined'){
	alert(obj.y);
        yOffset = obj.y;
        xOffset = obj.x;
    	} else {      //information is not available
        yOffset = -1;
        xOffset = -1;
    } 
	}
    return {x:xOffset,y:yOffset};
}

function long_option_clicked(popup_obj, div_name)
{
	var div_obj = document.getElementById(div_name);
	var i_obj = document.getElementById('i' + div_name);
	var style_obj = div_obj.style;
	var pos = el_pos(i_obj);
	popup_obj.offsetY = 20;
	popup_obj.offsetX = -200;
	popup_obj.showPopup("i" + div_name);
}

function long_option_closed(popup_obj, div_name)
{
	popup_obj.hidePopup();
}

function long_option_selected(obj, div_name, popup_obj)
{
	document.getElementById('d' + div_name).value = obj.value;
	long_option_closed(popup_obj, div_name);
}

function validate_form_selections(f)
{
	var plObj = document.getElementById("Provide_Later");
	var check_text = true;
	if (plObj != null && plObj.checked)
	{
		check_text = false;
	}
	var total_people_count = -1;
	var room_array = [];
	var room_count = 0;
    for (var i=0, j=f.elements.length; i<j; i++)
    {
        var t = f.elements[i].type;
        if (t.match(/select/))
        {
			var sname = f.elements[i].name;
			if (sname.match(/^Room(.)(Adult|Child)/i))
			{
				if (total_people_count == -1)
				{
					total_people_count = 0;
				}
				var pnum =  parseInt(f.elements[i].value);
				total_people_count += pnum;

				if (pnum > 0)
				{
					var room_no = parseInt(sname[4])-1;
					if (room_array[room_no] == undefined)
					{
						room_array[room_no] = 0;
					}
					room_array[room_no] += pnum;
					if (room_no+1 > room_count)
					{
						room_count = room_no+1;
					}
				}
			}
            if (f.elements[i].value == '')
            {
                alert("Please Select " + f.elements[i].name + "!");
                f.elements[i].focus();
                return false;
            }
        }
		else if (t.match(/text/) && check_text)
	{
	    if (f.elements[i].value == '')
	    {
	    	alert("Please enter a value the text field!");
	    	f.elements[i].focus();
		return false;
	    }
	}
    }

	if (total_people_count == 0)
	{
		alert("Please select adult/child number!");
        return false;
	}

	var max_capacity = 4;
	for ( i=0; i < room_count; i++)
	{
		if (room_array[i] > max_capacity)
		{
			alert("The number of passengers cannot be greater than 4 for each room.");
			return false;
		}
	}

    if (f.Date != null && f.Date.value == '')
    {
        alert("Please select a valid Date!");
        return false;
    }
    if (f.time != null && f.time.value < 1.01)
    {
        return confirm("Important: It is a new date after passing 12:00am.\nYou have selected a very early schedule on " + f.Date.value + ".  Please confirm.");
    }
}

document.write('<link href=\"http://www.gotobus.com/css/searchbox.css\" rel=\"stylesheet\" type=\"text/css\">');
document.write('<div ID=\"calendarDiv\" style=\"position:absolute;visibility:hidden;background-color:#ffffff;layer-background-color:#ffffff;\"></div>');
document.write('<table width=\"100%\" align=\"center\" cellspacing=\"2\" bgcolor=\"#cc0000\" border=\"0\" cellpadding=\"0\">');
document.write('<tr>');
document.write('  <td bgcolor=\"#ffffff\" width=\"98%\" align=\"center\">');
document.write('  	<script language=\"JavaScript\">');
document.write('     var t_cal = new CalendarPopup(\"calendarDiv\");');
document.write('	 t_cal.offsetX = -84;');
document.write('	 t_cal.offsetY = 16;');
document.write('	 t_cal.setCssPrefix(\'Bus_\');');
document.write('     var last_date = new Date(past_date.valueOf() + 120 * aDay);');
document.write('     t_cal.addDisabledDates(null,formatDate(past_date,\"yyyy-MM-dd\"));');
document.write('     t_cal.addDisabledDates(formatDate(last_date, \"yyyy-MM-dd\"),null);');
document.write('	 t_cal.setReturnFunction(\'tour_date_clicked\');');
document.write('	</script>');
document.write('  <form name=\"tour_search\" class=\"ivySchedulesForm\" onSubmit=\"return check_tour_input();\" method=\"get\" action=\"http://search.gotobus.com/cgi-bin/tour.cgi\">');
document.write('  <input type=\"hidden\" name=\"gid\" value=\"\">');
document.write('  <input type=\"hidden\" name=\"nm\" value=\"\">');
document.write('  <table align=\"center\" cellspacing=2 cellpadding=2 border=0>');
document.write('  <tr>');
document.write('	<td width=\"4\" rowspan=3><img alt=\"\" width=1 height=1></td>');
document.write('    <td class=ivySmallOption width=\"30%\" height=\"42\">Departure City:<br>');
document.write('      <select name=\"depart\" class=ivySmallOption style=\"width:140px\" onchange=\"update_tour_to(this.options[this.selectedIndex].value);\">');
document.write('         <option value=\'\'>Departure City</option>');
document.write('	  </select>');
document.write('    </td>');
document.write('	<td width=\"4\" rowspan=2><img alt=\"\" width=1 height=1></td>');
document.write('    <td class=ivySmallOption width=\"36%\">Start Date: <input type=checkbox name=\"ignore\" value=\"1\" onClick=\"check_tour_ignore();\" checked> Ignore<br>');
document.write('      <input type=\"text\" name=\"date\" value=\"\" onChange=\"tour_conditional_regen();\" class=ivySDateOption>');
document.write('      <a href=\"#\" onClick=\"t_cal.select(document.tour_search.date,\'t_date\',\'yyyy-MM-dd\'); return false;\" NAME=\"t_date\" ID=\"t_date\"><img name=\"td_img\" id=\"td_img\" border=0 alt=\"Popup Calendar\" src=\"http://www.gotobus.com/images/calendar.gif\"></a>');
document.write('    </td>');
document.write('	<td width=\"4\"><img alt=\"\" width=1 height=1></td>');
document.write('	<td class=ivySmallOption>Duration:<br>');
document.write('  <select name=\"days\" onChange=\"tour_conditional_regen();\" class=ivySmallOption>');
document.write('    <option value=\"\">No preference</option>');
document.write('    <option value=\"1-1\">1 day</option>');
document.write('    <option value=\"2-2\">2 days</option>');
document.write('    <option value=\"2-3\">2 - 3 days</option>');
document.write('    <option value=\"3-3\">3 days</option>');
document.write('    <option value=\"3-4\">3 - 4 days</option>');
document.write('    <option value=\"4-4\">4 days</option>');
document.write('    <option value=\"4-5\">4 - 5 days</option>');
document.write('    <option value=\"5-5\">5 days</option>');
document.write('    <option value=\"5-6\">5 - 6 days</option>');
document.write('    <option value=\"6-6\">6 days</option>');
document.write('    <option value=\"6-7\">6 - 7 days</option>');
document.write('    <option value=\"7-7\">7 days</option>');
document.write('    <option value=\"7-\">7 days or more</option>');
document.write('  </select>');
document.write('');
document.write('	</td>');
document.write('  </tr>');
document.write('  <tr>');
document.write('	<td class=ivySmallOption height=\"42\">Attraction:<br>');
document.write('	  <select name=\"attraction\" onChange=\"tour_conditional_regen();\" class=ivySmallOption style=\"width:140px;\">');
document.write('        <option value=\"\">No preference</option>');
document.write('      </select>');
document.write('	</td>');
document.write('	<td class=ivySmallOption colspan=3>Optional Keywords:<br>');
document.write('	  <input name=\"keywords\" value=\"\" class=ivySmallOption size=\"22\"> &nbsp;&nbsp;');
document.write('	  <input type=\"submit\" name=\"s\" value=\"Search\"></td>');
document.write('  </tr>');
document.write('  ');
document.write('			 <tr>');
document.write('		    <td colspan=5>');
document.write('			<table cellspacing=1 cellpadding=3 border=0 bgcolor=\"#dddddd\" width=\"96%\">');
document.write('			<tr>');
document.write('			  <td bgcolor=\"#ffffdd\">');
document.write('			  Tours are continuously updated and may be available at a later time.');
document.write('			  </td>');
document.write('			</tr>');
document.write('			</table>');
document.write('		    </td>');
document.write('		  </tr>');
document.write('		');
document.write('  </table>');
document.write('  </form>');
document.write('');
document.write('  </td>');
document.write('</tr>');
document.write('</table>');
document.write('<script language=\"javascript\">');
document.write('');
document.write('update_tour_depart();');
document.write('var depart_obj = get_tour_depart_obj();');
document.write('if (depart_obj.options.selectedIndex > -1)');
document.write('{');
document.write('	update_tour_to(depart_obj.options[depart_obj.selectedIndex].value);');
document.write('}');
document.write('check_tour_ignore();');
document.write('if (aff_id != null) ');
document.write('{');
document.write('	if (document.tour_search.gid);');
document.write('	{');
document.write('		document.tour_search.gid.value = aff_id;');
document.write('	}');
document.write('	if (document.tour_search.nm);');
document.write('	{');
document.write('		document.tour_search.nm.value = aff_id;');
document.write('	}');
document.write('}');
document.write('</script>');
