/*
	Yahoo Ad Scripting
	Prepares for pulls
	This script should only included on a page that already has t_Section and t_Channel defined on the page.


	THIS IS THE TEST SCRIPT
*/

var ctxt_ad_interface = 'http://cm.npc-morris.overture.com/js_1_0/';
var ctxt_ad_config = '9472395290';
var ctxt_ad_url = location.href;
var ctxt_ad_id;
var ctxt_ad_type;
var ctxt_ad_tier = 2;
var ctxt_ad_width;
var ctxt_ad_height;
var ctxt_ad_oe = "utf8";

var ctxt_css_url = "http://chronicle.augusta.com/css/yahoo-ads/ads.css";
var ctxt_ad_bc = "CCCCCC";
var ctxt_ad_cc = "FFFFFF";
var ctxt_ad_uc = "808080";
var ctxt_ad_lc = "9e4f2c";
var ctxt_ad_tc = "000000";

var idx = ctxt_ad_url.indexOf( "?" );
if ( idx != -1 ) ctxt_ad_url = ctxt_ad_url.substr( 0, idx );
var idx = ctxt_ad_url.indexOf( "#" );
if ( idx != -1 ) ctxt_ad_url = ctxt_ad_url.substr( 0, idx );
var idx = ctxt_ad_url.lastIndexOf( "/" );
if ( idx == ctxt_ad_url.length - 1 ) ctxt_ad_url += "index.shtml";

if ( ctxt_ad_url.indexOf( "index.shtml" ) != -1 || ctxt_ad_url.indexOf( "index_jbg.shtml" ) != -1 ) {
	ctxt_ad_width = 250;
	ctxt_ad_height = 250;
	if ( navigator.appVersion.indexOf( "MSIE 6.0" ) != -1 )
		ctxt_css_url = "http://chronicle.augusta.com/css/yahoo-ads/ads2-ie.css";
	else 
		ctxt_css_url = "http://chronicle.augusta.com/css/yahoo-ads/ads2.css";
} else {
	ctxt_ad_width = 420;
	ctxt_ad_height = 150;
	if ( navigator.appVersion.indexOf( "MSIE 6.0" ) != -1 )
		ctxt_css_url = "http://chronicle.augusta.com/css/yahoo-ads/ads-ie.css";
}

if ( t_Channel == "News" ) {
	if ( t_Section == "Metro" || t_Section == "Aiken" || t_Section == "Mational" || t_Section == "Politics" || t_Section == "World" || t_Section == "" || t_Section == "LatestNews" ) {
		ctxt_ad_id = 'news';
		ctxt_ad_type = 'news';
	} else if ( t_Section == "Obits" ) {
		ctxt_ad_id = 'obits';
		ctxt_ad_type = 'obits';
	} else {
		ctxt_ad_id = 'misc';
		ctxt_ad_type = 'misc';
	}
} else if ( t_Channel == 'Business' ) {
	ctxt_ad_tier = 1;
	if ( t_Section == 'Technology' ) {
		ctxt_ad_id = 'tech';
		ctxt_ad_type = 'tech';
	} else if ( t_Section == 'FinancialMarkets' || t_Section == 'PersonalFinance' ) {
		ctxt_ad_id = 'finance';
		ctxt_ad_type = 'finance';
	} else {
		ctxt_ad_id = 'business';
		ctxt_ad_type = 'business';
	}
} else if ( t_Channel == 'Entertainment' ) {
	ctxt_ad_id = 'entertainment';
	ctxt_ad_type = 'entertainment';
	ctxt_ad_tier = 1;
} else if ( t_Channel == 'Living' ) {
	if ( t_Section == 'Births' ) {
		ctxt_ad_id = 'announements';
		ctxt_ad_type = 'announements';
	} else {
		ctxt_ad_id = 'lifestyle';
		ctxt_ad_type = 'lifestyle';
		ctxt_ad_tier = 1;
	}
} else if ( t_Channel == 'Marketplace' ) {
	ctxt_ad_id = 'classifieds_tier_2';
	ctxt_ad_type = 'classifieds_tier_2';
} else if ( t_Channel == 'Opinion' ) {
	ctxt_ad_id = 'opinion';
	ctxt_ad_type = 'opinion';
} else if ( t_Channel == 'Sports' ) {
	ctxt_ad_id = 'sports';
	ctxt_ad_type = 'sports';
} else {
	ctxt_ad_id = 'misc';
	ctxt_ad_type = 'misc';
}

//Ad Tier
//Marked as test
var ctxt_ad_source = 'npc_morris_augustachronicle_t' + ctxt_ad_tier + '_ctxt';

var showAds = true;	

function showYahooAd() {
	if ( showAds ) {
		if ( ctxt_ad_url.indexOf( "index.shtml" ) != -1 || ctxt_ad_url.indexOf( "index_jbg.shtml" ) != -1 ) {
			document.write( '<br />' );
			document.write( '<div align="center" style="position: relative; left: -3px;">' );
			document.write( '<div style="color: #898989; font-family: arial; font-size: 12px; text-align: center; padding-bottom: 3px;">advertisement</div>' );
			document.write( '<script type="text/javascript" src="http://cm.npc-morris.overture.com/partner/js/ypn.js"></script>' );
			document.write( '</div>' );
		} else {
//			document.write( '<div style="margin:18px 0px 3px 16px; padding-top: 18px; background-image: url(/images/v4.5/story/hrule_dot1.gif); background-repeat: repeat-x; background-position: 0 top; font-size: 15px; font-weight: bold; color: #000;"></div><div style="margin-left: 15px; padding-bottom: 6px">' );
			document.write( '<script type="text/javascript" src="http://cm.npc-morris.overture.com/partner/js/ypn.js"></script>' );
		}
	}
}
