<!-- //

// get name of browser the visitor is using
var useragent = navigator.userAgent;
var bName = (useragent.indexOf('Opera') > -1) ? 'Opera' : navigator.appName;
var pos = useragent.indexOf('MSIE');
if (pos > -1) {
bVer = useragent.substring(pos + 5);
var pos = bVer.indexOf(';');
var bVer = bVer.substring(0,pos);
}
var pos = useragent.indexOf('Opera');
if (pos > -1) {
bVer = useragent.substring(pos + 6);
var pos = bVer.indexOf(' ');
var bVer = bVer.substring(0, pos);
}
if (bName == "Netscape") {
var bVer = useragent.substring(8);
var pos = bVer.indexOf(' ');
var bVer = bVer.substring(0, pos);
}
if (bName == "Netscape" && parseInt(navigator.appVersion) >= 5) {
var pos = useragent.lastIndexOf('/');
var bVer = useragent.substring(pos + 1);
}

// set all variables to FALSE
java = "FALSE";
cookies = "FALSE";
mediaplayer = "FALSE";
realplayer = "FALSE";
quicktime = "FALSE";

// detect if cookies are enabled
if (navigator.cookieEnabled) {cookies = "TRUE";}
else cookies = "FALSE";
agt = navigator.userAgent.toLowerCase();
ie = (agt.indexOf("msie") != -1);
ns = (navigator.appName.indexOf("Netscape") != -1);
opera = (agt.indexOf("opera") != -1);
konqueror = (agt.indexOf("konqueror") != -1);
win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
mac = (agt.indexOf("mac")!=-1);
oldnetscape = false;
oldopera = false;
opera_six = false;
opera_seven = false;
if (opera && bVer < 5)
oldopera = true;
if (ns && bVer < 5) 
oldnetscape = true;
if (opera && bVer >=6 && bVer < 7) 
opera_six = true;
if (opera && bVer >=7) 
opera_seven = true;

// get name of browser the visitor is using
navsoft = navigator.appName;

// set all variables to FALSE
java = "FALSE";
cookies = "FALSE";
mediaplayer = "FALSE";
realplayer = "FALSE";
quicktime = "FALSE";
pluginlist = "";

// detect if cookies are enabled
if (window.navigator.cookieEnabled) {cookies = "TRUE";}
else cookies = "FALSE";
if (ie && win) { 
	pluginlist = detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player"); 
}
if (opera) {
	nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
	pluginlist = detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows MediaA Player");
}
if (ns || !win) {
	nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].type.toLowerCase();
	pluginlist = detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows MediaA Player");
}

function detectIE(ClassID,name) 
{
result = false;
document.writeln('<SCRIPT LANGUAGE=VBScript>');
document.writeln('on error resume next');
document.writeln('If ScriptEngineMajorVersion >= 2 then');
document.writeln('result = False');
document.writeln('result = IsObject(CreateObject("' + ClassID + '"))');
document.writeln('If (err) then');
document.writeln('result = False');
document.writeln('End If');
document.writeln('Else');
document.writeln('result = False');
document.writeln('End If');
document.writeln('</SCRIPT>');
if (result) return name+','; else return '';
}

function detectNS(ClassID,name)
{
n = ""; 
if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n;
}

pluginlist += navigator.javaEnabled() ? "Java," : "";

if (pluginlist.length > 0) pluginlist =
pluginlist.substring(0,pluginlist.length-1);
//detect Windows Media Player
if (pluginlist.indexOf("Windows Media Player")!=-1) document.write('<meta HTTP-EQUIV="Refresh" CONTENT="0;URL=index_wmv.html">\n');
if (pluginlist.indexOf("Windows MediaA Player") !=-1) document.write('<meta HTTP-EQUIV="Refresh" CONTENT="0;URL=index_wmv.html">\n');
//detect QuickTime
if (pluginlist.indexOf("QuickTime")!=-1) document.write('<meta HTTP-EQUIV="Refresh" CONTENT="0;URL=index_qt.html">\n');
//detect RealPlayer
if (pluginlist.indexOf("RealPlayer")!=-1) document.write('<meta HTTP-EQUIV="Refresh" CONTENT="0;URL=index_rm.html">\n');
//detect Java
if (pluginlist.indexOf("Java")!=-1) java = "TRUE";

// document.write('<?php\n echo "KALAT!"\; "$wmvi='+mediaplayer+'\n"\; $qtti='+quicktime+'\n $rpi='+realplayer+'\n ?>\n');
// document.write('<form method="post" action="pages.php?class=project">\n
//		<input type="hidden" name="rpi" value='+realplayer+'>\n
//		<input type="hidden" name="wmvi" value='+mediaplayer+'>\n
//		<input type="hidden" name="qtti" value='+quicktime+'>\n
//		</form>\n');
// document.write('<meta HTTP-EQUIV="Refresh" CONTENT="0;URL=pages.php?class=project&realplayer='+realplayer+'">\n');

// -->
