var agent = navigator.userAgent;
var appver = navigator.appVersion;

var nav = navigator.appName;
var plf = null;
var ver = null;

if(agent.indexOf('Mac') != -1){
	plf = "Mac";
}else if(agent.indexOf('Win') != -1){
	plf = "Win";
}else{
	plf = "other";
}

if(agent.indexOf('MSIE') == -1){
	ver = appver.substring(0,4);
	if(nav == "Netscape"){
		nav = "NN";
	}
}else{
	ver = agent.substring((agent.indexOf('MSIE') + 5), (agent.indexOf('MSIE') + 9));
	nav = "MSIE";
}

if(ver.indexOf(';') != -1 || ver.indexOf(' ') != -1){
	ver = ver.substring(0,3);
}


/*
plf -> Platform	("win","mac","other")	string
nav -> Browser	("NN","MSIE","~")	string
ver -> Version	The numerical value to the third place of a decimal

It is effective at NN3 and IE4 and the higher version.
In order to distinguish the lower version, you'd better check whether the variable of a return value is set up or not.
It's sorry but you cannot distinguish whether it is NN2 or IE3.
*/
