
function JSGetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor;
      	} else {
			flashVer = -1;
		}
	}
	else {
		flashVer = -1;
	}
	return flashVer;
} 

function checkFlashVertion() {
	var MM_FlashControlVersion 	= 0;
	var isIE  					= (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
	var isWin 					= (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
	var isOpera 				= (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
	var jsVersion 				= 1.1;

	if (location.href.indexOf("_Errorhandler") < 1) {

		if (isIE && isWin && !isOpera) {
			MM_FlashControlVersion = VBGetSwfVer();
		} else {
			MM_FlashControlVersion = JSGetSwfVer();		
		}

		if (MM_FlashControlVersion < 8) {
			location.href = "/_Errorhandler/000_flash-required.asp"
		}
	}
}

function createFlashElement(sTagName){
	if(document.createElementNS){
		return document.createElementNS("http://www.w3.org/1999/xhtml", sTagName);	
	} else {
		return document.createElement(sTagName);
	};
};

function createFlashObjectParameter(nodeObject, sName, sValue){
	var node = createFlashElement("param");
	node.setAttribute("name", sName);	
	node.setAttribute("value", sValue);
	nodeObject.appendChild(node);
};

function createFlashMovie(str_ObjectID, str_Path, lng_Width, lng_height){
	var nodeFlash = null;
	
	document.write("<div id=\"" + str_ObjectID + "-holder\"></div>");
	
	if(!navigator.userAgent.toLowerCase().indexOf('opera')){
		nodeFlash = createFlashElement("object");
		nodeFlash.setAttribute("type", "application/x-shockwave-flash");
		nodeFlash.setAttribute("data", str_Path);
		createFlashObjectParameter(nodeFlash, "movie", str_Path);
		createFlashObjectParameter(nodeFlash, "quality", "high");
		createFlashObjectParameter(nodeFlash, "wmode", "transparent");
	} else {
		nodeFlash = createFlashElement("embed");
		nodeFlash.setAttribute("src", str_Path);
		nodeFlash.setAttribute("type", "application/x-shockwave-flash");
		nodeFlash.setAttribute("pluginspage", "http://www.macromedia.com/go/getflashplayer");
		nodeFlash.setAttribute("wmode", "transparent");
	}
	
	nodeFlash.setAttribute("width", lng_Width);
	nodeFlash.setAttribute("height", lng_height);
	nodeFlash.style.width = lng_Width + "px";
	nodeFlash.style.height = lng_height + "px";
	
	objFlashHolder = document.getElementById(str_ObjectID + "-holder");
	
	objFlashHolder.appendChild(nodeFlash); 
}

//checkFlashVertion();