// Ultimate client-side JavaScript client sniff. Version 3.03
// (C) Netscape Communications 1999-2001.  Permission granted to reuse and distribute.

 // convert all characters to lowercase to simplify testing
 var agt=navigator.userAgent.toLowerCase();

 // *** BROWSER VERSION ***
 var is_major = parseInt(navigator.appVersion);
 var is_minor = parseFloat(navigator.appVersion);

 var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
             && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
             && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
 var is_nav4 = (is_nav && (is_major == 4));
 var is_nav4up = (is_nav && (is_major >= 4));
 var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) ||
                       (agt.indexOf("; nav") != -1)) );
 var is_nav6 = (is_nav && (is_major == 5));
 var is_nav6up = (is_nav && (is_major >= 5));
 var is_gecko = (agt.indexOf('gecko') != -1);


 var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
 var is_ie3    = (is_ie && (is_major < 4));
 var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
 var is_ie4up  = (is_ie && (is_major >= 4));
 var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
 var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
 var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
 var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
 var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
 var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);

var is_safari = (agt.indexOf("safari") != -1);
var is_safari1up  = (is_safari && (is_major >= 1));

 var is_opera = (agt.indexOf("opera") != -1);
 var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
 var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
 var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
 var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
 var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);

 var is_webtv = (agt.indexOf("webtv") != -1); 

 // *** PLATFORM ***
 var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
 var is_mac    = (agt.indexOf("mac")!=-1);
 var is_macppc = (is_mac && ((agt.indexOf("ppc")!=-1) || 
                             (agt.indexOf("powerpc")!=-1)));

 var is_linux = (agt.indexOf("inux")!=-1);
 
//###################################
function acceptedBrowser(){
	if (is_win) {
		if (is_ie4up || is_nav6up || is_opera5up){return true;}
		else {return false;}
	}
	else if (is_mac){
		if (is_ie4up || is_nav6up || is_safari1up){return true;}
		else {return false;}
	}
	else {return false;}
}
//####################################
// BROWSER DETECTION

if (!acceptedBrowser()){redirect("err.html");}

function redirect(url){
	window.location.href = url;
}

//####################################

//***************************************************************************************************	
//###################################
//FLASH-Plugin-Version DETECTION

// code by Chris Nott (chris@NOSPAMdithered.com - remove NOSPAM)
// with VBScript code from Alastair Hamilton

var flashVersion = 0;
function getFlashVersion() {
	var agent = navigator.userAgent.toLowerCase(); 
   
	// NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		var flashPlugin = navigator.plugins['Shockwave Flash'];
		if (typeof flashPlugin == 'object') { 
			if (flashPlugin.description.indexOf('7.') != -1) flashVersion = 7;
			else if (flashPlugin.description.indexOf('6.') != -1) flashVersion = 6;
			else if (flashPlugin.description.indexOf('5.') != -1) flashVersion = 5;
			else if (flashPlugin.description.indexOf('4.') != -1) flashVersion = 4;
			else if (flashPlugin.description.indexOf('3.') != -1) flashVersion = 3;
		}
	}

	// IE4+ Win32:  attempt to create an ActiveX object using VBScript
	else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
	   document.write('<scr' + 'ipt language="VBScript"\> \n');
		document.write('on error resume next \n');
		document.write('dim obFlash \n');
		document.write('set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.7") \n');
		document.write('if IsObject(obFlash) then \n');
		document.write('flashVersion = 7 \n');
		document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.6") end if \n');
		document.write('if flashVersion < 7 and IsObject(obFlash) then \n');
		document.write('flashVersion = 6 \n');
		document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.5") end if \n');
		document.write('if flashVersion < 6 and IsObject(obFlash) then \n');
		document.write('flashVersion = 5 \n');
		document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.4") end if \n');
		document.write('if flashVersion < 5 and IsObject(obFlash) then \n');
		document.write('flashVersion = 4 \n');
		document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.3") end if \n');
		document.write('if flashVersion < 4 and IsObject(obFlash) then \n');
		document.write('flashVersion = 3 \n');
		document.write('end if');
		document.write('</scr' + 'ipt\> \n');
  }

	// Can't detect in all other cases
	else {
		flashVersion = flashVersion_DONTKNOW;
	}

	return flashVersion;
}

flashVersion_DONTKNOW = -1;
	
//###################################
//***************************************************************************************************	