
function checkPlugin()
{
	if (BrowserDetect.browser == "Firefox")
	{
		addPlugin();

	}
	else if (BrowserDetect.browser == "Explorer" && BrowserDetect.version == 7)
	{
		addPluginIE();

	}
	
}

function addPlugin()
{

	window.external.AddSearchProvider("http://www.lyricsface.com/lyricsface.xml");

} // addPlugin

function addPluginIE()
{
var strName = "LyricsFace Free Lyrics Search";
var strURI = "http://www.lyricsface.com/tags/TEST.html";

strName = strName.replace (/^\s+|\s+$/g,'');
strURI = strURI.replace (/^\s+|\s+$/g,'');
var strEncoding = "UTF-8";

if (strURI.length<1) { alert ("Please enter the URL of the search results page."); document.getElementById("sURI").focus(); return false;}
if (strURI.indexOf("TEST")<0) { alert ("The search results URL must contain the word TEST.  Please check the URL.\nIt's possible that this tool cannot be used to build a query for that search engine."); document.getElementById("sURI").focus(); return false;}
if (strName.length<1) { alert ("Please enter a NAME for the new search provider"); document.getElementById("sName").focus(); return false;}


var strQuery = "Encoding="+ encodeURIComponent(strEncoding) + "&Name=" + encodeURIComponent(strName) + "&URI="  + encodeURIComponent(strURI);

var strAddURI = "http://www.microsoft.com/windows/ie/searchguide/spbuilder.mspx?" + strQuery;
//alert(strAddURI);


try{

                window.external.AddSearchProvider(strAddURI);

}

catch(eX){

                if (70 == (eX.number & 0xFFFF)){

                                alert("For security reasons, you must use the mouse\n(or the Enter key) to click the Install button.");

                }

                else

                {

                                alert("Unable to add search provider. The Create Your\nOwn tool requires Internet Explorer 7.   [" + (eX.number & 0xFFFF) + "]");

                }

}

return false;

} // addPluginIE