function addOptionProvider() {
	window.external.AddSearchProvider("http://www.zapmeta.de/Addons/Includes/xml/zapmeta_de.xml");
	closeOptionProvider();
	return false;
}
function closeOptionProvider() {
	document.getElementById('addsearch').style.display = 'none';
	document.cookie = "zapmeta_ie7top=hidden; expires=Thu, 2 Aug 2500 20:47:11 UTC; path=/; domain=.zapmeta.de;";
}

$(document).ready( function() {
	if (window.external && ("AddSearchProvider" in window.external)) {
		if (!window.external.IsSearchProviderInstalled('http://www.zapmeta.de/') && document.cookie.indexOf("zapmeta_ie7top") == -1) {
			var pluginHTML = '<div id="addsearch">'
			+'<div style="background:url(http://images.zapmeta.de/v2/opensearch_zapmeta.png) no-repeat;font:12px arial;color:#005aab">'
			+'<a href="#" style="color:#FFFFFF;text-decoration:none;display:block;cursor:pointer;height:93px;width:208px;padding:18px 10px 24px 15px;font-weight:bolder;" onclick="addOptionProvider(); return false;">'
			+'F&uuml;gen sie ZapMeta<br /> '
			+(BrowserDetect.browser == "Explorer" ? 'Ihrem Internet<br />Explorer hinzu.' : 'Ihrem Firefox<br />browser hinzu.');
			+'</a></div></div>';
			
			if ( $('#right').length ) {
				$('#right').append( pluginHTML );
				$('#addsearch').css( { margin: '16px auto 0 auto', width: '208px'  } );
			} else {
				$('body').prepend( pluginHTML );
				$('#addsearch').css( { position: 'absolute', top: '5px', right: '40px', width: '208px', display: 'block' } );
			}
		}
	}
} );	

