// insert the appropriate styles
styles = "<style type='text/css'>"
styles = styles + "#nNav { background: #444; color: #ddd; font-family: Arial,Tahoma,Verdana,Helvetica,sans-serif; font-size: 9px; line-height: 10px; font-weight: bold; height: auto; position: relative; overflow: hidden; text-shadow: #000 0 1px 3px; }";
styles = styles + "#nNav .bounds { width: 950px; margin: 0 auto; }"
styles = styles + "#nNav h1, #nNav p { margin: 0; float: left; font-size: 10px; font-weight: bold; padding: 0; color: #ddd; line-height: 20px; }"
styles = styles + "#nNav ul { margin: 0; padding: 0; float: right; list-style: none; }"
styles = styles + "#nNav li { float: left; margin: 0 0 0 10px; line-height: 20px; padding: 0; }"
styles = styles + "#nNav li.active { background: transparent url(http://d130lp4xfezgvc.cloudfront.net/network/bg_active.png) center bottom no-repeat; }"
styles = styles + "#nNav li.active a, #nNav p a { color: #ddd; }"
styles = styles + "#nNav a { color: #aaa; text-decoration: none; }"
styles = styles + "#nNav a:hover { color: #fff; text-decoration: none; }"
styles = styles + "</style>"
document.write(styles) ; 

// set up the network
ccnetwork = [
	{code:"CC", name: "CouponCabin", title: "Save with CouponCabin's free coupons, coupon codes &amp; deals.", link: "http://www.couponcabin.com?utm_source="+source+"&utm_medium=en&utm_campaign=network"},
	{code:"CM", name: "CouponMap", title: "Find Local Coupons in Your Area.", link: "http://www.couponmap.com?utm_source="+source+"&utm_medium=en&utm_campaign=network"},
	{code:"GG", name: "GoGrocery", title: "Free, printable coupons for groceries.", link: "http://www.gogrocery.com?utm_source="+source+"&utm_medium=en&utm_campaign=network"}
];

var list = document.createElement("ul");
list.className = "cfx"
list.setAttribute("id", "nNavList");
document.getElementById("nNavBounds").appendChild(list);

var html = "";
// loop to build the list
for (i = 0; i < ccnetwork.length; i++) {
	if (ccnetwork[i].code == source.toUpperCase()) {
		html = html + '<li id="e'+ ccnetwork[i].code +'" class="active">' 
	} else {
		html = html + '<li id="e'+ ccnetwork[i].code +'">' 	
	}
	html = html + '<a href="' + ccnetwork[i].link + '" title="' + ccnetwork[i].title +'">' + ccnetwork[i].name + '</a></li>';
}

// add it to the HTML
document.getElementById("nNavList").innerHTML = html;
