/* Slideshow markup generation
************************************************/
var flashfile = "/flash/slideshow.swf?delay=" + (delay ? delay : 4) + "&folder=" + (folder ? folder : "");
var alternative = "";
var minFlashVer	= 6;
var wmode = "window";
var plugin = 0;

function trace(str) {
	document.write(str);
}

if(navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
	if (navigator.plugins && navigator.plugins["Shockwave Flash"]) pos = navigator.plugins["Shockwave Flash"].description.indexOf("Shockwave Flash");
	pos += 16;
	var swver = navigator.plugins["Shockwave Flash"].description.substr(pos, 1);
	if (swver >= minFlashVer);
	plugin = 1;
} else if(navigator.userAgent && navigator.userAgent.indexOf("MSIE") >= 0 && (navigator.userAgent.indexOf("Windows") >= 0)) {
	trace('<script language="vbscript"> \n');
	trace('on error resume next \n');
	trace('if ( minFlashVer = 3 ) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")))\n');
	trace('if (( minFlashVer <= 4) and (plugin <= 0 )) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
	trace('if (( minFlashVer <= 5) and (plugin <= 0 )) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
	trace('if (( minFlashVer <= 6) and (plugin <= 0 )) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
	trace("</scr"+"ipt> \n");
}
if(plugin) {
	trace('<div style="width:' + width + 'px;height:' + height + 'px;padding:' + (border ? border : 0) + 'px;background:#ffffff;">');
	trace('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + minFlashVer + ',0,0,0" id="movie" width="' + width + '" height="' + height + '">');
	trace(' <param name="movie" value="' + flashfile + '" /> <param name="quality" value="high" /> <param name="wmode" value="' + wmode + '" />');
	trace(' <embed src="' + flashfile + '" quality="high" wmode="' + wmode + '" swLiveConnect="false" width="' + width + '" height="' + height + '"');
	trace(' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
	trace(' </embed>');
	trace('</object>');
	trace('</div>');
	trace( (caption ? '<div style="width:' + width + 'px;text-align:center;font-size:8pt;padding:' + (border ? border : 0) + 'px">' + caption + '</div>' : '') );
} else if (!(navigator.appName && navigator.appName.indexOf("Netscape") >= 0 && navigator.appVersion.indexOf("2.") >= 0)) {
	trace(alternative);
}
