// Detector script, version 1.0
// 01-10-02
// please always include the credits when using this file:
// Hot Pepper, Inc.
// www.hotpepper.com

var version = navigator.appVersion;
var app = navigator.appName;
var agent = navigator.userAgent;

if (version.substring(0,1) >= "4")// this checks for v4+ browsers, and protects v3 browsers from the RegExp() method
	{
	// Platform detector =====================================
	var mac = new RegExp("Mac");
	var mac = mac.exec(agent);
	var pc = new RegExp("Windows 98|Windows 95|Win98|Win95|WinNT|Windows NT|XP");
	var pc = pc.exec(agent);
	// /Platform detector =====================================

	// ie version detection
	var ie = new RegExp("MSIE \\d{1,2}");
	var ie =
	 ie.exec(agent)+"";var ie = ie.split(' ');
	if (ie[1] == 4) {var ie4 = "ie4"}
	else if (ie[1] > 4) {var ie5up = "ie5up"}

	// ns version detection
	if (app == "Netscape" && version.substring(0,1) == "4")
		{var ns4 = true}
	if (app == "Netscape" && version.substring(0,1) > "4")
		{var ns6up = true}

	// opera version detection
	var op = new RegExp("Opera \\d{1,2}");
	var op = op.exec(agent)+"";
	var op = op.split(' ');
	if (op[1] == 5) {var op5 = "op5"}
	else if (op[1] > 5) {var op6up = "op6up"}

	// DHTML feature detection =============
	var layers = false;
	var all = false;
	var DOM = false;
	
	if (document.layers)
		{
		layers = true;
		var ID="document.";
		var lp="";
		var style="";
		var rp="";
		}
	else if (document.all)
		{
		all = true;
		var ID = "document.all.";
		var lp="";
		var style = ".style";
		var rp="";
		}
	else if (document.getElementById)
		{
		DOM = true;
		var ID = "document.getElementById"
		var lp="('";
		var style = ".style";
		var rp="')";
		}
	// here is how it all fits together:
	//var myDiv = eval(ID+lp+"myDiv"+rp+style);
	// myDiv.top = 500;
	// myDiv.left = 500;
	// etc.
	
	// /DHTML feature detection ========================
	}
else
	{
	var ver3 = true;
	}
	
/*
Full list of usable variables:
	version
	app
	agent
	mac
	pc
	ie4
	ie5up
	ns4
	ns6up
	op5
	op6up
	layers
	all
	DOM
	ID
	lp
	rp
	style
	ver3
*/