home *** CD-ROM | disk | FTP | other *** search
-
- <!-- 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 -->
-
-