function includeFlash(elPath,movie,version,showMenu,w,h,bgColor,showDiv,altImgPath,jsArray,wmode){
	var thisCloseButtPath= elPath+"/images/closeDiv.gif";
	var thisDiv = window.document.getElementById(showDiv);
	var popframeName = "popframe_"+showDiv;
	var movieFolderPath = movie.slice(0,movie.lastIndexOf("/")+1);
	var aHtml = movieFolderPath + "flashDynamicShow.html";
	if(thisDiv) {
	thisDiv.style.display='';
		//Ausgabe von flash
		if(getFlashDetectVersion(version)== true){
		//get the FlashVariables and write m into a String
		if(jsArray){
			if(jsArray[0].myname != ""){
				myFlashparams = '';
				for (i in jsArray){
				 	if(i >= 0 && jsArray[i].myname != ""){
					 		myFlashparams = myFlashparams + "&";
						myFlashparams = myFlashparams + jsArray[i].myname+ "=" + jsArray[i].myvalue;
					}
		   	}
			 movie = movie + "?"+myFlashparams;
			 //alert(movie);
			}
		}
			
		thisDiv.innerHTML="<iframe  style=\"background-color:"+bgColor+";\" frameborder=\"0\" scrolling=\"No\" hspace=\"0\" vspace=\"0\" align=\"left\" onLoad=\"javascript:writeMe('"+popframeName+"','"+movie+"','"+version+"','"+showMenu+"','"+w+"','"+h+"','"+bgColor+"','"+wmode+"');\" id="+"\""+popframeName+"\" name="+"\""+popframeName+"\" src="+"\""+aHtml+"\" width="+w+"\" height="+h+"\"></iframe>";
		thisDiv.style.width = w;
		thisH = parseInt(h);
		thisDiv.style.height = thisH;
		//download flashplayer <a href=\"javascript:void(0);dropMe('"+showDiv+"');\"><img  src="+thisCloseButtPath+" alt=\"close me\" name=\"closer\" id=\"closer\" border=\"0\" align=\"middle\"\/></a>
	}else{
			myNewHTML = "<div style=\"width:"+w+"px;height:16px;text-align:right;padding:0px 0px 0px 0px;background-color:"+bgColor+";\"></div>";
			myNewHTML += "<a href=\"http://www.adobe.com/go/getflashplayer\" target=\"_blank\"><img  src="+altImgPath+" alt=\"Get FlashPlayer\" name=\"flashalt\" id=\"flashalt\" border=\"0\" align=\"middle\" /></a>";
		thisDiv.innerHTML= myNewHTML;
		thisDiv.style.textAlign="center";	
		thisDiv.style.backgroundColor=bgColor;
	}
}
}

function writeMe(popframeName,movie,version,showMenu,w,h,bgColor,wmode){
	var thisFrame = popframeName.replace(/popframe_/, "");
	if (bgColor.length > 0) {
		document.getElementById(thisFrame).innerHTML = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version="+version+"\" width="+w+"\" height="+h+"\"><param name=\"menu\" value="+showMenu+"><param name=\"wmode\" value=\""+wmode+"\" /><param name=\"movie\" value="+"\""+movie+"\"><param name=\"allowFullScreen\" value=true ><param name=\"quality\" value=\"high\"><param name=\"bgcolor\" value=#"+bgColor+"\" /><embed src="+"\""+movie+"\" menu="+showMenu+" quality=\"high\" pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" type=\"application\/x-shockwave-flash\" allowFullScreen=true wmode=\""+wmode+"\" bgcolor=#"+bgColor+"\" width="+w+"\" height="+h+"\"><\/embed><\/object>";
	}
	else {
		document.getElementById(thisFrame).innerHTML = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version="+version+"\" width="+w+"\" height="+h+"\"><param name=\"menu\" value="+showMenu+"><param name=\"wmode\" value=\""+wmode+"\" /><param name=\"movie\" value="+"\""+movie+"\"><param name=\"allowFullScreen\" value=true ><param name=\"quality\" value=\"high\"><embed src="+"\""+movie+"\" menu="+showMenu+" quality=\"high\" pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" type=\"application\/x-shockwave-flash\" allowFullScreen=true wmode=\""+wmode+"\" width="+w+"\" height="+h+"\"><\/embed><\/object>";
	}
}

function alertMe(){
	alert("I am here");
}

function getFlashDetectVersion(version){
  var FlashDetectPlayerVersion = new makeFlashDetectVersion(0,0,0);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			FlashDetectPlayerVersion = new makeFlashDetectVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else if (window.ActiveXObject){
	   try {
   	   var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
   		FlashDetectPlayerVersion = new makeFlashDetectVersion(axo.GetVariable("$version").split(" ")[1].split(","));
	   } catch (e) {}
	}
	
	if(FlashDetectPlayerVersion["major"]>=version){
		return true;
	}else{
		return false;
	}
}

makeFlashDetectVersion = function(arrVersion){
	this.major = parseInt(arrVersion[0]) || 0;
	this.minor = parseInt(arrVersion[1]) || 0;
	this.rev = parseInt(arrVersion[2]) || 0;
}
