shot_count=3;	// The number of pictures of the shop
	
function change_shop_shot() {
	shot_pick=Math.floor(Math.random()*shot_count)+2;
	document.write("<img src=\"./images/shop_"+shot_pick+".jpg\" alt=\"Inside the Wire Wheel\"  class=\"rightImage\" />");
}

// -- This section of code is to detect a flash plugin. Use VB script for MSIE Windows
// After all is said and done, call flashDetect=true to know what to do

function flashDetectPlugin() {
	if (document.URL.split('?')[1]=='flash=no') return false;
	for (i=0; i<navigator.plugins.length; i++)
		if (navigator.plugins[i].description.indexOf("Flash")>=0 && navigator.plugins[i].description.indexOf("Shockwave")>=0) return true;
	return false;
}

if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) {
    document.writeln('<script language="VBscript">');

    document.writeln('detectableWithVB = False');
    document.writeln('If ScriptEngineMajorVersion >= 2 then');
    document.writeln('  detectableWithVB = True');
    document.writeln('End If');

    document.writeln('Function detectActiveXControl(activeXControlName)');
    document.writeln('  on error resume next');
    document.writeln('  detectActiveXControl = False');
    document.writeln('  If detectableWithVB Then');
    document.writeln('     detectActiveXControl = IsObject(CreateObject(activeXControlName))');
    document.writeln('  End If');
    document.writeln('End Function');
    document.writeln('</scr' + 'ipt>');
}

function flashDetect() {
	if (navigator.plugins && navigator.plugins.length>0) { dett=flashDetectPlugin(); } else {
		if(detectableWithVB) { dett = detectActiveXControl('ShockwaveFlash.ShockwaveFlash.1'); }
	}
	return dett;
}

// -- END OF FLASH DETECTION CODE

function insertFlash() {
	if (flashDetect()) document.write('<object style="margin: 20px 100px" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="550" height="200" id="wirewheel car" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="wirewheel_car.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="wirewheel_car.swf" quality="high" bgcolor="#ffffff" width="550" height="200" name="wirewheel car" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
	else document.write('<img style="margin: 20px 100px" src="./images/wirewheel_car.gif" alt="Thanks, Jim!" />');
}
