/* BudgetTravel.com - scripts */


/* begin image swaps */
function swapImgOn(a)
{
	if (a == 'btnGoSearch1')
	{
		document.getElementById('btnGoSearch1').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_search_btngo_b.gif)';
	}
	
	if (a == 'btnGoSearch2')
	{
		document.getElementById('btnGoSearch2').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_search_btngo_b.gif)';
	}
	
	if (a == 'btnGoSearch3')
	{
		document.getElementById('btnGoSearch3').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_search_btngo_b.gif)';
	}
	
	if (a == 'btnGoSearch4')
	{
		document.getElementById('btnGoSearch4').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_search_btngo_b.gif)';
	}
	
	if (a == 'btnGoSearch5')
	{
		document.getElementById('btnGoSearch5').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_search_btngo_b.gif)';
	}
	
	if (a == 'btnSearchBook1')
	{
		document.getElementById('btnSearchBook1').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_book_btnsrch_b.gif)';
	}
	
	if (a == 'btnSearchBook2')
	{
		document.getElementById('btnSearchBook2').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_book_btnsrch_b.gif)';
	}
	
	if (a == 'btnSearchBook3')
	{
		document.getElementById('btnSearchBook3').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_book_btnsrch_b.gif)';
	}
	
	if (a == 'btnSearchBook4')
	{
		document.getElementById('btnSearchBook4').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_book_btnsrch_b.gif)';
	}
	
	if (a == 'btnSearchBook5')
	{
		document.getElementById('btnSearchBook5').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_book_btnsrch_b.gif)';
	}
	
	if (a == 'tm_globe_a')
	{
		document.getElementById('tm_globe_a').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_tm-ads_globe_b.gif)';
	}
	
	if (a == 'btnGoTravNews')
	{
		document.getElementById('btnGoTravNews').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_travelnews_btngo_b.gif)';
	}
}

function swapImgOff(a)
{
	if (a == 'btnGoSearch1')
	{
		document.getElementById('btnGoSearch1').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_search_btngo.gif)';
	}
	
	if (a == 'btnGoSearch2')
	{
		document.getElementById('btnGoSearch2').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_search_btngo.gif)';
	}
	
	if (a == 'btnGoSearch3')
	{
		document.getElementById('btnGoSearch3').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_search_btngo.gif)';
	}
	
	if (a == 'btnGoSearch4')
	{
		document.getElementById('btnGoSearch4').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_search_btngo.gif)';
	}
	
	if (a == 'btnGoSearch5')
	{
		document.getElementById('btnGoSearch5').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_search_btngo.gif)';
	}
	
	if (a == 'btnSearchBook1')
	{
		document.getElementById('btnSearchBook1').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_book_btnsrch.gif)';
	}
	
	if (a == 'btnSearchBook2')
	{
		document.getElementById('btnSearchBook2').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_book_btnsrch.gif)';
	}
	
	if (a == 'btnSearchBook3')
	{
		document.getElementById('btnSearchBook3').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_book_btnsrch.gif)';
	}
	
	if (a == 'btnSearchBook4')
	{
		document.getElementById('btnSearchBook4').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_book_btnsrch.gif)';
	}
	
	if (a == 'btnSearchBook5')
	{
		document.getElementById('btnSearchBook5').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_book_btnsrch.gif)';
	}
	
	if (a == 'tm_globe_a')
	{
		document.getElementById('tm_globe_a').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_tm-ads_globe.gif)';
	}
	
	if (a == 'btnGoTravNews')
	{
		document.getElementById('btnGoTravNews').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/modules_rightrail/module_travelnews_btngo.gif)';
	}
}
/* end image swaps */


<!-- flickering in IE6 -->
try {
  document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}
<!-- end flickering in IE6 -->


/* begin right-rail search module */
function srchTabs(a)
{
	if (a == 'srch_panel1')
	{
		document.getElementById('srch_panel1').style.display='block';
		document.getElementById('srch_tab1').style.backgroundPosition='0px -26px';
		document.getElementById('srch_panel2').style.display='none';
		document.getElementById('srch_tab2').style.backgroundPosition='-47px 0px';
		document.getElementById('srch_panel3').style.display='none';
		document.getElementById('srch_tab3').style.backgroundPosition='-108px 0px';
		document.getElementById('srch_panel4').style.display='none';
		document.getElementById('srch_tab4').style.backgroundPosition='-174px 0px';
		document.getElementById('srch_panel5').style.display='none';
		document.getElementById('srch_tab5').style.backgroundPosition='-249px 0px';
	}
	if (a == 'srch_panel2')
	{
		document.getElementById('srch_panel1').style.display='none';
		document.getElementById('srch_tab1').style.backgroundPosition='0px 0px';
		document.getElementById('srch_panel2').style.display='block';
		document.getElementById('srch_tab2').style.backgroundPosition='-47px -26px';
		document.getElementById('srch_panel3').style.display='none';
		document.getElementById('srch_tab3').style.backgroundPosition='-108px 0px';
		document.getElementById('srch_panel4').style.display='none';
		document.getElementById('srch_tab4').style.backgroundPosition='-174px 0px';
		document.getElementById('srch_panel5').style.display='none';
		document.getElementById('srch_tab5').style.backgroundPosition='-249px 0px';
	}
	if (a == 'srch_panel3')
	{
		document.getElementById('srch_panel1').style.display='none';
		document.getElementById('srch_tab1').style.backgroundPosition='0px 0px';
		document.getElementById('srch_panel2').style.display='none';
		document.getElementById('srch_tab2').style.backgroundPosition='-47px 0px';
		document.getElementById('srch_panel3').style.display='block';
		document.getElementById('srch_tab3').style.backgroundPosition='-108px -26px';
		document.getElementById('srch_panel4').style.display='none';
		document.getElementById('srch_tab4').style.backgroundPosition='-174px 0px';
		document.getElementById('srch_panel5').style.display='none';
		document.getElementById('srch_tab5').style.backgroundPosition='-249px 0px';
	}
	if (a == 'srch_panel4')
	{
		document.getElementById('srch_panel1').style.display='none';
		document.getElementById('srch_tab1').style.backgroundPosition='0px 0px';
		document.getElementById('srch_panel2').style.display='none';
		document.getElementById('srch_tab2').style.backgroundPosition='-47px 0px';
		document.getElementById('srch_panel3').style.display='none';
		document.getElementById('srch_tab3').style.backgroundPosition='-108px 0px';
		document.getElementById('srch_panel4').style.display='block';
		document.getElementById('srch_tab4').style.backgroundPosition='-174px -26px';
		document.getElementById('srch_panel5').style.display='none';
		document.getElementById('srch_tab5').style.backgroundPosition='-249px 0px';
	}
	if (a == 'srch_panel5')
	{
		document.getElementById('srch_panel1').style.display='none';
		document.getElementById('srch_tab1').style.backgroundPosition='0px 0px';
		document.getElementById('srch_panel2').style.display='none';
		document.getElementById('srch_tab2').style.backgroundPosition='-47px 0px';
		document.getElementById('srch_panel3').style.display='none';
		document.getElementById('srch_tab3').style.backgroundPosition='-108px 0px';
		document.getElementById('srch_panel4').style.display='none';
		document.getElementById('srch_tab4').style.backgroundPosition='-174px 0px';
		document.getElementById('srch_panel5').style.display='block';
		document.getElementById('srch_tab5').style.backgroundPosition='-249px -26px';
	}
}

function srchBTOorWeb(a)
{
	if (a == 'modSearchAllBTO')
	{
		document.getElementById('frmSearchAll').action='http://search.atomz.com/search/';
		document.getElementById('modSearchAllKeywords').name='sp_q';
	}
	if (a == 'modSearchAllWeb')
	{
		document.getElementById('frmSearchAll').action='http://www.ask.com/web';
		document.getElementById('modSearchAllKeywords').name='q';
	}
}
/* end right-rail search module */


/* begin right-rail book module */
function bookTabs(a)
{
	if (a == 'book_panel1')
	{
		document.getElementById('book_panel1').style.display='block';
		document.getElementById('book_tab1').style.backgroundPosition='0px -26px';
		document.getElementById('book_panel2').style.display='none';
		document.getElementById('book_tab2').style.backgroundPosition='-73px 0px';
		document.getElementById('book_panel3').style.display='none';
		document.getElementById('book_tab3').style.backgroundPosition='-139px 0px';
		document.getElementById('book_panel4').style.display='none';
		document.getElementById('book_tab4').style.backgroundPosition='-201px 0px';
		document.getElementById('book_panel5').style.display='none';
		document.getElementById('book_tab5').style.backgroundPosition='-246px 0px';
	}
	if (a == 'book_panel2')
	{
		document.getElementById('book_panel1').style.display='none';
		document.getElementById('book_tab1').style.backgroundPosition='0px 0px';
		document.getElementById('book_panel2').style.display='block';
		document.getElementById('book_tab2').style.backgroundPosition='-73px -26px';
		document.getElementById('book_panel3').style.display='none';
		document.getElementById('book_tab3').style.backgroundPosition='-139px 0px';
		document.getElementById('book_panel4').style.display='none';
		document.getElementById('book_tab4').style.backgroundPosition='-201px 0px';
		document.getElementById('book_panel5').style.display='none';
		document.getElementById('book_tab5').style.backgroundPosition='-246px 0px';
	}
	if (a == 'book_panel3')
	{
		document.getElementById('book_panel1').style.display='none';
		document.getElementById('book_tab1').style.backgroundPosition='0px 0px';
		document.getElementById('book_panel2').style.display='none';
		document.getElementById('book_tab2').style.backgroundPosition='-73px 0px';
		document.getElementById('book_panel3').style.display='block';
		document.getElementById('book_tab3').style.backgroundPosition='-139px -26px';
		document.getElementById('book_panel4').style.display='none';
		document.getElementById('book_tab4').style.backgroundPosition='-201px 0px';
		document.getElementById('book_panel5').style.display='none';
		document.getElementById('book_tab5').style.backgroundPosition='-246px 0px';
	}
	if (a == 'book_panel4')
	{
		document.getElementById('book_panel1').style.display='none';
		document.getElementById('book_tab1').style.backgroundPosition='0px 0px';
		document.getElementById('book_panel2').style.display='none';
		document.getElementById('book_tab2').style.backgroundPosition='-73px 0px';
		document.getElementById('book_panel3').style.display='none';
		document.getElementById('book_tab3').style.backgroundPosition='-139px 0px';
		document.getElementById('book_panel4').style.display='block';
		document.getElementById('book_tab4').style.backgroundPosition='-201px -26px';
		document.getElementById('book_panel5').style.display='none';
		document.getElementById('book_tab5').style.backgroundPosition='-246px 0px';
	}
	if (a == 'book_panel5')
	{
		document.getElementById('book_panel1').style.display='none';
		document.getElementById('book_tab1').style.backgroundPosition='0px 0px';
		document.getElementById('book_panel2').style.display='none';
		document.getElementById('book_tab2').style.backgroundPosition='-73px 0px';
		document.getElementById('book_panel3').style.display='none';
		document.getElementById('book_tab3').style.backgroundPosition='-139px 0px';
		document.getElementById('book_panel4').style.display='none';
		document.getElementById('book_tab4').style.backgroundPosition='-201px 0px';
		document.getElementById('book_panel5').style.display='block';
		document.getElementById('book_tab5').style.backgroundPosition='-246px -26px';
	}
}
/* end right-rail book module */


/* begin auto-text */
function autoText(m,n)
{
	var a = document.getElementById(m)
	
	if (a.value == n)
	{
		a.style.color='#999';
		
		a.onclick = function()
		{
			if (a.value == n)
			{
				a.value = '';
				/* a.style.color='#717165'; */
				a.style.color='#111';
			}
		}
		a.onfocus = function()
		{
			if (a.value == n)
			{
				a.value = '';
				/* a.style.color='#717165'; */
				a.style.color='#111';
			}
		}
		a.onblur = function()
		{
			if (a.value == '')
			{
				a.value = n;
				a.style.color='#999';
			}
		}
	}
	
	if (a.value != n)
	{
		a.onblur = function()
		{
			if (a.value != '')
			{
				a.value = n;
				a.style.color='#999';
			}
		}
	}
}
/* end auto-text */


/* begin marquees */
function tabSwitch(a)
{
	if (a == 'tab1')
	{
		document.getElementById('tab1').style.height='32px';
		document.getElementById('tab1').style.borderTop='none';
		document.getElementById('tab1').style.borderRight='1px solid #c7ce9a';
		document.getElementById('tab1').style.backgroundImage='none';
		document.getElementById('tab2').style.height='29px';
		document.getElementById('tab2').style.borderTop='1px solid #c7ce9a';
		document.getElementById('tab2').style.borderLeft='none';
		document.getElementById('tab2').style.borderRight='1px solid #c7ce9a';
		document.getElementById('tab2').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/menu_bg.jpg)';
		document.getElementById('tab3').style.height='29px';
		document.getElementById('tab3').style.borderTop='1px solid #c7ce9a';
		document.getElementById('tab3').style.borderLeft='none';
		document.getElementById('tab3').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/menu_bg.jpg)';
		
		document.getElementById('panel1').style.display='block';
		document.getElementById('panel2').style.display='none';
		document.getElementById('panel3').style.display='none';
	}
	
	if (a == 'tab2')
	{
		document.getElementById('tab1').style.height='29px';
		document.getElementById('tab1').style.borderTop='1px solid #c7ce9a';
		document.getElementById('tab1').style.borderRight='none';
		document.getElementById('tab1').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/menu_bg.jpg)';
		document.getElementById('tab2').style.height='32px';
		document.getElementById('tab2').style.borderTop='none';
		document.getElementById('tab2').style.borderLeft='1px solid #c7ce9a';
		document.getElementById('tab2').style.borderRight='1px solid #c7ce9a';
		document.getElementById('tab2').style.backgroundImage='none';
		document.getElementById('tab3').style.height='29px';
		document.getElementById('tab3').style.borderTop='1px solid #c7ce9a';
		document.getElementById('tab3').style.borderLeft='none';
		document.getElementById('tab3').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/menu_bg.jpg)';
		
		document.getElementById('panel1').style.display='none';
		document.getElementById('panel2').style.display='block';
		document.getElementById('panel3').style.display='none';
	}
	
	if (a == 'tab3')
	{
		document.getElementById('tab1').style.height='29px';
		document.getElementById('tab1').style.borderTop='1px solid #c7ce9a';
		document.getElementById('tab1').style.borderRight='none';
		document.getElementById('tab1').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/menu_bg.jpg)';
		document.getElementById('tab2').style.height='29px';
		document.getElementById('tab2').style.borderTop='1px solid #c7ce9a';
		document.getElementById('tab2').style.borderLeft='1px solid #c7ce9a';
		document.getElementById('tab2').style.backgroundImage='url(http://www.budgettravel.com/bt-srv/images/122006/menu_bg.jpg)';
		document.getElementById('tab2').style.borderRight='none';
		document.getElementById('tab3').style.height='32px';
		document.getElementById('tab3').style.borderTop='none';
		document.getElementById('tab3').style.borderLeft='1px solid #c7ce9a';
		document.getElementById('tab3').style.backgroundImage='none';
		
		document.getElementById('panel1').style.display='none';
		document.getElementById('panel2').style.display='none';
		document.getElementById('panel3').style.display='block';
	}
}
/* end marquees */


/* promobox1 randomizer */
function promoBox1Refresh()
{
	var promoBox1 = new Array()
	promoBox1[0] = 'win_universal_june08_255x90.gif'
	promoBox1[1] = 'stingray2_255x90.gif'
	// 2007.09.06 - JBeam: removed per adops, delete this line after a month or so
	// promoBox1[2] = 'hyundai_ultimate_255x90.gif'
	 
	var promoBox1Length = promoBox1.length;
	var promoBox1Preload = new Array()
	 
	for (i = 0; i < promoBox1Length; i++)
	{
		promoBox1Preload[i] = new Image()
		promoBox1Preload[i].src = promoBox1[i]
	}
	
	var promoBox1Random = Math.round(Math.random()*(promoBox1Length-1));
	
	if(promoBox1Random == 0)
	{
		document.write('<a href="http://letters.budgettravel.com/p/Budget_Travel/BT_newsletter_center-2.bk"><img src="http://www.budgettravel.com/bt-srv/images/122007/' + promoBox1[promoBox1Random] + '" border="0" alt="Win a trip for four to Universal Orlando!"></a>');
	}
	else if(promoBox1Random == 1)
	{
		document.write('<a href="http://www.budgettravel.com/bt-dyn/content/article/2008/03/31/AR2008033101606.html"><img src="http://www.budgettravel.com/bt-srv/images/122007/' + promoBox1[promoBox1Random] + '" border="0" alt="Take a look at Budget Travel\'s new book!"></a>');
	}
	// 2007.09.06 - JBeam: removed per adops, delete this line after a month or so
}
/* end promobox randomizer */


/* external links */
function externalLinks()
{ 
	if (!document.getElementsByTagName)
		return;
	var anchors = document.getElementsByTagName("a");
	var areas = document.getElementsByTagName("area");
	for (var i=0; i<anchors.length; i++)
	{
		var anchor = anchors[i]; 
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
			anchor.target = "_blank"; 
	}
	for (var i=0; i<areas.length; i++)
	{
		var area = areas[i]; 
		if (area.getAttribute("href") && area.getAttribute("rel") == "external")
			area.target = "_blank"; 
	}
} 
window.onload = externalLinks;
/* end external links */


/* pop-up script for photo pop-ups, like on article pages */
/*
	2007.10.25 JBeam
	This snippet is required for article photo pop-ups, and possibly other pages.  
	Right now, this snippet is placed in the header of Orbit pages from the 
	template code.  However, this snippet is also hard-coded into the header of 
	most static pages on bt-srv.
	
	This shouldn't be populated from Orbit or hard-coded into pages.  It should be 
	called from this file.  Unfortunately, enabling it in this file causes a 
	conflict with other code and causes some things to break.  I believe the 
	conflict stems for the function being called twice (once from here, and 
	again from the header).  Eventually, this snippet should be removed from 
	all Orbit templates, and from any static pages, so that it's only populated 
	from this file.
*/
/*
<script language="javascript" type="text/javascript">
<!--
function popitup(url, height, width)
{
var dimString = "height=" + height + ",width=" + width + "'"
newwindow=window.open(url,'name',dimString);
if (window.focus) {newwindow.focus()}
return false;
}
// -->
</script>
*/
/* end pop-up script for photo pop-ups, like on article pages */