/* 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 */


/* ////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////// */


/* a different type of image swap */
function btn_rollOver(a)
{
	document.getElementById(a).style.backgroundPosition='0px -21px';
}

function btn_rollOut(a)
{
	document.getElementById(a).style.backgroundPosition='0px 0px';
}
/* end diff image swap */


/* ////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////// */


<!-- flickering in IE6 -->
try {
  document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}
<!-- end flickering in IE6 -->


/* ////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////// */


/* end bt logo bar - news box */

/**********************************************************************************   
NewsSlideFade 
*   Copyright (C) 2001 Thomas Brattli
*   This script was released at DHTMLCentral.com
*   Visit for more great scripts!
*   This may be used and changed freely as long as this msg is intact!
*   We will also appreciate any links you could give us.
*
*   Made by Thomas Brattli
*
*   Script date: 09/04/2001 (keep this date to check versions) 
*********************************************************************************/

function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=(navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=lib_bwcheck()

/***************************************************************************
Use the style tag to change the placement and width of the layers.
If you are trying to place this into a table cell or something make the
position of the divNewsCont layer relative...Remeber that that might crash
Netscape 4 though, Good luck!
********************************************************************************/

/****
Variables to set 
****/

//How do you want the script to work? 
//0 = Fade in - Fade out
//1 = Slide in - Fade out
//2 = Random 
nWorks = 0

//If you use the slide set these variables:
nSlidespeed = 5 //in px
nNewsheight = 80 //This is how long down it should start the slide.

nBetweendelay = 5000 //The delay before fading out.
nFont = 'arial,helvetica,sans-serif' //The font for the news.
nFontsize = 11 //Font size in pixel.
nFadespeed = 100 //The speed to fade in, in milliseconds.

//Set the colors, first color is same as background, last color is the color it stops at:
//You can have as many colors you want
nColor=new Array('#196ec1','#2f7dc9','#468dd1','#609dd9','#7db0e1','#9ac2e9','b8d5f1','d6e7f8','f3f8fd','#ffffff')



function include_dom(script_filename)
{ 
	var html_doc = document.getElementsByTagName('head').item(0); 
	var js = document.createElement('script'); 
	js.setAttribute('language', 'javascript'); 
	js.setAttribute('type', 'text/javascript'); 
	js.setAttribute('src', script_filename); 
	html_doc.appendChild(js); 
	return false; 
} 


/*
//This is the news you wanna have, set the link and the text. If you don't wan't it to link anywhere
//use a # as the link
nNews=new Array()
//Copy there three lines and change the info and numbers to get more news.
nNews[0]=new Array()
nNews[0]["text"]="Real Deals: 10 Valentine's Day <br>deals &nbsp; <span class='news_link_001'>read now</span>"
nNews[0]["link"]="http://www.budgettravel.com/bt-dyn/content/article/2008/01/17/AR2008011701149.html"

nNews[1]=new Array()
nNews[1]["text"]="Blog: Debunking a popular travel <br>myth &nbsp; <span class='news_link_001'>talk back</span>"
nNews[1]["link"]="http://current.newsweek.com/budgettravel/2008/01/rule_240_is_a_travel_myth.html"

nNews[2]=new Array()
nNews[2]["text"]="Article: Tips for taking sunset <br>photos &nbsp; <span class='news_link_001'>learn how</span>"
nNews[2]["link"]="http://www.budgettravel.com/bt-dyn/content/article/2008/01/16/AR2008011602477.html"

nNews[3]=new Array()
nNews[3]["text"]="Game: Photo scramble!  Solve and <br>you might win &nbsp; <span class='news_link_001'>play now</span>"
nNews[3]["link"]="http://www.budgettravel.com/bt-dyn/content/article/2007/12/17/AR2007121701293.html"
*/

/********************************************************************************
Object code...Object constructors and functions...
********************************************************************************/
function makeNewsObj(obj,nest,font,size,color,news,fadespeed,betweendelay,slidespeed,works,newsheight){
    nest=(!nest) ? "":'document.'+nest+'.'
   	this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0;	
   	this.writeref=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+"document.layers." +obj+".document"):0;
	if(font){this.color=new Array(); this.color=eval(color); this.news=new Array(); this.news=eval(news)
		this.font=font; this.size=size; this.speed=fadespeed; this.delay=betweendelay; this.newsheight=newsheight;
		this.fadeIn=b_fadeIn;this.fadeOut=b_fadeOut; this.newsWrite=b_newsWrite; this.y=1
		this.slideIn=b_slideIn; this.moveIt=b_moveIt; this.slideSpeed=slidespeed; this.works=works
		if(bw.dom || bw.ie4){this.css.fontFamily=this.font; this.css.fontSize=this.size; this.css.color=this.color[0]}
	}
	this.obj = obj + "Object"; 	eval(this.obj + "=this"); return this
}

// A unit of measure that will be added when setting the position of a layer.
var px = bw.ns4||window.opera?"":"px";

function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x+px; this.css.top=this.y+px;}

/*
function b_newsWrite(num,i){
	if (bw.ns4){
		this.writeref.write("<a href=\""+this.news[num]['link']+"\" target=\"myTarget\" style=\"text-decoration:none; font-size:"+this.size+"px\">"
			+"<font face=\""+this.font+"\" color=\""+this.color[i]+"\">"+this.news[num]['text']+"</font></a>")
		this.writeref.close()
	}else this.writeref.innerHTML = '<a id="'+this.obj+'link' +'" target="myTarget"  style="text-decoration:none; font-size:'+this.size+'px; color:'+this.color[i]+'" href="'+this.news[num]['link']+'">'+this.news[num]['text']+'</a>'
}
*/
function b_newsWrite(num,i){
	if (bw.ns4){
		this.writeref.write("<a href=\""+this.news[num]['link']+"\" style=\"text-decoration:none; font-size:"+this.size+"px\">"
			+"<font face=\""+this.font+"\" color=\""+this.color[i]+"\">"+this.news[num]['text']+"</font></a>")
		this.writeref.close()
	}else this.writeref.innerHTML = '<a id="'+this.obj+'link' +'"  style="text-decoration:none; font-size:'+this.size+'px; color:'+this.color[i]+'" href="'+this.news[num]['link']+'">'+this.news[num]['text']+'</a>'
}
//Slide in
function b_slideIn(num,i){
	if (this.y>0){
		if (i==0){this.moveIt(0,this.newsheight); this.newsWrite(num,this.color.length-1)}
		this.moveIt(this.x,this.y-this.slideSpeed)
		i ++
		setTimeout(this.obj+".slideIn("+num+","+i+");",50)
	}else setTimeout(this.obj+".fadeOut("+num+","+(this.color.length-1)+")",this.delay)
}
//The fade functions
function b_fadeIn(num,i){
	if (i<this.color.length){
		if (i==0 || bw.ns4) this.newsWrite(num,i)
		else{
			obj = bw.ie4?eval(this.obj+"link"):document.getElementById(this.obj+"link")
			obj.style.color = this.color[i]
		}
		i ++
		setTimeout(this.obj+".fadeIn("+num+","+i+")",this.speed)
	}else setTimeout(this.obj+".fadeOut("+num+","+(this.color.length-1)+")",this.delay)
}

function b_fadeOut(num,i){
	if (i>=0){
		if (i==0 || bw.ns4) this.newsWrite(num,i)	
		else{
			obj = bw.ie4?eval(this.obj+"link"):document.getElementById(this.obj+"link")
			obj.style.color = this.color[i]
		}
		i --
		setTimeout(this.obj+".fadeOut("+num+","+i+")",this.speed)
	}else{
		num ++
		if(num==this.news.length) num=0
		works = !this.works?0:this.works==1?1:Math.round(Math.random())
		if(works==0) setTimeout(this.obj+".fadeIn("+num+",0)",500)
		else if (works==1){this.y=1; setTimeout(this.obj+".slideIn("+num+",0)",500)
		}
	}
}
/********************************************************************************************
The init function. Calls the object constructor and set some properties and starts the fade
*********************************************************************************************/
function fadeInit(){
	oNews = new makeNewsObj('divNews','divNewsCont',nFont,nFontsize,"nColor","nNews",nFadespeed,nBetweendelay,nSlidespeed,nWorks,nNewsheight)
	oNewsCont = new makeNewsObj('divNewsCont')
	works = !oNews.works?0:oNews.works==1?1:Math.round(Math.random())
	if (works==0) oNews.fadeIn(0,0)
	else if (works==1) oNews.slideIn(0,0)
	oNewsCont.css.visibility = "visible"
}

/* end bt logo bar - news box */


/* ////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////// */


/* begin global 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 == 'radio_srch_bt')
	{
		// document.getElementById('frmSearchAll').action='http://search.atomz.com/search/';
		document.getElementById('frmSearchAll').action='http://search.budgettravel.com/search/';
		document.getElementById('txt_srch_global').name='sp_q';
	}
	if (a == 'radio_srch_web')
	{
		document.getElementById('frmSearchAll').action='http://www.ask.com/web';
		document.getElementById('txt_srch_global').name='q';
	}
}
/* end global 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.style.color='#111';
		
		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'; */
				a.style.color='#111';
			}
		}
	}
	
	if (a.value != n)
	{
		a.onblur = function()
		{
			if (a.value == '')
			{
				a.value = n;
				/* a.style.color='#999'; */
				a.style.color='#111';
			}
		}
	}
}
/* 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] = "http://www.budgettravel.com/bt-srv/images/122007/joinmybt_255x90.gif";
		promoBox1[1] = "http://www.budgettravel.com/bt-srv/images/122007/win_myBTDreamTrips_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));
	var promoBox1Random = 1;

	if(promoBox1Random == 0) {
		document.write('<a href="http://www.budgettravel.com/bt-reg/PrepareNewReg.do?wpisrc=6000016"><img src="' + promoBox1[promoBox1Random] + '" border="0" alt="Got vacation photos or videos? Share them with Budget Travel\'s community!"></a>');
	}
	else if(promoBox1Random == 1) {
		document.write('<a href="http://www.budgettravel.com/bt-srv/contest/"><img src="' + promoBox1[promoBox1Random] + '" border="0" alt="Share your travel photos and you may get your photo published!"></a>');
	}
}
/* end promobox randomizer */


/* ////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////// */


// Begin launcher script for slide shows (added by A. Falcone 11/18/08)
function launchSlideshowV2 (whichShow,whichSlide) {
	if (!whichSlide) {
		whichSlide = 0;
	}
	var slideshowURL = "http://www.budgettravel.com/bt-srv/gallery/" + whichShow + "/index.html?jumpToPic=" + whichSlide;
	popupWindow = window.open(slideshowURL,'bt_gallery_v2','toolbar=0,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=900,height=675,left=0,top=0,screenX=0,screenY=0')
	popupWindow.focus()
}
// End launcher script for slide shows


/* ////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////// */


/* pop-up script for photo pop-ups, like on article pages */
function popitup(url, height, width)
{
	var dimString = "height=" + height + ",width=" + width + "'"
	newwindow=window.open(url,'name',dimString);
	if (window.focus)
	{
		newwindow.focus()
	}
	return false;
}
/* end pop-up script for photo pop-ups, like on article pages */


/* ////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////// */

/* 20090805 JBeam - consolidated into this file - for inline bb ad on articles */
function btAdArticleInlineBB()
{
	document.getElementById('slug_inlineBigBox').innerHTML='';
	document.getElementById('slug_inlineBigBox').style.display='none';
	/* document.getElementById('wpni_adi_inlineBigBox').style.margin='12px 12px 8px 0px'; */
	document.getElementById('wpni_adi_inlineBigBox').style.margin='8px 10px 8px 0px';
	/*
	document.getElementById('slug_inlineBigBox').innerHTML='ADVERTISEMENT | ARTICLE CONTINUES BELOW';
	document.getElementById('slug_inlineBigBox').style.margin='8px auto';
	document.getElementById('wpni_adi_inlineBigBox').style.margin='8px auto';
	*/
}

/* ////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////// */

// Begin generic e-mail validator (added by A. Falcone 08/27/09)

	function validEmail(email) {
		invalidChars = " /:,;"
		for (m=0; m<invalidChars.length; m++) {
			badChar = invalidChars.charAt(m);
			if (email.indexOf(badChar,0) > -1) {
				return false;
			}
		}
		atPos = email.indexOf("@",1);
		if (atPos == -1) {
			return false;
		}
		if (email.indexOf("@",atPos+1) > -1) {
			return false;
		}
		periodPos = email.indexOf(".",atPos);
          if (periodPos == -1) {
			return false;
		}
		if (periodPos+3 > email.length) {
			return false;
		}
		return true;
	}

// End generic e-mail validator
	
/* ////////////////////////////////////////////////////// */
/* ////////////////////////////////////////////////////// */

// Begin Deal Alerts sign-up form validator (added by A. Falcone 08/27/09)
	
	function validateSubscribeForm(form) {
		var requiredFields = new Array();
			requiredFields[1] = "e-mail address";
			requiredFields[2] = "zip code";
		for (i=1; i<=2; i++) {
			if (form[i].value.length==0) {
				form[i].focus();
				alert("Please provide your " + requiredFields[i] + ".");
				return false;
			}
			if (i==1) {
				if(!validEmail(form[i].value)) {
					form[i].select();
					form[i].focus();
					alert("Please check that you have typed your e-mail address correctly.");
					return false;
				}
			}
			if (i==2) {
				if (form[i].value.length != 5) {
					form[i].select();
					form[i].focus();
					alert("Please provide a valid 5-digit zip code.");
					return false;
				}
			}
		}
		return true;
	}

// End Deal Alerts sign-up form validator
