//	gnd-core.js
//	Code arranged by T.K.Egan - 15 Mar 2006
//	License: Public Domain
//		Use as you will but I'd appreciate an
//		email at tkegan@greenneondesign.com if 
//		you find a way to improve the code

//	addLoadEvent shamelessly copied from Simon Willison's weblog
//		(http://simon.incutio.com/archive/2004/05/26/addLoadEvent)
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

/**
 * Work-around the EOLAS lawsuit changes in IE by document.write'ing
 * an object tag at load time.
 *
 * @param src - the movie file to play either relative to the html file
 * 					using this code or absolute path
 * @param height - the height of the movie in px note 16px are added to accomidate the controller
 * @param width - the width of the movie in px
 * @param autoplay - the string "true" or "false"
 */
function embedQuicktimeMovie(src, height, width, autoplay) {
	document.writeln("<object classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\" width=\"" + width + "\" height=\"" + height + "\">");
	document.writeln("\t<param name=\"src\" value=\"" + src + "\" />");
	document.writeln("\t<param name=\"controller\" value=\"true\" />");
	document.writeln("\t<param name=\"autoplay\" value=\"" + autoplay + "\" />");
	document.writeln("\t<!--[if !IE]>-->");
	document.writeln("\t<object type=\"video/mp4\" data=\"" + src + "\" width=\"" + width + "\" height=\"" + (height + 16) + "\">");
	document.writeln("\t\t<param name=\"autoplay\" value=\"" + autoplay + "\" />");
	document.writeln("\t\t<param name=\"controller\" value=\"true\" />");
	document.writeln("\t</object>");
	document.writeln("\t<!--<![endif]-->");
	document.writeln("</object>");
}