function findPlugin(pMimeType){navigator.plugins.refresh(false);var numPlugins = navigator.plugins.length;while(numPlugins--){var plugin = navigator.plugins[numPlugins];var numTypes = plugin.length;while(numTypes--){if (plugin[numTypes] && plugin[numTypes].type == pMimeType){return true;}}}return false;}

function htmlcontrol(id,style,src,asString,scroll){
	var sbar = 0;
	if(scroll){sbar=1;}
	if(src==null){src="about:blank";}
	str = "<objec"+"t tabindex='-1' id='"+id+"' classid='clsid:3E720452-B472-4954-B7AA-33069EB53906' style='"+style+"' tabindex='-1'><param name='ForeSrc' value='"+src+"'><param name='ForeVisible' value='1'><param name='DualBrowsers' value='0'><param name='EnableForeAutoScrollbars' value='"+sbar+"'></object>";
	if(asString){
		return str;
	}else{
		document.write(str);
	}
}
function chatcontrol(id){
	document.write(chatcontrolString(id));	
}
function chatcontrolString(id){
	return ('<objec'+'t id="'+id+'" width=0 height=0 border=0  tabindex="-1" CLASSID="CLSID:E79DFBCA-5697-4fbd-94E5-5B2A9C7C1612" CODEBASE="#Version=1,0,2,2"><PARAM NAME="Category" VALUE="Chat"><PARAM NAME="Capabilities" VALUE=0x14><PARAM NAME="SignOutDelay" VALUE="10"></OBJECT>');	
}

var datacontrol = function (id){};
if(window.ActiveXObject){
	datacontrol = function (id){document.write('<object id="'+id+'" CLASSID="clsid:25560540-9571-4D7B-9389-0F166788785A" style="display:none"></object>');}
}else{
	if (findPlugin("application/x-mws-mywebsearchplugin")){
		datacontrol = function (id){document.write("<embed id='"+id+"' name='DataControlZB' type='application/x-mws-mywebsearchplugin' ProgId='FunWebProducts.DataControl' style='width:0px;height:0px'></embed>");}
	}
}

function addScriptFor(id,ev,func){
	var sf = document.createElement("SCRIPT");
	sf.htmlFor = id;
	sf.event = ev;
	sf.language = "javascript";
	sf.text = func;
	document.body.appendChild(sf);
}
