1/*______________________________________ 2 3 putFlash Version 0.8 r16 4 Customized by dahari 5 Last updated on 2006-10-06 6 7______________________________________*/ 8 9 10var pluginspages = new Array(); 11pluginspages[0] = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"; // English 12pluginspages[1] = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&Lang=Japanese"; // Japanese 13 14var pluginVer = 0; 15 16function pfAltAction(Obj) { 17 if (Obj.nonflashSW == 1) location.href = Obj.nonFlashSRC; 18 return Obj.nonFlashSRC; 19} 20 21function pfAltContent(Obj) { 22 if (Obj.nonflashSW == 1) return ""; 23 return Obj.nonFlashSRC; 24} 25 26 27function pfFlashPlayerMeetRequiredVersion(requiredVer) { 28 var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? 29 navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : null; 30 if (plugin) { 31 pluginVer = parseInt(plugin.description.substring(plugin.description.indexOf(".") -1)); 32 } else { 33 // for Win MSIE 34 if (!arguments.callee.__alreadyExecuted___) { 35 arguments.callee.__alreadyExecuted___ = true; 36 document.writeln('<script type="text/vbscript">'); 37 document.writeln('On Error Resume Next'); 38 document.writeln('Private swfEnableFlag'); 39 document.writeln('swfEnableFlag = false'); 40 document.writeln('swfEnableFlag = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.' + requiredVer + '"))'); 41 document.writeln('If swfEnableFlag Then'); 42 document.writeln('pluginVer = ' + requiredVer); 43 document.writeln('End If'); 44 document.writeln('</script>'); 45 } 46 } 47 return (pluginVer >= requiredVer); 48} 49 50 51function putflash (Obj) { 52 if (!Obj.dir) Obj.dir = ''; 53 if (!Obj.id) Obj.id = 'putflash'; 54 if (!Obj.requiredVer) Obj.requiredVer = 6; 55 if (!Obj.bgcolor) Obj.bgcolor = "#ffffff"; 56 if (!Obj.quality) Obj.quality = "high"; 57 if (!Obj.language) Obj.language = 0; 58 if (!Obj.macie4exec && Obj.macie4exec != "0") Obj.macie4exec = 0; 59 if (!Obj.moz_exec && Obj.moz_exec != "0") Obj.moz_exec = 1; 60 if (!Obj.opera_exec && Obj.opera_exec != "0") Obj.opera_exec = 0; 61 if (!Obj.nonflashSW && Obj.nonflashSW != "0") Obj.nonflashSW = 0; 62 if (!Obj.nonFlashSRC) Obj.nonFlashSRC = ""; 63 if (!Obj.swLiveConnect) Obj.swLiveConnect = "false"; 64 if (!Obj.menu) Obj.menu = "false"; 65 if (!Obj.disableCodebase) Obj.disableCodebase = 0; 66 if (!Obj.allowScriptAccess) Obj.allowScriptAccess ="always"; 67 if (!Obj.className) Obj.className ="flash"; 68 69// document.open(); 70 if (Obj.hedSRC) document.write(Obj.hedSRC); 71 if (pfFlashPlayerMeetRequiredVersion(Obj.requiredVer)){ 72 document.write(pfGetObjectElement(Obj)); 73 } else { 74 document.write(pfAltAction(Obj)); 75 } 76 if (Obj.fotSRC) document.write(Obj.fotSRC); 77// document.close(); 78} 79 80 81 82 83function pfGetObjectElement(Obj){ 84 var ua = navigator.userAgent; 85 var isSafari = ua.match(/AppleWebKit/); 86 var isSafari1 = isSafari && parseFloat(BA.ua.revision) < 412 ? 1 : 0; 87 88 if (window.opera && Obj.opera_exec != 1) { 89 return pfAltAction(Obj); 90 } 91 92 if (isSafari1 && Obj.opera_exec != 1) { 93 return pfAltAction(Obj); 94 } 95 96 if (!Obj.file || !Obj.width || !Obj.height || !Obj.id) { 97 return ""; 98 } 99 100 var result = ""; 101 result += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'; 102 103 if(!Obj.disableCodebase){ 104 result += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"'; 105 } 106 var classAttr = (Obj.className) ? ' class="' + Obj.className + '"' : ''; 107 result += ' id="' + Obj.id + '" width="' + Obj.width + '" height="' + Obj.height + '" name="' + Obj.id + '"' + classAttr + '>'; 108 result += '<param name="movie" value="' + Obj.dir + Obj.file + '">'; 109 result += '<param name="quality" value="' + Obj.quality + '">'; 110 result += '<param name="bgcolor" value="' + Obj.bgcolor + '">'; 111 result += '<param name="menu" value="' + Obj.menu + '"' + '>'; 112 if (Obj.salign) result += '<param name="salign" value="' + Obj.salign + '"' + '>'; 113 if (Obj.scale) result += '<param name="scale" value="' + Obj.scale + '"' + '>'; 114 if (Obj.FlashVars) result += '<param name="FlashVars" value="' + Obj.FlashVars + '"' + '>'; 115 if (Obj.allowScriptAccess) result += '<param name="allowScriptAccess" value"' + Obj.allowScriptAccess + '"' + '>'; 116 117 118 if ((navigator.appVersion.indexOf('Win',0) != -1 && navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1) && !window.opera){ 119 result += pfAltContent(Obj); 120 } else { 121 result += pfGetEmbedElement(Obj); 122 } 123 result += '</object>'; 124 return result; 125} 126 127 128 129function pfGetEmbedElement(Obj){ 130 if (Obj.moz_exec != 1 && (navigator.userAgent.indexOf("Gecko/") != -1)) return pfAltAction(Obj); 131 132 if (Obj.macie4exec != 1 && (navigator.appVersion.indexOf('Mac',0) != -1)){ 133 if (navigator.appVersion.indexOf('MSIE 4.',0) != -1) return pfAltAction(Obj); 134 if (navigator.appVersion.indexOf('MSIE 3.',0) != -1) return pfAltAction(Obj); 135 } 136 137 var ua = navigator.userAgent; 138 var reviseFlag = false;
139 if (ua.match(/Gecko\//)) { 140 var key = 'rv:'; 141 var sRv = ua.substr(ua.indexOf(key) + key.length, 4); 142 var fRv = parseFloat(sRv); 143 reviseFlag = (fRv > 1.4 && (fRv < 1.7 || sRv == '1.7a')); 144 } 145 146 var result = ""; 147 result += '<embed src="' + Obj.dir + Obj.file + '"'; 148 result += ' menu="' + Obj.menu + '"'; 149 result += ' quality="' + Obj.quality + '"'; 150 result += ' swLiveConnect="' + Obj.swLiveConnect + '"'; 151 result += ' bgcolor="' + Obj.bgcolor + '"'; 152 result += ' width="' + Obj.width + '"'; 153 result += ' height="' + Obj.height + '"'; 154 if (Obj.scale && !reviseFlag) result += ' scale="' + Obj.scale + '"'; 155 if (Obj.salign) result += ' salign="' + Obj.salign + '"'; 156 if (Obj.scale && reviseFlag) result += ' scale="' + Obj.scale + '"'; 157 if (Obj.FlashVars) result += ' FlashVars="' + Obj.FlashVars + '"'; 158 if (Obj.allowScriptAccess) result += ' allowScriptAccess="' + Obj.allowScriptAccess + '"'; 159 result += ' type="application/x-shockwave-flash"'; 160 result += ' pluginspage="' + pluginspages[Obj.language] + '"'; 161 result += ' name="' + Obj.id + '"'; 162 result += (Obj.className) ? ' class="' + Obj.className + '"' : ''; 163 result += '></embed><br>'; 164 return result; 165} 166 167 168 169function pfHideAlternateBlock(Obj) { 170 171 var required = Obj.requiredVer; 172 var swfCName = Obj.className || 'flash'; 173 var altCName = Obj.altClassName || 'flash-alternate'; 174 175 var ua = navigator.userAgent; 176 var isGecko = ua.match(/Gecko\//); 177// var isSafari = ua.match(/AppleWebKit/); 178// var isSafari1 = isSafari && parseFloat(BA.ua.revision) < 412 ? 1 : 0; 179 180 if (pfFlashPlayerMeetRequiredVersion(required)) { 181// if (isGecko || isSafari1) { 182 if (isGecko) {
183 document.write('<style type="text/css" media="screen">.' + altCName + ' { display: none }</style>'); 184 document.write('<style type="text/css" media="print">.' + swfCName + ' { display: none }</style>'); 185 } else { 186 document.write('<style type="text/css" media="all">.' + altCName + ' { display: none }</style>'); 187 } 188 } else { 189 document.write('<style type="text/css" media="all">.' + altCName + ' { display: none }</style>'); 190 } 191}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.