var detect=navigator.userAgent.toLowerCase();
var browser="";
var detectableWithVB=false;
var pluginFound=false;

function checkIt(string){
	place=detect.indexOf(string)+1;
	return place;
}
if(checkIt('msie')) 
	browser="IE";
function canDetectPlugins(){
	if(detectableWithVB || (navigator.plugins && navigator.plugins.length>0)){
		return true;
	}else return false;
}
function detectReal(){
	pluginFound=detectPlugin('RealPlayer');
	if(!pluginFound && detectableWithVB){
		pluginFound=(detectActiveXControl('rmocx.RealPlayer G2 Control') ||
			detectActiveXControl('RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)') ||
		    detectActiveXControl('RealVideo.RealVideo(tm) ActiveX Control (32-bit)'));
	}	
	return pluginFound;
}
function detectWindowsMedia(){
	pluginFound=detectPlugin('Windows Media Player');
	if(!pluginFound && detectableWithVB){
		pluginFound=detectActiveXControl('MediaPlayer.MediaPlayer.1');
	}
	return pluginFound;
}
function detectPlugin(){
	var daPlugins=detectPlugin.arguments;
	var pluginFound=false;
	if(navigator.plugins && navigator.plugins.length>0){
		var p=navigator.plugins.length;
		for(i=0;i<p;i++){
			var numFound=0;
			for(n=0;n<daPlugins.length;n++){
				if((navigator.plugins[i].name.indexOf(daPlugins[n])>=0) || 
					(navigator.plugins[i].description.indexOf(daPlugins[n])>=0)){
					numFound++;
				}
			}
			if(numFound==daPlugins.length){
				pluginFound=true;
				break;
			}
		}
	}
	return pluginFound;
} 
if((navigator.userAgent.indexOf('MSIE')!=-1) && (navigator.userAgent.indexOf('Win')!=-1)){
document.writeln('<script language="VBscript">');
document.writeln('detectableWithVB=False');
document.writeln('If ScriptEngineMajorVersion >= 2 then');
document.writeln('	detectableWithVB = True');
document.writeln('End If');
document.writeln('Function detectActiveXControl(activeXControlName)');
document.writeln('	on error resume next');
document.writeln('	detectActiveXControl=False');
document.writeln('	If detectableWithVB Then');
document.writeln('		detectActiveXControl = IsObject(CreateObject(activeXControlName))');
document.writeln('	End If');
document.writeln('End Function');
document.writeln('</scr' + 'ipt>');
}

