
//***********************************************//
// flash active-x objesi aranır ve sonuc verilir...

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;
}



//*********************************************************************//
// gelen verilere gore scrip yazılır, flash yok ise yerine resim konur...

function insertFlash(i_minVersion, i_path, i_name, i_width, i_height, i_bgcolor, i_fb,i_link,i_fblink, transparent) {
	/*--alert (navigator.userAgent); --*/
  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://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,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 + '> ');
  if(transparent)
  document.write(' <param name=wmode value=transparent> ');
  document.write(' <embed src="' + i_path +'"');
  if(transparent)
  document.write(' wmode=transparent ');
  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/go/getflashplayer">');
  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">');
	}
 }
}
