// If this x.htm is called with x.htm?c=bob+dylan&b=Vector&n=StarA&g=Random&s=svga&i=100
// then dbCinema will do a Google image search on 'bob dylan', will
// use a Vector type brush, the StarA nib, the Random geometry, will 
// download images larger than 800x600, and will download 100 images.
	
function writeObject() {
	var tDirectorQueryString = ""
	var	tMovie = "dbcinema07219"
	var	tMoviePath = tMovie + ".dcr"
	var a = document.location.href
	var b = a.indexOf("?")
	if (b > 0) {
		var c = a.substring(b+1)
		if (c.length > 0) {
			//c holds the entire parameter string except "?",
			//and c is not of length 0.
			var d = unescape(c)
			var e = d.replace(/\+/g, " ")
			//replaces + with a space
			var f = e.replace(/\\/g, "\\\\")
			//replaces \ with \\
			var g = f.replace(/'/g, "\\\'")
			//replaces ' with \'
			tDirectorQueryString = g.replace(/"/g, "\\\"")
			//replaces " with \"
		}
	}
	var tElement = document.getElementById("sw");
	var tHTML = '<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" '
	tHTML = tHTML + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,0,0,0" ' 
	tHTML = tHTML + 'ID=' + tMovie + ' width=100% height=100%> '
	tHTML = tHTML + '<param name=src value="' + tMoviePath + '"> '
	tHTML = tHTML + '<param name=swRemote value="swSaveEnabled='
	tHTML = tHTML + "'true' swVolume='true' swRestart='true' swPausePlay='true' swFastForward='true' swContextMenu='false'"
	tHTML = tHTML + ' "> '
	tHTML = tHTML + '<param name=swStretchStyle value=stage> '
	tHTML = tHTML + '<PARAM NAME=bgColor VALUE=#222222> '
	tHTML = tHTML + '<PARAM NAME=name VALUE="' + tMovie + '"> '
	tHTML = tHTML + "<PARAM NAME='sw1' VALUE='" + tDirectorQueryString + "'> "
	tHTML = tHTML + '<PARAM NAME=logo VALUE=FALSE> '
	tHTML = tHTML + '<PARAM NAME=swStretchHAlign VALUE=Left> '
	tHTML = tHTML + '<PARAM NAME=swStretchVAlign VALUE=Top>\n'
	tHTML = tHTML + '<embed src="' + tMoviePath + '" bgColor=#222222 name="' + tMovie + '" '
	tHTML = tHTML + 'swLiveConnect=TRUE logo=FALSE swStretchHAlign=Left swStretchVAlign=Top '
	tHTML = tHTML + "sw1='" + tDirectorQueryString + "' "
	tHTML = tHTML + 'width=100% height=100% swRemote="'
	tHTML = tHTML + "swSaveEnabled='true' swVolume='true' swRestart='true' swPausePlay='true' "
	tHTML = tHTML + "swFastForward='true' swContextMenu='false' " + '" '
	tHTML = tHTML + 'swStretchStyle=stage type="application/x-director" '
	tHTML = tHTML + 'pluginspage="http://www.macromedia.com/shockwave/download/"></embed>'
	tHTML = tHTML + '</object>'
	tElement.innerHTML = tHTML
}
