function insertAfter(parent, node, referenceNode) {
	parent.insertBefore(node, referenceNode.nextSibling);
}


function print_search_ads(Query)
	{

			 var speed_block = document.createElement("section");

			 speed_block.setAttribute("id", "speeds_ads");
			 speed_block.setAttribute("class", "width-80");

			var aside = document.getElementById('left_bar');
			var myParent = document.getElementById('left_bar').parentNode;

			insertAfter(speed_block, aside);
			speed_block.innerHTML='  <h3> Sponsored links</h3> <a target="_blank" href="http://www.dl-provider.com/search/'+encodeURIComponent(Query)+'.html?aff.id=1063&aff.subid=20" rel="nofollow"><strong>'+Query+'</strong> [TRUSTED DOWNLOAD] </a><br />  <a target="_blank" href="http://www.dl-provider.com/search/'+encodeURIComponent(Query)+'.html?aff.id=1063&aff.subid=20" rel="nofollow"><strong>'+Query+'</strong>.full.rar </a>  <br /> <a target="_blank" href="http://www.dl-provider.com/search/'+encodeURIComponent(Query)+'.html?aff.id=1063&aff.subid=20" rel="nofollow"><strong>'+Query+'</strong> [NO WAIT] </a> '
	}


 //create function, it expects 2 values.
function insertAfter(newElement,targetElement) {
//target is what you want it to go after. Look for this elements parent.

	var parent = targetElement.parentNode;
	//if the parents lastchild is the targetElement...
	if(parent.lastchild == targetElement) {
	//add the newElement after the target element.
	parent.appendChild(newElement);
	} else {
	// else the target has siblings, insert the new element between the target and it's next sibling.
	parent.insertBefore(newElement, targetElement.nextSibling);
	}
}



function print_download_ads(FileName,FileWords)
{
	var download_ads = document.createElement("section");
	download_ads.setAttribute("id", "speeds_ads");
	download_ads.setAttribute("class", "width-100 push-2bottom");

	var h1 = document.getElementById("results-block");
	h1.appendChild( download_ads);

	document.getElementById('speeds_ads').innerHTML = ' <h3> Sponsored links</h3><p> <a target="_blank" href="http://www.dl-provider.com/search/'+encodeURIComponent(FileName)+'.html?aff.id=1063&aff.subid=21" rel="nofollow"><strong>'+FileName+'</strong> [TRUSTED DOWNLOAD] </a><br />  <a target="_blank" href="http://www.dl-provider.com/search/'+encodeURIComponent(FileName)+'.html?aff.id=1063&aff.subid=21" rel="nofollow"><strong>'+FileName+'</strong>.full.rar </a>  <br /> <a target="_blank" href="http://www.dl-provider.com/search/'+encodeURIComponent(FileName)+'.html?aff.id=1063&aff.subid=21" rel="nofollow">Download <strong>'+FileName+'</strong></a> </p>';


	}


