PageRenderTime 84ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 1ms

/sandbox/POP3/_.NET POP3 Mime Client/NetPopMimeClient.aspx_files/ServeHTML_data/InsertFlash.js

https://bitbucket.org/cristi_diaconescu/remote_igor
JavaScript | 60 lines | 56 code | 4 blank | 0 comment | 19 complexity | a2ea652afbeadc452896d23d31d5a6a1 MD5 | raw file
  1. var FlashDetected = 0;
  2. if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] &&
  3. navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
  4. if (navigator.plugins && navigator.plugins["Shockwave Flash"])
  5. FlashDetected = 1;
  6. }
  7. else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 &&
  8. (navigator.userAgent.indexOf("Windows 95")>=0 ||
  9. navigator.userAgent.indexOf("Windows 98")>=0 ||
  10. navigator.userAgent.indexOf("Windows NT")>=0)) {
  11. document.write('<SCRIPT LANGUAGE=VBScript\> \n');
  12. document.write('on error resume next \n');
  13. document.write('FlashDetected = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")))\n');
  14. document.write('if ( FlashDetected <= 0 ) then FlashDetected = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
  15. document.write('if ( FlashDetected <= 0 ) then FlashDetected = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
  16. document.write('if ( FlashDetected <= 0 ) then FlashDetected = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
  17. document.write('if ( FlashDetected <= 0 ) then FlashDetected = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7")))\n');
  18. document.write('if ( FlashDetected <= 0 ) then FlashDetected = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
  19. document.write('if ( FlashDetected <= 0 ) then FlashDetected = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9")))\n');
  20. document.write('</SCRIPT\> \n');
  21. }
  22. function FlashAdText(FlashAdMovie, FlashAdRedirURL, FlashAdAltImage, FlashAdSizeX, FlashAdSizeY)
  23. {
  24. var FlashAdText = '';
  25. if ( FlashDetected ) {
  26. FlashAdText += '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
  27. FlashAdText += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=3,0,0,0" ';
  28. FlashAdText += ' WIDTH=' + FlashAdSizeX + ' HEIGHT=' + FlashAdSizeY + '>';
  29. FlashAdText += '<PARAM NAME=movie VALUE="' + FlashAdMovie + '?clickTAG=' + FlashAdRedirURL + '&target=_blank">';
  30. FlashAdText += '<PARAM NAME=quality VALUE=high>';
  31. FlashAdText += '<PARAM NAME="wmode" value="opaque">';
  32. FlashAdText += '<EMBED src="' + FlashAdMovie + '?clickTAG=' + FlashAdRedirURL + '&target=_blank" quality=high';
  33. FlashAdText += ' wmode="opaque" WIDTH=' + FlashAdSizeX + ' HEIGHT=' + FlashAdSizeY;
  34. FlashAdText += ' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">';
  35. FlashAdText += '</EMBED>';
  36. FlashAdText += '</OBJECT>';
  37. } else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
  38. FlashAdText += '<a href="' + FlashAdRedirURL + '" target="_blank"><IMG SRC="' + FlashAdAltImage + '" WIDTH=' + FlashAdSizeX + ' HEIGHT=' + FlashAdSizeY + ' BORDER=0></a>';
  39. }
  40. return FlashAdText;
  41. }
  42. function ActivateFlash(DivID, text)
  43. {
  44. var d = document.getElementById(DivID);
  45. if (d) d.innerHTML = text;
  46. }
  47. function RenderFlash(ID, FlashAdMovie, FlashAdRedirURL, FlashAdAltImage, FlashAdSizeX, FlashAdSizeY)
  48. {
  49. var agt = navigator.userAgent.toLowerCase();
  50. if ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) {
  51. document.writeln('<div id="f_' + ID + '"></div>');
  52. ActivateFlash('f_' + ID,FlashAdText(FlashAdMovie, FlashAdRedirURL, FlashAdAltImage, FlashAdSizeX, FlashAdSizeY));
  53. }
  54. else
  55. document.writeln(FlashAdText(FlashAdMovie, FlashAdRedirURL,FlashAdAltImage, FlashAdSizeX, FlashAdSizeY));
  56. }