
function insertFlash(i_minVersion, i_path, i_name, i_width, i_height,i_bgcolor, i_fb,i_link,i_fblink) {
  if (isFlash(i_minVersion)){
  	if(i_link){
   		i_link=escape(i_link);
		var linkarray=i_link.split("/");
		i_link=linkarray.join("%2F");
   		i_path=i_path+i_link;
   }
  document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
  document.write(' codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0"');
  document.write(' ID="' + i_name + '" WIDTH="' + i_width + '" HEIGHT="' + i_height + '">');
  document.write(' <PARAM NAME=movie VALUE="' + i_path +'"> ');
  document.write(' <PARAM NAME=quality VALUE=high> ');
  document.write(' <PARAM NAME=menu VALUE=false> ');
  document.write(' <PARAM NAME=bgcolor VALUE=#' + i_bgcolor + '> ');
  document.write('<EMBED SRC="' + i_path +'"');
  document.write(' NAME=' + i_name + ' swLiveConnect="TRUE" WIDTH="' + i_width + '" HEIGHT="' + i_height + '"');
  document.write(' QUALITY="high" MENU="false" BGCOLOR="#' + i_bgcolor + '"');
  document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
  document.write('</EMBED>');
  document.write('</OBJECT>');
 }else {
 	if(i_fblink){
     document.write('<a href="'+i_fblink+'"><img src="' + i_fb+'" width="'+i_width+'" height="'+i_height+'" border="0"></a>');
	}else{
		document.write('<img src="' + i_fb+'" width="'+i_width+'" height="'+i_height+'" border="0">');
	}
 }
 
}

function isFlash(inVersion){
 FlashMode =0;
 if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
  if (navigator.plugins && navigator.plugins["Shockwave Flash"] && (versionIndex = navigator.plugins["Shockwave Flash"].description.indexOf(".")) != - 1) {
   var versionString = navigator.plugins["Shockwave Flash"].description.substring(versionIndex-1, versionIndex);
   versionIndex = parseInt( versionString );
   if ( versionIndex >= inVersion ) {
     FlashMode = 1;
   }
  }
 }
 else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
    && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0 )) {
  theStr='FlashMode = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+inVersion+'"))) \n';
  document.write('<SCRIPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write(theStr);
  document.write('</SCRIPT\> \n');
   
 }
 return FlashMode;
}

