'PAR_DOC_BEGIN
'PAR_DOC_END
'PAR_JS_COMMON
'PAR_THING_TAGS
'PAR_PREVIEW_GIF_WLINK
'PAR_JS_PREVIEW_GIF_WLINK
'PAR_PREVIEW_GIF_WOLINK
'PAR_JS_PREVIEW_GIF_WOLINK
'PAR_OBJECT_TAG
'PAR_EMBED_TAG
'PAR_JS_NO_PI
'PAR_DOC_STRUCTURE
'
[PAR_DOC_BEGIN]
'*************************************************************************
'* This is the standard HTML document opening tag set
'*************************************************************************
<!-- Generated by Parable ThingMaker : tag begin -->
<html>
<head>
<title>ThingMaker</title>
</head>
<body bgcolor="##BGCOLOR##">
'
[PAR_DOC_END]
'*************************************************************************
'* This is the standard HTML document close tag set
'*************************************************************************
</body>
</html>

<!-- Generated by Parable ThingMaker : tag end -->
'
[PAR_JS_COMMON]
'*************************************************************************
'* This is common JavaScript that supports putting a Thing on a page.
'*************************************************************************

<!-- BEGIN JAVASCRIPT BROWSER DETECT PROCEDURES -->
<!-- Place this section once into HTML file in the start of the BODY section -->

<script language="JavaScript">
<!-- begin hiding

//** determines whether browser is netscape
function IsNetscape()
{
	return (navigator.appName.indexOf("Netscape") >= 0) ? true : false;
}

//** determines whether browser is msie
//** msie 3.02 under NT has blank navigator.appName
function IsMSIE()
{
	if (!navigator.appName)
		return true;
	return (navigator.appName.indexOf("Microsoft") >= 0) ? true : false;
}

//** determines whether this is a TM friendly browser
function IsCompatBrowser()
{
	return (IsNetscape() || IsMSIE()) ? true : false;
}

//** determines whether this is a compatible version of the browser
//** msie 3.02 under NT has blank navigator.appVersion
function IsCompatVersion()
{
	var bRet;

	if (IsNetscape())
	{
		major_ver = navigator.appVersion.substring(0,1)
		bRet = (major_ver >= 3) ? true : false;
	}
	else if (IsMSIE())
	{
		if (!navigator.appVersion)
			return true;
		major_ver = navigator.appVersion.substring(0,1)
		bRet = (major_ver >= 2) ? true : false;
	}
	else
	{
		bRet = false;
	}

	return bRet;
}

//** determines whether this is a compatible OS
//** msie 3.02 under NT has blank navigator.appVersion
function IsCompatOS()
{
	var bRet;

	if (IsNetscape())
	{
		bRet = (navigator.appVersion.indexOf("WinNT") >= 0 || navigator.appVersion.indexOf("Win95") >= 0) ? true : false;
	}
	else if (IsMSIE())
	{
		if (!navigator.appVersion)
			return true;
		bRet = (navigator.appVersion.indexOf("Windows NT") >= 0 || navigator.appVersion.indexOf("Windows 95") >= 0 || navigator.appVersion.indexOf("Windows 98") >=0) ? true : false;

	}
	else
	{
		bRet = false;
	}
	return bRet;
}

//**  determines whether the current run-time environment is TM friendly
function IsTMAble()
{
	// check for write browser, version, platform
	return (IsCompatBrowser() && IsCompatVersion() && IsCompatOS()) ? true : false;
}

//** determines whether the browser prefers plug-ins
function UsePI()
{
	var ret;

	if (IsNetscape())
	{
		// is this a plug-in capable version?
		major_ver = navigator.appVersion.substring(0,1)
		if (major_ver >= 3)
		{
			ret = true
		}
		else
		{
			ret = false
		}
	}
	else
	{
		ret = false;
	}
	return ret;
}

//** determines whether the TM plug-in is installed
function FindPI()
{
	var ret;

	if (IsNetscape())
	{
		major_ver = navigator.appVersion.substring(0,1)
		if (major_ver > 2)
		{
			ret = (navigator.plugins["Parable ThingViewer"]) ? true : false;
		}
		else
		{
			ret = -1
		}
	}
	else
	{
		ret = false;
	}
	return ret;
}

//** determines whether the browser prefers ActiveX
function UseX()
{
	var ret;

	if (IsMSIE())
	{
		ret = true;
	}
	else
	{
		ret = false;
	}
	return ret;
}

//** use this function to output a Thing into a document
function WriteTM(vURL,vImgSrc,vThingName,vSceneFile,vWidth,vHeight,vBgColor)
{
	// verify that this is a ThingMaker able platform
	if (!IsTMAble())
	{
		// this platform is not supported by TM
		if (vURL.length > 0)
		{
			document.writeln('<A HREF="' + vURL + '">')
			document.writeln('<img src="' + vImgSrc + '" Alt="This is a still image of a Parable Thing">')
			document.writeln('</A>')
		}
		else
		{
			document.writeln('<img src="' + vImgSrc + '" Alt="This is a still image of a Parable Thing">')
		}
	}
	else
	{
		// this platform is supported by TM
		if (UsePI())
		{
			// this is a plug-in preferred platform
			document.writeln('<EMBED type= application/x-Parable-Thing');
			document.writeln('SceneFile="' + vSceneFile + '"');
			document.writeln('width=' + vWidth + ' height=' + vHeight + ' bgcolor=' + vBgColor);
			document.writeln('pluginspage="##PLUGINSPACE##"');
			document.writeln('name="' + vThingName + '">');

			if (FindPI() == false)
			{
				// if we are here, the TM PI is not installed
%%PAR_JS_NO_PI%%
			}
		}
		else if (UseX())
		{
			// this is an activex preferred platform
			document.writeln('<object id="' + vThingName + '"');
			document.writeln('name="' + vThingName + '"');
			document.writeln('classid="##CLASSID##"');
			document.writeln('codebase="##CODEBASE##"');
			document.writeln('width=' + vWidth + ' height=' + vHeight + '>');
			document.writeln('<param name="SceneFile" value="' + vSceneFile + '">');
			document.writeln('<param name="bgcolor" value="' + vBgColor + '">');
			document.writeln('</object>');
		}
	}
}
// end hiding -->
</script>
<!-- END JAVASCRIPT BROWSER DETECT PROCEDURES -->

'
[PAR_THING_TAGS]
'*************************************************************************
'* These tags actually include a Thing, or a preview image, in a page.
'*************************************************************************
<!-- BEGIN THING TAGS -->
<script language="JavaScript">
<!-- if there is JS, this is how the Thing is created -->
<!-- begin hiding
	WriteTM("##HREF##","##IMGSRC##","##THINGNAME##","##SCENEFILE##",##WIDTH##,##HEIGHT##, "##BGCOLOR##")
// end hiding -->
</SCRIPT>

<NOSCRIPT>
<!-- if there is no JS, this is how the Thing is created -->
<object id="##THINGNAME##"
		name="##THINGNAME##"
		classid="##CLASSID##"
		codebase="##CODEBASE##"
		width=##WIDTH## height=##HEIGHT##>
		<param name="SceneFile" value="##SCENEFILE##">
		<param name="bgcolor" value="##BGCOLOR##">
<EMBED 	type= application/x-Parable-Thing
		SceneFile="##SCENEFILE##"
		width=##WIDTH## height=##HEIGHT## bgcolor="##BGCOLOR##"
		pluginspage="##PLUGINSPACE##"
		name="##THINGNAME##">
</object>
<NOEMBED>
<!-- if we are here there is no plug-in support -->
%%PAR_PREVIEW_GIF%%
</NOEMBED>
</NOSCRIPT>
<!-- END THING TAGS -->
'
[PAR_PREVIEW_GIF_WLINK]
'*************************************************************************
'* This includes a preview image with a link on a page.
'*************************************************************************
	<A HREF="##HREF##">
	<img src="##IMGSRC##" Alt="This is a still image of a Parable Thing">
	</A>
'
[PAR_JS_PREVIEW_GIF_WLINK]
'*************************************************************************
'* This JS includes a preview image with a link on a page.
'*************************************************************************
		document.writeln('<A HREF="##HREF##">')
		document.writeln('<img src="##IMGSRC##" Alt="This is a still image of a Parable Thing">')
		document.writeln('</A>')
'
[PAR_PREVIEW_GIF_WOLINK]
'*************************************************************************
'* This includes a preview image on a page.
'*************************************************************************
	<img src="##IMGSRC##" Alt="This is a still image of a Parable Thing">
'
[PAR_JS_PREVIEW_GIF_WOLINK]
'*************************************************************************
'* This JS includes a preview image on a page.
'*************************************************************************
		document.writeln('<img src="##IMGSRC##" Alt="This is a still image of a Parable Thing">')
'
[PAR_OBJECT_TAG]
'*************************************************************************
'* This includes the ActiveX control on a page.
'*************************************************************************
<object id="##THINGNAME##"
		name="##THINGNAME##"
		classid="##CLASSID##"
		codebase="##CODEBASE##"
		width=##WIDTH## height=##HEIGHT##>
		<param name="SceneFile" value="##SCENEFILE##">
		<param name="bgcolor" value="##BGCOLOR##">
'
[PAR_EMBED_TAG]
'*************************************************************************
'* This includes the plug-in on a page.
'*************************************************************************
<EMBED 	type= application/x-Parable-Thing
		SceneFile="##SCENEFILE##"
		width=##WIDTH## height=##HEIGHT## bgcolor="##BGCOLOR##"
		pluginspage="##PLUGINSPACE##"
		name="##THINGNAME##">
'
[PAR_PREVIEW]
'*************************************************************************
'* This includes the HTML for GIF preview
'*************************************************************************
<NOEMBED>
<!-- if we are here there is no plug-in support -->
%%PAR_PREVIEW_GIF%%
</NOEMBED>
[PAR_MINIMAL]
'*************************************************************************
'* This includes the OBJECT and EMBED tags only
'*************************************************************************
<object id="##THINGNAME##"
		name="##THINGNAME##"
		classid="##CLASSID##"
		codebase="##CODEBASE##"
		width=##WIDTH## height=##HEIGHT##>
		<param name="SceneFile" value="##SCENEFILE##">
		<param name="bgcolor" value="##BGCOLOR##">
<EMBED 	type= application/x-Parable-Thing
		SceneFile="##SCENEFILE##"
		width=##WIDTH## height=##HEIGHT## bgcolor="##BGCOLOR##"
		pluginspage="##PLUGINSPACE##"
		name="##THINGNAME##">
</object>
'
[PAR_JS_SET_URL]
<!-- This JAVASCRIPT block is only needed if locking to a URL is used. -->
<!-- It may be deleted if locking to a URL is not in use by any Things on the page.-->
<script language=JavaScript>
//** The function is called if the browser is Netscape Navigator 3.03 or 3.04
	if (navigator.appName.indexOf("Netscape") >= 0)
	{
		major_ver = parseInt(navigator.appVersion.substring(0,1))
		minor_ver = parseInt(navigator.appVersion.substring(2,4))
		if (major_ver == 3 && minor_ver >= 3)
			document.##THINGNAME##.setSceneFile("")
	}
</script>

'
[PAR_JS_NO_PI]
				<!-- replace -->
'
[PAR_DOC_STRUCTURE]
'*************************************************************************
'* This is how the HTML document is built - reserved.
'*************************************************************************
%%PAR_DOC_BEGIN%%
%%PAR_JS_COMMON%%
%%PAR_THING_TAGS%%
%%PAR_DOC_END%%
