function addFlash(minversion,path,width,height,node,imagealt,queryname,queryvalue) {
	if(!document.getElementById) return false;

	// defining arguments (from arguments array) in object and embed elements:
	var minargs = 6;
	var objpars = '<param name="movie" value="'+path+'">';
	var empars = ' src="'+path+'" ';
	var align = '';
	var flashid = '';
	var salign = '';
	var flvars = '';
	var allowedObjParams = ["menu","play","quality","scale","devicefont","bgcolor","wmode","salign","base"];
	var allowedEmbParams = ["menu","play","quality","scale","devicefont","bgcolor","wmode","base","swliveconnect"];

	for(var op=parseInt(arguments.length);op>minargs;op--) {
		var tmp = arguments[op-1].split(":"); var tmpname = tmp[0];var tmpvalue = tmp[1];
		if(allowedObjParams.indexOf(tmpname.toLowerCase()) >-1) {
			objpars += '<param name="'+tmpname+'" value="'+tmpvalue+'">';
		}
		if(allowedEmbParams.indexOf(tmpname.toLowerCase()) >-1) {
			empars += ' '+tmpname+'="'+tmpvalue+'" ';
		}
		if(tmpname.toLowerCase() == "align") {
			align = ' align="'+tmpvalue+'" ';
		}
		if(tmpname.toLowerCase() == "salign") {
			salign = ' salign="'+tmpvalue+'" ';
		}
		/*if(tmpname.toLowerCase() == "flashvars") {
			if(minversion>=6) flvars = tmpvalue;
			else alert("flashVars support was not available until flash version 6");
		}*/
	}


	//if(checkFlash(minversion) >= minversion){
		//if(flaccess_debug==1) alert("minimum flash " + minversion + " is ok, we have version " + checkFlash())

		var col = node.split(",");
		var flid = col[0];
		var parentid = col[1];
		if(minversion>=6){
			if(flvars!='') flvars += '&';
			//flvars += 'flid='+node;
			objpars += '<param name="movie" value="'+flvars+'">';
		}
		
		var queryStr = "";
		if (queryvalue!="" && queryname!=""){
			
			queryStr = "?" + queryname + "=" + queryvalue;	
			
		}

		var embedTag = '<embed src="'+path+'.swf' + queryStr + '" width="'+width+'" height="'+height+'" name="'+path+'" wmode="transparent" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'


		var obj = '<object type="application/x-shockwave-flash" data="'+path+'.swf' + queryStr + '" width="'+width+'" height="'+height+'"><param name="movie" value="'+path+'.swf' + queryStr + '" /><param name="scale" value="noscale" /><param name="wmode" value="transparent" />'+embedTag+'</object>'

//myFlashMovie.wmode = "transparent";

		//if(flaccess_debug==1) alert(" flid: " + flid + "\n\n" + obj);

		//obj = '<img src="' + imagealt + '" alt="alt" title="title" />';

                if(document.getElementById(parentid)) {
			document.getElementById(parentid).innerHTML = obj;

				}
			//var lastChar = "";

			//var myLen = myString.length;
			//var myChar = myString.substr(myLen-1,myLen-1);
	//document.write(txt.substr(5,6));
	//alert(myChar);

			/*if (height == "100%"){
				//document.getElementById(parentid).style.height = height+"%";
				//document.getElementById(parentid).style.width = width+"%";
			}else{
				document.getElementById(parentid).style.height = height+"px";
				document.getElementById(parentid).style.width = width+"px";
			}*/
			//if (document.getElementById(parentid).style.height
			//document.getElementById(parentid).style.height = height+"px";
			//document.getElementById(parentid).style.width = width+"px";
		//}

	//}
	/*else {
		var col = node.split(",");
                var parentid = col[1];

                if(flaccess_debug==1) alert("we have version " + checkFlash() + " and we need flash " + minversion)
                //alert("HI THERE");
                if(document.getElementById(parentid)) {
                  if (imagealt){
                    document.getElementById(parentid).innerHTML = imagealt;
                  }
                }
	}*/

}

// extending Array, by Aaron Boodman (youngpup.net):
Array.prototype.indexOf = function(foo) {
	for (var i = 0; i < this.length; i++)
	if (foo == this[i]) return i;
	return -1;
}
