function insertSocialTools(){
	var links = new Array();
	links[0] = "http://www.kusi.com/global/link.asp?L=104054&function=manageprofile&mode=create&referrer=http%3A//www.kusi.com/default.asp";
	links[1] = "http://twitter.com/kusi_news";
	links[2] = "http://www.facebook.com/#!/KUSITV?ref=search";
	links[3] = "http://www.kusi.com/category/197114/rss-feeds";
	
	var socialBlock = "<div id='socialToolbar'><span>Follow Us:</span>";
	socialBlock += "<span><a title='E-mail' href='" + links[0] + "'><img src='http://ftpcontent.worldnow.com/kusi/custom/email.gif' /></a></span>";
	socialBlock += "<span><a title='Twitter' href='" + links[1] + "'><img src='http://ftpcontent.worldnow.com/kusi/custom/twitter.gif' /></a></span>";
	socialBlock += "<span><a title='Facebook' href='" + links[2] + "'><img src='http://ftpcontent.worldnow.com/kusi/custom/facebook.gif' /></a></span>";
	socialBlock += "<span><a title='RSS' href='" + links[3] + "'><img src='http://ftpcontent.worldnow.com/kusi/custom/rss.gif' /></a></span>"
	socialBlock += "</div>"

	$(".wnDVNestedCategory").find(".wnDVSummary:last").css("border-bottom","none");
	$(".wnDVHeadlineBox").find(".wnDVSummary:last").css("border-bottom","none");	
	$(socialBlock).prependTo("#WNContainerMemberSearch-cols2345top").show();
	$("#WNContainerMemberSearch-cols2345top").append("<div style='clear:both;'></div>")
}

$("#WNCols234-5").ready(function(){
	insertSocialTools();
});

function insertCol1Weather(){
	var currentWx = $("#WNColsAll #WNCols234-5 #WNCols23-4 #WNCol23 #WNCol2 #WNDS11 .wnDSItems-feature");
	if ($(currentWx).find(".wnDVWxFullForecast").length){
		$("#WNColsAll #WNMenuCol1 #WNMenuCol1Top img").remove();		
		var col1wxInfo;
		col1wxInfo += "<div class='col1wx_bg'><div class='col1wx_info'>"
		col1wxInfo += "<div class='col1wx_title'><div class='col1wx_title_text'>Current Temp</div></div>"
		col1wxInfo += "<div class='col1wx_temp_info'>"
		col1wxInfo += "<div class='col1wx_icon_holder'><img class='col1wx_icon' src='" + $(currentWx).find(".wnDVWxFullForecast .wnWxPrimary .wnWxExtendedForecast .wnWxDay:first img").attr("src") + "' /></div>"
		col1wxInfo += "<div class='col1wx_temp'><div class='col1wx_temp_text'>" + parseInt($(currentWx).find(".wnDVWxFullForecast .wnWxPrimary .wnWxConditions ul li:first").text()) + "&deg;</div></div>"		
		col1wxInfo += "<div style='clear:both;'></div>"
		col1wxInfo += "</div>"
		/*col1wxInfo += "<div class='col1wx_forecast'><div class='col1wx_forecast_text'><span>Hi " + parseInt($(currentWx).find(".wnWxCurrentForecast ul .wnWxHigh").text()) + "&deg;</span> / Low <span>" + parseInt($(currentWx).find(".wnWxCurrentForecast ul .wnWxLow").text()) + "&deg;</span></div></div>"	*/
		col1wxInfo += "</div></div>"
		
		$(col1wxInfo).appendTo("#WNMenuCol1Top").show();
	    $("#WNMenuCol1Top").show();
		$(".col1wx_bg").mouseover(function(){
			$(this).css("cursor","pointer");
		});
		$(".col1wx_bg").click(function(){
			document.location = "/weather";
		});
	}
}
 
$("#WNCol2").ready(function(){
	insertCol1Weather();
});

//Breaking News
$(document).ready(function(){
	if($("#WNDS-30").length){
		var bn = "<div id='bnHeader'></div>";
		if($("#WNDS-30 .wnDVSummary h4 .wnVideoIncluded").length){
			$("#WNDS-30 .wnDVSummary h4 .wnVideoIncluded").replaceWith(" <img src='http://ftpcontent.worldnow.com/kusi/custom/vidIcon.gif' border='0' class='wnVideoIncluded'>");
		}	
		$(bn).prependTo($("#WNDS-30")).show();
	}
});

/* OPTIMUS V1 CODE */
//Breaking News
$(document).ready(function(){
	if($("#DisplaySizeId-30").length){
		var bn = "<div id='bnHeader'></div>";
		if($("#DisplaySizeId-30 .wn-icon-video-included").length){
			$("#DisplaySizeId-30 .wn-icon-video-included").replaceWith(" <img src='http://ftpcontent.worldnow.com/kusi/custom/vidIcon.gif' border='0' class='wn-icon-video-included'>");
		}	
		$(bn).prependTo($("#DisplaySizeId-30")).show();
	}
});


//Ad
$(document).ready(function(){
      $("#WNAd41").appendTo("#WNBranding");
      $("#WNAd41").show();
      $("#WNAd46").appendTo("#WNBranding");
      $("#WNAd46").show();
});

