//check flash
function Flash_Check() {
	
	var navi = document.getElementById('navi');
	var headCont = document.getElementById('headCont');
	
	var flashinstalled = 0;
	var flashversion = 0;

	MSDetect = "false";

	if (navigator.plugins && navigator.plugins.length)	{			
		x = navigator.plugins["Shockwave Flash"];

		if (x) {
			flashinstalled = 2;

			if (x.description) {
				y = x.description;
				flashversion = y.charAt(y.indexOf('.')-1);
			}

		}

		else
		flashinstalled = 1;
		if (navigator.plugins["Shockwave Flash 2.0"]) {
			flashinstalled = 2;
			flashversion = 2;
		}
	}

	else if (navigator.mimeTypes && navigator.mimeTypes.length) {
		x = navigator.mimeTypes['application/x-shockwave-flash'];

		if (x && x.enabledPlugin)
		flashinstalled = 2;
		else
		flashinstalled = 1;
	}

	else
	MSDetect = "true";


	//build flash/noflash logo
	if(flashinstalled == 2) {
		var object = document.createElement('object');
		var param1 = document.createElement('param');
		var param2 = document.createElement('param');
		var embed =  document.createElement('embed');

		//erase static logo
		navi.style.background = "none";

		object.setAttribute('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0');
		object.setAttribute('classid', 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000');

		param1.setAttribute('value', 'components/flash/wm_logo.swf');
		param1.setAttribute('name', 'movie');

		param2.setAttribute('value', 'high');
		param2.setAttribute('name', 'quality');

		embed.setAttribute('src', 'components/flash/wm_logo.swf');

		object.appendChild(param1);
		param1.parentNode.insertBefore(param2, param1.nextSibling);
		param2.parentNode.insertBefore(embed, param2.nextSibling);
		headCont.appendChild(object);

	}
	
	//return flashinstalled value to sidePannel
	return flashinstalled;
	
}