wpniSite='btvl'
wpniDomain='budgettravel.com'
show_doubleclick_ad = true
//poeString = "bt_poe"
rssString = "fromrss=y"
tileThatGetsDcopt = 2


if(typeof commercialNode != 'undefined' && commercialNode == 'none')
{
	commercialNode = thisNode;
}


wpniAds.templates.initRule('defaultTemplate');
wpniAds.templates.rules.defaultTemplate.what.push('!featurebar','!leaderboard_2','!leaderboard2','!88x31');

/*wpniAds.templates.initRule('featurebars');
wpniAds.templates.rules.featurebars.what = new Array("featurebar")
// Ad Id: 185925692, LYork, 02/04-06/30
wpniAds.templates.rules.featurebars.when = new Array("200802040000/200806302359");
wpniAds.templates.rules.featurebars.where = new Array("destinations/latinamerica/mexico");*/

//212998980-AK-8265
wpniAds.templates.initRule('featurebars');
wpniAds.templates.rules.featurebars.what = new Array("featurebar")
wpniAds.templates.rules.featurebars.when = new Array("200811140000/200812312359","200811140000/200812312359");
wpniAds.templates.rules.featurebars.where = new Array("destinations/usandcanada", "realdeals");
wpniAds.templates.rules.featurebars.when[0] = "200912010000/201001312359";
wpniAds.templates.rules.featurebars.where[0] = "tripideas/adventure";
wpniAds.templates.rules.featurebars.when[1] = "200912010000/201001312359";
wpniAds.templates.rules.featurebars.where[1] = "tripideas/solotravel";
wpniAds.templates.rules.featurebars.when[2] = "200904010000/200905222359";
wpniAds.templates.rules.featurebars.where[2] = "destinations/usandcanada";
wpniAds.templates.rules.featurebars.when[3] = "200904010000/200905222359";
wpniAds.templates.rules.featurebars.where[3] = "tripideas/roadtrips";

function initAdType(what)
{
	var thisAdType = new AdInstance();
	thisAdType.testFlagArray = new Array('test_ads','test_' + what);	
	thisAdType.debugFlagArray = new Array('debugAdCode','debugAdCode_' + what);
	 
	switch(what)
	{
		
		case 'leaderboard':
			thisAdType.size = "728x90";
			thisAdType.code = "ad=lb;";
		break
		
		case 'leaderboard2':
			thisAdType.size = "728x90";
			thisAdType.code = "ad=lb;";
		break

		case 'skyscraper':
			thisAdType.size = "160x600";
			thisAdType.code = "ad=ss;";
		break

		case 'bigboxSkyFlex':
			thisAdType.size = "300x250,160x600";
			thisAdType.code = "ad=bb;ad=ss;";
		break

		case 'bigbox':
			thisAdType.size = "300x250";
			thisAdType.code = "ad=bb;";
		break

		
		case 'bigboxHPFlex':
			thisAdType.size = "300x250,336x850";
			thisAdType.code = "ad=bb;ad=hp;";
		break
		
		case 'bigboxSkyHPFlex':
			thisAdType.size = "300x250,160x600,336x850";
			thisAdType.code = "ad=bb;ad=ss;ad=hp;";
		break

		case 'sponsorship':
			thisAdType.size = "446x33";
			thisAdType.code = "ad=fb;";
		break
		
		case 'featurebar':
			thisAdType.size = "251x87";
			thisAdType.code = "ad=fb;";

		break

		case '125x125':
			thisAdType.size = "125x125";
			thisAdType.code = "ad=tt;";
		break
		
		case '120x240':
			thisAdType.size = "120x240";
			thisAdType.code = "ad=btt;";
		break
		
		case '160x90':
			thisAdType.size = "160x90";
			thisAdType.code = "";
		break
		
		case '88x31':
			thisAdType.size = "88x31";
			thisAdType.code = "ad=88x31TT;";
		break

		case 'inlineBigBox':
			thisAdType.size = "300x250";
			thisAdType.code = "ad=bb;!c=intrusive;"
			thisAdType.adType = "inline"
			thisAdType.obstacleId = "contentColumn";
			thisAdType.parentId = "temp_artbody";
			thisAdType.childElement = "P"
			thisAdType.obstacleMargin = 200;
			thisAdType.slugURL = "http://www.budgettravel.com/bt-srv/images/122006/advert_slug_002.gif"
			thisAdType.maxHeight = 280;
			thisAdType.maxWidth = 336;
	
		break
			case 'rightPromoTile':
			thisAdType.adExecute = function ()
			{
				
		
				//6513--LY
				if(dateToString() <= "200908312359")
				{
					document.writeln('<iframe style="margin-top:6px" src="http://view.atdmt.com/00A/iview/111598864/direct/01?click="frameborder="0" scrolling="no" marginheight="0" marginwidth="0" topmargin="0"leftmargin="0" allowtransparency="true" width="336" height="80"><s\cript language="JavaScript" type="text/javascript"> document.write(\'<a href="http://clk.atdmt.com/00A/go/111598864/direct/01/" target="_blank"><img src="http://view.atdmt.com/00A/view/111598864/direct/01/"/></a>\');</script><noscript><a href="http://clk.atdmt.com/00A/go/111598864/direct/01/" target="_blank"><img border="0" src="http://view.atdmt.com/00A/view/111598864/direct/01/"/></a></noscript></iframe>');
				}
			}
		break
		case 'video':
			thisAdType.adServer = 'http://ad.doubleclick.net/pfadx/'
			thisAdType.code = "ad=video"
			thisAdType.adExecute = function (currentLoc,varDcCount,what,flexBoolean)
			{
				if(typeof config == 'undefined')
				{
					config = new Array();
				}
				
				config['adServerURL'] = this.adServer + siteZoneDir(currentLoc) + this.code + ";" + thisAdType.testAction(thisAdType.testFlagArray)
				config['additionalAdTargetingParams'] = ';' + this.dcCode
				
				for(var x in this.debugFlagArray)
				{
					if (location.href.match(this.debugFlagArray[x]))
					{
						this.debugAction()
					}
				}
			}
			
			thisAdType.debugAction = function()
			{
				var output = "config['adServerURL']:" + config['adServerURL'] + "\n\r"
				output += "config['additionalAdTargetingParams']:" + config['additionalAdTargetingParams'] + "\n\r"
				adopsDebug("video call:" + output)
			}

		break

	}
	
	if (thisAdType.isThisManaged = true)
	{
	thisAdType.managerListLength = getHighestValue(thisAdType.when.length,thisAdType.where.length)
	}
	
	
return thisAdType
}

show_doubleclick_ad = true;

//this translates from the old placeAd to the new one


function placeAd()
{
	currentLoc=arguments[1]
	spot = arguments[2]	
	onTheFly=arguments[3]
	front(arguments[0])
	
	var transArray = new Array('','leaderboard','leaderboard2','skyscraper','skyscraper','bigboxSkyFlex','bigboxSkyHPFlex','sponsorship','125x125','120x240','160x90','bigboxHPFlex','featurebar','88x31')
	
	placeAd2(currentLoc,transArray[spot],false,onTheFly)
}

function front()
{
	if(typeof this.frontReturnValue == 'undefined')
	{
		this.frontReturnValue = '';
	}
	if(arguments[0])
	{
		this.frontReturnValue = (arguments[0].toLowerCase() == 'article')?'front=n;':'front=y;';
	}
	else
	{
		return this.frontReturnValue;
	}
	return
};

//Google Text Links
googleAds.googleVars.google_ad_client="ca-washingtonpost-budgettravel_js";
googleAds.nodeHacks = ['/usandcanada','/europe','/caribbean','/latinamerica','/asia','/australia','/africa'];
googleAds.hideBox = 'bottom';
//END Google Text Links


function hackBin(_arg,currentLoc,what,delivery,onTheFly)
{
	var hackReturnValue=eval(_arg)
	switch(_arg)
	{
		case 'onTheFly':
			hyundaiHack = ['misc/brooklyn/CobbleHill.html','misc/brooklyn/ParkSlope.html','misc/brooklyn/Williamsburg.html','google_maps/sandiego/','google_maps/washingtondc/','misc/GG_BigCityMaps/Chicago/chicago_pop.html','misc/GG_BigCityMaps/Montreal/montreal_pop.html','misc/GG_BigCityMaps/Miami/miami_pop.html','misc/GG_BigCityMaps/NewYorkCity/newyork_pop.html','misc/GG_BigCityMaps/SanFrancisco/sanfrancisco_pop.html','misc/projectrunway/newyorkcity.html','misc/davinci/paris.html','misc/davinci/london.html','misc/davinci/scotland.html','misc/starmaps/newyorkcity.html','misc/starmaps/losangeles.html','/bt-srv/microsite/hyundai']
			for(var _a = 0;_a<hyundaiHack.length;_a++)
			{
				hackReturnValue+=(location.href.match(hyundaiHack[_a]))?'hyundai=y;':'';
			}
		break;
		
		/*case 'currentLoc':
			texasHack = ['AR2007021300533','AR2005060400571','AR2005060400903','AR2005060400565','AR2006061301067','AR2005060400433','AR2006030901272','AR2005060400896','zipcode=73301','zipcode=78401','zipcode=Dallas%2C+Texas','zipcode=79901','zipcode=galveston%2C+texas','zipcode=Houston%2C+Texas','zipcode=78201']
			for(var _a = 0;_a<texasHack.length;_a++)
			{
				hackReturnValue=(location.href.match(texasHack[_a]))?'usandcanada/us/texas':hackReturnValue;
			}
		break;*/
	}
	return hackReturnValue
}