adsonar_pid = 305760;
adsonar_zw = 160;
adsonar_zh = 600;
adsonar_jv= "ads.adsonar.com";

adsonar_ps = null;
qasd_why = "160x600";

winloc = window.location.toString();

// use omniture s_channel to determine what and where i am
if(typeof window.qasd_ww == "undefined" && typeof window.s_channel != "undefined"){
	qasd_what = null;
	qasd_where = null;

// WHAT AM I? // determine whether this page is an article or an index
	if(s_channel.indexOf("Stories") != -1)
		qasd_what = "article"; // siteweaver identified article
	if(s_channel.indexOf("Index") != -1)
		qasd_what = "index"; // siteweaver identified index
	if(qasd_what == null && (winloc.charAt(winloc.length - 1) == "/" || winloc.indexOf("/index.") != -1))
		qasd_what = "index"; // static index
	if(qasd_what == null && winloc.indexOf("?") == -1)
		qasd_what = "article"; // non-query (static) pages that are not index
	if(qasd_what == null && winloc.indexOf("calendar.cjonline.com") != -1)
		qasd_what = "article";

// WHERE AM I? // determine which section this page is in
	if(s_channel.indexOf("News") != -1)
		qasd_where = "news";
	if(s_channel.indexOf("Entertainment") != -1)
		qasd_where = "entertainment"; // don't need to know entertainment for qas_core_rail.js
	if(s_channel.indexOf("Sports") != -1)
		qasd_where = "sports";
	if(s_channel.indexOf("Business") != -1)
		qasd_where = "business";
	if(s_channel.indexOf("Features") != -1)
		qasd_where = "features";
	if(s_channel.indexOf("Celebrations") != -1){
		qasd_where = "celebrations"; qasd_what = "article";
	}
	if(s_channel.indexOf("AP") != -1)
		qasd_where = "ap";
	if(s_channel == "CJOnline:FrontPage")
		qasd_where = "homepage"; // don't need to know homepage for qas_core_rail.js
	if(s_channel.toLowerCase().indexOf("prepzone") != -1){
		qasd_where = "prepzone"; qasd_what = "article";
	}
	if(s_channel.toLowerCase().indexOf("catzone") != -1){
		qasd_where = "catzone"; qasd_what = "article";
	}
	if(s_channel.toLowerCase().indexOf("hawkzone") != -1){
		qasd_where = "hawkzone"; qasd_what = "article";
	}
	if(s_channel == "CJOnline:DailyArchive")
		qasd_where = "news";

	// classifieds
	if(s_channel.indexOf("Classifieds") != -1){
		qasd_where = "classifieds";
		if(winloc.indexOf("classifieds-bin") != -1)
			qasd_what = "article";
		else
			qasd_what = "index";
	}
	
	// entertainment front has a different zh (300) than other 160x600 positions
	if(qasd_where == "entertainment" && s_channel == "CJOnline:Entertainment")
		qasd_what = "front";
	
	// 60miles uses a different 160x600
	if(s_channel.indexOf("60") != -1)
		qasd_where = "60miles";
	
	if(qasd_where != null && qasd_what != null) qasd_ww = qasd_where + "|" + qasd_what;
	else qasd_ww = null;
}

// this code will only include adsonar_ps combinations appropriate for THIS position
// qas_core_rightrail = 160x600 under MaxAd (articles and indexes)
// qas_core_storyfoot = 480x276 above copyright (articles ONLY)
if(typeof window.qasd_ww != "undefined" && qasd_ww != null){
	switch(qasd_ww){
		case "news|index": adsonar_pid = 305760; adsonar_ps = 736669; break;
		case "news|article": adsonar_pid = 305760; adsonar_ps = 735667; break;
		case "business|index": adsonar_pid = 305763; adsonar_ps = 736672; break;
		case "business|article": adsonar_pid = 305763; adsonar_ps = 736671; break;
		case "sports|index": adsonar_pid = 305757; adsonar_ps = 736674; break;
		case "sports|article": adsonar_pid = 305757; adsonar_ps = 735671; break;
		case "features|index": adsonar_pid = 306757; adsonar_ps = 736670; break;
		case "features|article": adsonar_pid = 306757; adsonar_ps = 735669; break;
		case "60miles|index": adsonar_pid = 306757; adsonar_ps = 805667; break;
		case "60miles|article": adsonar_pid = 306757; adsonar_ps = 805667; break;
		case "entertainment|front": adsonar_pid = 305761; adsonar_ps = 735672; adsonar_zh = 300; break;
		case "entertainment|index": adsonar_pid = 305761; adsonar_ps = 735672; adsonar_zh = 300; break;
		case "entertainment|article": adsonar_pid = 305761; adsonar_ps = 736675; break;
		case "classifieds|index": adsonar_pid = 305758; adsonar_ps = 784668; break;
		case "classifieds|article": adsonar_pid = 305758; adsonar_ps = 785670; break;
		case "ap|index": adsonar_pid = 305760; adsonar_ps = 789684; break;
		case "ap|article": adsonar_pid = 305760; adsonar_ps = 791666; break;
		case "prepzone|article": adsonar_pid = 305757; adsonar_ps = 878667; break;
		case "catzone|article": adsonar_pid = 305757; adsonar_ps = 878669; break;
		case "hawkzone|article": adsonar_pid = 305757; adsonar_ps = 878671; break;
		case "celebrations|article": adsonar_pid = 305764; adsonar_ps = 878673; break;
		default: break;
	}
}

if(typeof window.qasd_report == "undefined") qasd_report = "";
qasd_report += "\n\n" + qasd_why;
if(adsonar_ps != null)
	qasd_report += "\nhere i am: " + (qasd_ww.split("|").join(", ")) + " - and i will deliver ads now.\nadsonar_pid = " + adsonar_pid + "\nadsonar_ps = " + adsonar_ps;
else qasd_report += "\ni do not know where i am" + (qasd_what?("\nqasd_what = " + qasd_what):"") + (qasd_where?("\nqasd_where = " + qasd_where):"");

if(adsonar_ps != null){
	document.write("<scr" + "ipt type=\'text\/javascript\' src=\'http://js.adsonar.com/js/adsonar.js\'><\/scr" + "ipt>");
}

