// JScript source code

function Trim(TRIM_VALUE){
	if(TRIM_VALUE.length < 1){
		return "";
	}
	TRIM_VALUE = RTrim(TRIM_VALUE);
	TRIM_VALUE = LTrim(TRIM_VALUE);
	if(TRIM_VALUE==""){
		return "";
	}
	else{
		return TRIM_VALUE;
	}
} //End Function

function RTrim(VALUE){
	var w_space = String.fromCharCode(32);
	var v_length = VALUE.length;
	var strTemp = "";
	if(v_length < 0){
		return "";
	}
	var iTemp = v_length -1;

	while(iTemp > -1){
		if(VALUE.charAt(iTemp) == w_space){
		}
		else{
			strTemp = VALUE.substring(0,iTemp +1);
			break;
		}
		iTemp = iTemp-1;
	} //End While
	return strTemp;
} //End Function

function LTrim(VALUE){
	var w_space = String.fromCharCode(32);
	if(v_length < 1){
		return "";
	}
	var v_length = VALUE.length;
	var strTemp = "";

	var iTemp = 0;

	while(iTemp < v_length){
		if(VALUE.charAt(iTemp) == w_space){
		}
		else{
			strTemp = VALUE.substring(iTemp,v_length);
			break;
		}
		iTemp = iTemp + 1;
	} //End While
	return strTemp;
} //End Function

function CreateFlash(DivID, WIDTH, HEIGHT, Path, File, queryString, COLOR)
{
  var d = document.getElementById(DivID);
  //document.write(d.name);
  var testoInner =
     '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ' +
    'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '+
    'width=' + WIDTH + ' height=' + HEIGHT +'>';
   // document.write(testoInner);
   if (Trim(queryString)=='')
   {	
		testoInner = testoInner+'<PARAM NAME=movie VALUE="' + Path + File + '">';
   }
	else
	{
		testoInner = testoInner+'<PARAM NAME=movie VALUE="' + Path + File + '?' + queryString + '">';
	}
	testoInner = testoInner + '<PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=' + sColor + '> ';
	testoInner = testoInner + '<param name=wmode value=transparent>';
	if (Trim(queryString)== '')
	{
		testoInner = testoInner + '<EMBED wmode=transparent	src="' + pathFile + nameFile + '" quality=high bgcolor=#FFFFFF  WIDTH="' + WIDTH + '" HEIGHT="' + HEIGHT + '" NAME="pulsante" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>';
	}
	else
	{
		testoInner = testoInner + '<EMBED wmode=transparent	src="' + Path + File + '?' + queryString + '" quality=high bgcolor=#FFFFFF  WIDTH="' + WIDTH + '" HEIGHT="' + HEIGHT + '" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>';
	}

	testoInner = testoInner + '</OBJECT>';  
	d.InnerHtml = testoInner;
   
}
