﻿function jsGetOSString()
{
	var ua=navigator.userAgent.toLowerCase();
	var av = navigator.appVersion.toLowerCase();
	var szOS="Unknown";
	if (ua.indexOf("win")!=-1)
	{
		if (ua.indexOf("nt 6.1")!=-1){return "Windows 7";}
		else if (ua.indexOf("nt 6.0")!=-1){return "Windows Vista";}
		else if (ua.indexOf("nt 5.2")!=-1){return "Windows XP/Server";}
		else if (ua.indexOf("nt 5.1")!=-1){return "Windows XP";}
		else {return "Pre Windows XP";}
	}
	if (av.indexOf("mac")!=-1) return "MacOS";
	if (av.indexOf("x11")!=-1) return "UNIX";
	if (av.indexOf("linux")!=-1) return "Linux";
	return "";
}

function jsEchoOSCompatString()
{
	var os = jsGetOSString();
	switch(os)
	{
		case "Windows 7":
		case "Windows Vista":
		case "Windows XP/Server":
		case "Windows XP":
		document.write("The operating system on this computer is " + os + " and will be able to run NewNovelist3!<br />");
		break;
		case "Pre Windows XP":
		document.write("The operating system on this computer is an early version of Windows and NewNovelist3 may have problems running on it.<br />");
		break;
		case "MacOS":
		document.write("This is a MAC computer and will only be able to run NewNovelist3 if you have a Windows emulator installed. NewNovelist3 is a Windows program and does not currently run on the MAC unassisted.<br />");
		break;
		case "UNIX":
		document.write("This is a UNIX computer and will only be able to run NewNovelist3 if you have a Windows emulator installed. NewNovelist3 is a Windows program and does not currently run on UNIX unassisted.<br />");
		break;
		case "Linux":
		document.write("This is a Linux computer and will only be able to run NewNovelist3 if you have a Windows emulator installed. NewNovelist3 is a Windows program and does not currently run on Linux unassisted.<br />");
		break;
		default:
		break;
	}

}	
