/** Configuration for ad serving, set taxonomy values 
	Terms here are either regular blog term name or multimedia blog matching term in multi_ads_config.php
**/

MIAds.vars.site     = "mi.nao00";
MIAds.vars.taxonomy = "News/Opinion/Blogs";
MIAds.vars.section  = "Blogs: Welcome to N&O blogs";
MIAds.vars.stats    = {
    taxonomy:  "News|Opinion|Blogs||",
    channel:   "Blogs: Welcome to N&O blogs"
};

MIAds.blog_taxonomy = function(blog) {
    if (!blog) blog = { 'name':'', 'shortname':'', 'headline':''};

    var tax = 'News|Opinion|Blogs||';
    var sec = '';

    switch(blog['shortname']) {
	// matching "blog name" terms
	    case 'accnow':
	    case 'accnowlive':
	    case 'acc':
	        	tax = 'Sports|College|College||';
	        	sec = 'ACCNow';
			miyahoo.tax_id ="20361501";
	        	break;			
	    case 'statefair':
	    case 'statefair09':
			tax = 'News|Local|||';
			break;
	    case 'easternwake':
	    case "bullseye":
	    case 'orangechat':
	    case 'swakewire':
			tax = 'News|Local|||';
			miyahoo.tax_id ="20276501";
			break;
	    case 'bestblog':
	    case 'prepsnow' :
			tax = 'Sports|HighSchool|HighSchool||';
			miyahoo.tax_id ="20367001";
			break;
	    case 'blackwater':
			tax = 'News|National|||';
			miyahoo.tax_id ="20279001";
			break;
	    case 'crosstown':
			tax = 'News|Traffic|||';
			miyahoo.tax_id ="20285001";
			break;
	    case 'editor':
	        	tax = 'News|Opinion|Editorial||';
			miyahoo.tax_id ="20281501";
			break;
	    case 'food':
			tax = 'Entertainment|Dining|||';
			miyahoo.tax_id ="20261001";
			break;
	    case 'canes':
			tax = 'Sports|Hockey|Pro|NHL|';
			miyahoo.tax_id ="20369001";
			break;
	    case 'beat':
			tax = 'Entertainment|Music|Reviews||';
			miyahoo.tax_id ="20267001";
			break;
	    case 'grammar':
			tax = 'Lifestyle|PuzzlesGames|||';
			miyahoo.tax_id ="20262501";
			break;
	    case 'tv':
			tax = 'Entertainment|TV|||';
			miyahoo.tax_id ="20269001";
			break;
	    case 'unclecrizzle':
			tax = 'Entertainment||||';
			miyahoo.tax_id ="20258501";
			break;
	    case 'wakeed':
			tax = 'News|Local|Education||';
			miyahoo.tax_id ="20277001";
			sec = 'wakeed'
			break;
	    case 'wakewatch':
			tax = 'News|Local|GovtPolitics||'; 
			miyahoo.tax_id ="20277501";
			break;
	    case 'fashion' :
			tax = 'Lifestyle|Fashion|||';
			miyahoo.tax_id ="20428501";
			break;
	    case 'business' :
			tax = 'Business||||';
			miyahoo.tax_id ="20201501";
			break;
/*	    case 'outdoors':
			tax = 'Sports|Outdoors|||';
			miyahoo.tax_id ="20378001";
			break;
	    case 'notions':
			tax = 'Lifestyles|Home&Garden|||'; 
			miyahoo.tax_id ="20432501";
			break;
	    case 'olympics' :
			tax = 'Sports|Olympics|||';
			miyahoo.tax_id ="20373501";
			break;
	    case 'zane' :
			tax = 'Lifestyle||||';
			miyahoo.tax_id ="20422501";
			break;
*/

	// matching "tags" terms
	    case 'multi':
	    case 'local':
			tax = 'News|Local|||'
			miyahoo.tax_id ="20276501";
			break;		
	    case 'sports':
	    case 'tudor':
			tax = 'Sports||||';
			miyahoo.tax_id ="20354001";
			break;
	    case 'worldseries' :
			tax = 'Sports|Baseball|Pro|MLB|';
			miyahoo.tax_id ="20356001";
			break;
	    case 'soccer' :
			tax = 'Sports|Soccer|||';
			miyahoo.tax_id ="20382001";
			break;
	    case 'railhawks' :
			tax = 'Sports|Soccer|Pro|MLS|';
			miyahoo.tax_id ="20383501";
			break;
	    case 'football' :
			tax = 'Sports|Football|||';
			miyahoo.tax_id ="20364001";
			break;
	    case 'panthers' :
			tax = 'Sports|Football|Pro|NFL|';
			miyahoo.tax_id ="20366001";
			break;
	    case 'basketball' :
			tax = 'Sports|Basketball|||';
			miyahoo.tax_id ="20357001";
			break;
	    case 'bobcats' :
			tax = 'Sports|Basketball|Pro|NBA|';
			miyahoo.tax_id ="20358501";
			break;
	    case 'baseball' :
			tax = 'Sports|Baseball|||';
			miyahoo.tax_id ="2035450";
			break;
	    case 'bulls':
	    case 'mudcats':
			tax = 'Sports|Baseball|Pro|MLB|';
			miyahoo.tax_id ="20356001";
			break;
	    case 'lacrosse' :
			tax = 'Sports|Other|||';
			miyahoo.tax_id ="20375001";
			break;
	    case 'hockey' :
			tax = 'Sports|Hockey|||';
			miyahoo.tax_id ="20367501";
			break;
	    case 'nascar' :
			tax = 'Sports|AutoRacing|||';
			miyahoo.tax_id ="20370001";
			break;
	    case 'pro' :
			tax = 'Sports|Other|Pro||';
			miyahoo.tax_id ="20377001";
			break;
	    case 'wakeforest' :
	    case 'unc' :
	    case 'staug' :
	    case 'shaw' :
	    case 'ncsu' :
	    case 'nccu' :
	    case 'duke' :
	    case 'college' :
			tax = 'Sports|College|College||';
			miyahoo.tax_id ="20361501";
			break;
	    case 'national' :
			tax = 'News|National|||';
			miyahoo.tax_id ="20279001";
			break;
	    case 'food':
	    case 'health' :
			tax = 'Lifestyle|FoodCooking|||';
			miyahoo.tax_id ="20429001";
			break;
	    case 'homes' :
			tax = 'Lifestyle|HomeGarden|||';
			miyahoo.tax_id ="20432501";
			break;

	    case 'crime' :
			tax = 'News|State|||';
			miyahoo.tax_id ="20289001";
			break;
	    case 'politics' :
			tax = 'News|State|GovtPolitics||';
			miyahoo.tax_id ="20290001";
			break;
	    case 'weather' :
			tax = 'News|Weather|||';
			miyahoo.tax_id ="20416501";
			break;
	    case 'faith' :
			tax = 'Lifestyle|FaithValues|||';
			miyahoo.tax_id ="20426001";
			break;
	    case 'great8' :
			tax = 'Entertainment|Music|Reviews||';
			sec = 'GreatEight';
			miyahoo.tax_id ="20267001";
			break;



	    default:
			tax = 'News|Opinion|Blogs||';
			miyahoo.tax_id ="20281001";
			break;
    }

    this.blog = blog;
    
    this.vars.section = (sec == '') ? blog['name'] : sec;
    this.vars.stats.channel = this.vars.section;

    this.vars.stats.taxonomy = tax;

    // vars.taxonomy uses '/' not '|' and it shouldn't have
    // trailing, empty slots
    tax = tax.replace( /\|+$/, '' );
    tax = tax.replace( /\|/g, '/' );
    this.vars.taxonomy = tax;

    miyahoo.cstm_content_cat = blog['shortname'];

    // console.log('MIAds: '); console.dir(this);   // for debugging
};


