$(document).ready(function(){
	// SALES NAV
	var salesNavArray = new Array();
	salesNavArray[0] = "<a href='http://www.fox.com/full-episodes/?affiliate=myfoxtallahassee'>FOX on Demand</a>";
	salesNavArray[1] = "<a href='/Global/category.asp?C=205725'>Contact Us</a>";
	
	var salesNav = "<div class='salesNav'>";
	for (var ii = 0; ii < salesNavArray.length; ii++){
		salesNav += salesNavArray[ii];
	}
	salesNav += "</div><div class='salesNavClear'></div>";

	$("#WNBranding").css({"position": "relative"});
	$("#WNBranding").append(salesNav);
	$(".salesNav a:first").css({"border-width": "0px", "padding-left": "5px"});
	$(".salesNav").css({ "position": "absolute", "z-index": "10", "top": ($("#WNBranding").height()-15)+"px", "left": "10px", "display": "block" });

	// HEADER STATION LINKS
	$("#WNBranding").append("<div id='headerInsert'><a class='headerlink' href='http://www.myfoxtallahassee.com' target='_blank'><img src='http://ftpcontent.worldnow.com/wtlh/custom/brand_fox49.png' /></a><a class='headerlink' href='http://www.thecwtally.com' target='_blank'><img src='http://ftpcontent.worldnow.com/wtlh/custom/brand_cw.png' /></a><a class='headerlink' href='http://www.metvnetwork.com/' target='_blank'><img src='http://ftpcontent.worldnow.com/wtlh/custom/brand_metv.png' /></a></div>");
	
	//QUICK SIGNUP HEADER
	$(".wnDVQuickForm .wnDSItems-standard:first").each(function(){
		$(this).find("h4").nextAll().wrapAll("<span class='wrap' />");
	});

	// MOVE IMAGE ABOVE HEADLINE
	$(".wnDS-20, .wnDVHeadlineBox, .wnDS-7, .wnDS-4, .wnDVNestedCategory, .wnDS22, .wnDVPromoBox").find(".wnDVSummary").each(function(){
		$(this).find(".wnImage").prependTo($(this));
	})
	
	// ADD MORE TOP HEADLINES
	if ($("#WNDS-18").length){
		$("#WNDS-18").prepend("<div class='wnDSHeader'><h3><span>More Top Headlines</span></h3></div>");
	}
	
	// ADD TOP VIDEOS
	if ($("#WNDS48").length){
		$("#WNDS48").prepend("<div class='wnDSHeader'><h3><span>Top Videos</span></h3></div>");
	}
	
	// REMOVE BOTTOM BANNER AD
	if($("#WNTSWBannerAd").length){
		if($("#WNTSWBannerAd").html().length == 0){
			$("#WNTSWBannerAd").hide();
		}
	}		
})
