//////////////////////////////////////////////////
// global functions
(function(theScope){
theScope.globalScope = theScope;
}(this));
var xprint = function(/* any args */){
var id = "remark";
var rmk = document.getElementById(id);
if (rmk) {
rmk.style.height = "20ex";
rmk.innerHTML += [].join.call(arguments, '')
+ " ";
// scroll to the bottom:
rmk.scrollTop = rmk.scrollHeight;
}
}
function check_GCF(){
if (typeof CFInstall !== 'undefined') CFInstall.check({
mode: "overlay",
node: "trailer"
});
xprint("It may be that no Chrome Frame plugin is available",
" for this platform.");
}
// returns 1 if sane
// returns 0 if not sane
var graphic_sanity = function(){
if (!window.WebGLRenderingContext) {
// Browser has no idea what WebGL is. Suggest they
// get a new browser by presenting the user with link to
// http://get.webgl.org
xprint("Hmmm, it appears this machine has insufficient WebGL support.");
xprint('Visit http://get.webgl.org',
' for more information.');
/// 'or ',
/// 'http://get.webgl.org/troubleshooting',
if (typeof CFInstall !== 'undefined') {
xprint('Or click here to see if a',
' ',
' plugin is available.');
}
return 0;
}
return 1;
}
// bind an object method along with the context of
// a specific instance of the object
//
// see cb-obj.html for usage examples
function methRef(ctx, meth /*, args*/){
// Using [].slice.call is a standard idiom for converting
// arguments from a fake array to a real array:
var args = [].slice.call(arguments, 2); // skip the two named args
return (function(){ // create a closure
meth.apply(ctx, args);
})
}