(function(){
	// This call will overwrite the content match array.
	doSearch(KIDS.utils.getParameter('term'), null, null, 10);
	
})();

//Overwriting function in sponsored_links_lib.js
function loadOvertureSearchInclude(conf) {
	
  var rand = Math.round(Math.random() * 99999999);
	
  var url = createOvertureSearchLink(conf);
  
  printSrcInclude(url + "&cb=" + rand)
}

$(document).bind("content_match_loaded.", function(response) {
	KIDS.utils.doLog("Content Match Loaded: " + response.type);
	
	if(response.ads === null){
		$('div.yahoo-sponsored').hide();	
	}else{
		
		if(response.ads.filtered.length > 2 && response.ads.filtered.length < 6){
			
			displaySponsoredLinks(response.ads, "content-match-side", 2, 5, false);
			
			KIDS.ads.yahoo.initContentMatchUrls();
			
			$('div.yahoo-sponsored:first').hide();
			
		}else if(response.ads.filtered.length >= 6){
			
			displaySponsoredLinks(response.ads, "content-match-side", 2, 5, false);
			displaySponsoredLinks(response.ads, "content-match-top", 5, 8, false);
			
			KIDS.ads.yahoo.initContentMatchUrls();
			
		}else{
			$('div.yahoo-sponsored').hide();	
		}

	}
});



