// JavaScript Document
function getObject(objectName) {
	return (document.all) ? document.all[objectName] : document.getElementById(objectName);
}

function putFlash(src, issue, width, height) {
	var html;
	if(checkFlash(7)) {
		html = getFlashHTML(src, width, height);
		getObject('content').innerHTML = html;
	} else {
		var lay = getObject('content');
		var style = "position:absolute; left: " + ((650 - 281) / 2) + "px; top: " + ((421 - 38) / 2) + "px; width: " + 281 + "px; height: " + 38 + "px;";
		
		html = '<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank" style="' + style + '">';
		html += '<img src="inc/img/misc/getFlash' + issue + '.gif" width="281" height="38" border="0">';
		html += '</a>';
		lay.innerHTML = html;
	}
}

function getFlashHTML(src, w, h) {
	var html = '\n';
	html += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" \n';
	html += '	codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" \n';
	html += '	width="' + w + '" height="' + h + '">\n';
	html += '	<param name="movie" value="' + src + '">\n';
	html += '	<param name="quality" value="high">\n';
	html += '	<embed src="' + src + '" \n';
	html += '		quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" \n';
	html += '		type="application/x-shockwave-flash" \n';
	html += '		width="' + w + '" height="' + h + '">\n';
	html += '	</embed>\n';
	html += '</object>\n';
	
	return html;
}

function checkFlash(ver) {
	var p=navigator.plugins;
	var flash=false;
	if(p && p.length) {
		for(i=0;i<p.length;i++) {
			if(p[i].description && String(p[i].description).indexOf('Flash') > -1) {
				flash = parseInt(String(p[i].description).charAt(16),10)>=ver;
			}
		}
	} else {
		eval('try { var xObj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.' + ver + '"); flash = true; } catch(e) {}');
	}
	return flash;
}
