 //------------write the flash image

function embedFlash(id){
	bgcolor="#FFFFFF";
	width="237";
	height="425";
	//creates the flash object
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+width+'" height="'+height+'">');
	document.write('<PARAM name="movie" value="swf/bldg_' + id + '.swf">');
	document.write('<param name="quality" value="high" />');
	document.write('<EMBED src="swf/bldg_' + id + '.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></EMBED>');
	document.write('\</object>');
}

function displayBar(id, minVersion, altText) {

	width="237";
	height="425";
	allCookies = document.cookie;
	flashKey = "_flash=";
	embed = false;
	
	// looking for "_flash" cookie
	pos = allCookies.indexOf(flashKey);
	
	if (pos!= -1) {
		start = pos + flashKey.length;	// Get to start of cookie value
		var end = allCookies.indexOf(";", start); // End of value
		if (end == -1) { end = allCookies.length; }
		flashValue = unescape(allCookies.substring(start, end));
	
		if (flashValue >= minVersion) {
			embed = true;
		}
	}
	
	if (embed) { embedFlash(id); }
	// or else, output image tag
	else {
		document.write('<img src="/images/photos/bldg_' + id + '.jpg" width="' + width + '" height="' + height + '" alt="' + altText + '" />');
	}
}
