function addOptionProvider() {
	window.external.AddSearchProvider("http://www.zoeken.nl/Addons/Includes/xml/zoeken_nl.xml");  
	closeOptionProvider();	
	return false;
}
function closeOptionProvider() {
	document.getElementById('addsearch').style.display = 'none';
	document.cookie = "zoeken_ie7top=hidden; expires=Thu, 2 Aug 2500 20:47:11 UTC; path=/; domain=.zoeken.nl;";
}

$(document).ready( function(){ 
	if (window.external && ("AddSearchProvider" in window.external)) {
		if (!window.external.IsSearchProviderInstalled('http://www.zoeken.nl/') && document.cookie.indexOf("zoeken_ie7top") == -1) {
			var pluginHTML = '<div id="addsearch">'
			+'<div style="background:url(http://images.zoeken.nl/v2/open_search_v2.png) no-repeat;font:12px arial;color:#005aab">'
			+'<a href="#" style="color:#005aab;text-decoration:none;display:block;cursor:pointer;height:32px;width:152px;padding:18px 10px 24px 15px;" onclick="addOptionProvider();n(this, \'searchplugin\'); return false;">'
			+'Voeg zoeken.nl toe aan<br />'
			+(BrowserDetect.browser == "Explorer" ? 'de Internet Explorer.' : 'de Firefox browser.');
			+'</a></div></div>';
			
			if ( $('#right').length ) {
				$('#right').append( pluginHTML );
				$('#addsearch').css( { margin: '16px auto 0 auto', width: '180px'  } );
			} else {
				$('body').prepend( pluginHTML );
				$('#addsearch').css( { position: 'absolute', top: '5px', right: '68px', width: '180px', display: 'block' } );
			}
		}
	}
});
