if(typeof commercialNode == 'undefined')
{
	if(typeof thisNode != 'undefined')
	{
		commercialNode = thisNode;
	}
	else
	{
		commercialNode = 'washingtonpost.com'
	}
}

key_word = ''

doTiffany=false;


if (commercialNode=='washingtonpost.com')
{	
	
	doTiffany=true
}

if ((now >= "07160000" && now <= "11152359") && (commercialNode.match('fedpage') && commercialNode.match('politics')) || (commercialNode.match('fedpage') && commercialNode.match('opinion')) || (thisNode.match('politics') && thisNode.match('fedpage')))
{	
	key_word = 'kw=Tiffloop'
	doTiffany=true
}


else if ((now <= "04032359") && (commercialNode.match('opinion') || commercialNode.match('nation') || commercialNode.match('politics') || commercialNode.match('world') || commercialNode.match('print') || commercialNode.match('business') || commercialNode.match('liveonline') || commercialNode.match('technology')))
{	
	key_word = 'kw=exec'
	doTiffany=true
}



tiff_ran = Math.floor(Math.random()*1000000000000)


tiff_test = ''

if(location.href.match('test_ads'))
{
	tiff_test = 'kw=wpni_test;'
	
}


if(location.href.match('metro') && commercialNode=='metro' && !location.href.match('AR2007062501889'))
{

adCode = '<div style="margin:0px;padding:0px"><a href="http://www.washingtonpost.com/wp-srv/dealsdiscount/deals_discounts.html" target="_blank"><img src="http://www.washingtonpost.com/wp-adv/advertisers/dealsdiscounts/images/Deals_Discounts_234x60.gif" width="234" height="60" border="0" alt="Discounts & Deals"></a></div>'
adCode = '<div style="padding-bottom:15px;padding-top:2px;float:left;"><img src="http://www.washingtonpost.com/wp-srv/hp/img/advertical.gif" ></div>'+adCode
document.write(adCode)

}
else if(location.href.match('AR2007062501889') && location.href.match('test_ads'))
{
	document.write('<div style="position:relative;margin:10px;padding:0px"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="300" height="45"><param name="movie" value="http://www.washingtonpost.com/wp-adv/tmo/metlife_300x45_2.swf"><param name="quality" value="high"><embed src="http://www.washingtonpost.com/wp-adv/tmo/metlife_300x45_2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="300" height="45"></embed></object></div>')
}
else if(doTiffany)
{
adCode = '<div style="margin:0px;padding:0px"><s\cript src="http://ad.doubleclick.net/adj/wpni.'+commercialNode.split("/")[0]+';ad=tiff;'+tiff_test+key_word+';ord='+tiff_ran+'?"></s\cript></div>'
adCode = '<div style="padding-bottom:15px;padding-top:2px;float:left;"><img src="http://www.washingtonpost.com/wp-srv/hp/img/advertical.gif" ></div>'+adCode
document.write(adCode)


	debugPrompt = (location.href.match('debugAdCode'))?prompt("This is the current TiffanyTile code:", adCode):'';

}
			



