/** 
 * This javascript will become the "universal" control for billboards. Hopefully.
 * You must import WPNIAds.js before to have any chance at this working;
 * You must import sectionfront_ad_template.js (and use ad toggling) to kill ads when a billboard runs.
 **/
// Proceed only if necessary objects have been imported
if ( typeof AdTagCollection != 'undefined')
{
  // Current time (per user's computer), for timing ads
  var now = new Date(); 
  // Define yer basic JavaScript ad objects for billboard and interstitials. 
  var adCollection = new AdTagCollection();
  var billboard = new WpniAd();
  billboard.setAdType('Billboard');
  billboard.setProperty(new WpniAdProperty('pos', 'prepage'));

  var interstitial = new WpniAd();
  interstitial.setAdType('Interstitial');
  interstitial.setProperty(new WpniAdProperty('pos', 'prepage'));

  

	//if safari, don't display the billboard
	    var agt=navigator.userAgent.toLowerCase();
		if ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))
			{}


else if ( thisNode == 'sports' )
{
// Specify location of HTML file containing billboard ad
billboard.setProperty(new WpniAdProperty('url','http://www.washingtonpost.com/wp-srv/javascript/common/ads/sports_billboard.htm'));

// Specify condition[s] under which ad displays
billboard.setCondition('(now>new Date(2005,1,21,0,00,00))&&(now<new Date(2005,1,27,23,59,00))');
   // Toss the billboard into the ad collection
adCollection.addWpniAd(billboard);

} 

else if ( thisNode == 'traffic' )
{
// Specify location of HTML file containing billboard ad
billboard.setProperty(new WpniAdProperty('url','http://www.washingtonpost.com/wp-srv/javascript/common/ads/traffic_billboard.htm'));

// Specify condition[s] under which ad displays
billboard.setCondition('(now>new Date(2005,0,3,0,00,00))&&(now<new Date(2005,0,9,23,59,00))');
   // Toss the billboard into the ad collection
adCollection.addWpniAd(billboard);

} 

else if ( thisNode == 'nation' )
{
// Specify location of HTML file containing billboard ad
billboard.setProperty(new WpniAdProperty('url','http://www.washingtonpost.com/wp-srv/javascript/common/ads/nation_billboard.htm'));

// Specify condition[s] under which ad displays
billboard.setCondition('(now>new Date(2004,10,16,0,00,00))&&(now<new Date(2004,10,16,23,59,00))');
   // Toss the billboard into the ad collection
adCollection.addWpniAd(billboard);

} 

else if ( thisNode == 'technology' )
{
// Specify location of HTML file containing billboard ad
billboard.setProperty(new WpniAdProperty('url','http://www.washingtonpost.com/wp-srv/javascript/common/ads/tech_billboard.htm'));

// Specify condition[s] under which ad displays
billboard.setCondition('(now>new Date(2004,10,15,0,00,00))&&(now<new Date(2004,10,20,23,59,00))');
   // Toss the billboard into the ad collection
adCollection.addWpniAd(billboard);

} 

else if ( thisNode == 'metro' )
{
// Specify location of HTML file containing billboard ad
billboard.setProperty(new WpniAdProperty('url','http://www.washingtonpost.com/wp-srv/javascript/common/ads/metro_billboard.htm'));

// Specify condition[s] under which ad displays
billboard.setCondition('(now>new Date(2004,10,16,0,00,00))&&(now<new Date(2004,10,16,23,59,00))');
   // Toss the billboard into the ad collection
adCollection.addWpniAd(billboard);

} 


else if ( thisNode == 'artsandliving')
{
// Specify location of HTML file containing billboard ad
billboard.setProperty(new WpniAdProperty('url','http://www.washingtonpost.com/wp-srv/javascript/common/ads/artsandliving_billboard.htm'));

// Specify condition[s] under which ad displays
billboard.setCondition('(now>new Date(2005,0,13,0,00,00)) &&(now<new Date(2005,0,15,23,59,00))');
   // Toss the billboard into the ad collection
adCollection.addWpniAd(billboard);

}

else if ( thisNode == 'cars')
{
// Specify location of HTML file containing billboard ad
billboard.setProperty(new WpniAdProperty('url','http://www.washingtonpost.com/wp-srv/javascript/common/ads/cars_billboard.htm'));

// Specify condition[s] under which ad displays
billboard.setCondition('(now>new Date(2005,2,1,0,00,00)) &&(now<new Date(2005,2,7,23,59,00))');
   // Toss the billboard into the ad collection
adCollection.addWpniAd(billboard);

}



 			else if ( thisNode == 'travel' )
  {
    // Specify location of HTML file containing billboard ad

	billboard.setProperty(new WpniAdProperty('url', 'http://www.washingtonpost.com/wp-srv/javascript/common/ads/travel_billboard.htm'));
    // Specify condition[s] under which ad displays
billboard.setCondition('( (now>new Date(2004,9,25,0,00,00)) &&(now<new Date(2004,9,31,23,59,00)) || (now>new Date(2004,10,1,0,00,00)) &&(now<new Date(2004,10,21,23,59,00)))');
	
	// Toss the billboard into the ad collection
    adCollection.addWpniAd(billboard);

	}



 			else if ( thisNode == 'travel/visitorguide' )
  {
    // Specify location of HTML file containing billboard ad

	billboard.setProperty(new WpniAdProperty('url', 'http://www.washingtonpost.com/wp-srv/javascript/common/ads/visitorguide_billboard.htm'));
    // Specify condition[s] under which ad displays
billboard.setCondition('(now>new Date(2004,10,14,0,00,00)) &&(now<new Date(2004,10,20,23,59,00))');
	
	// Toss the billboard into the ad collection
    adCollection.addWpniAd(billboard);

	}

 
 
// For any node not defined, squelch billboard and interstitial logic
  else
  {
    billboard.setCondition('false');
    interstitial.setCondition('false');
  }
  // Put billboard or interstitial on the page, si c'est possible 
  adCollection.placeAd('prepage');
  }
  
  // If billboard is going to be displayed, remove BANNER_TOP and SUPER_BANNER ads from adTemplate
/*if ( (top.location.search.indexOf("LOAD_PAGE") == -1) && ( billboard.meetsConditions() ) && ( typeof adTemplate != 'undefined' ) ) adTemplate = ( adTemplate & (~ ( BANNER_TOP | SUPER_BANNER ) ) )*/
