/*****
* @ Mc Flash Loader
* @ by RYU
*
* @ Update HIstory
* 2010/03/16 - version 1.3.0
* --- Restructed embed-code for Web-Standard.
* --- Added StyleSheet Object {outline:none;}
* --- Fixed Zero count bug of "mc-flash-loader".
*
* 2009/04/30 - version 1.10
* --- added subversion
*
* 2009/03/19 - version 1.00
* 
*****/

(function(){ var oldonload = window.onload; if(typeof window.onload != "function") { window.onload=function() { mcFlashLoader.check_flash(); } } else { window.onload = function() { oldonload(); mcFlashLoader.check_flash(); } } function mc_flash_loader() { 																																																						this.isIE =(navigator.appVersion.indexOf("MSIE") != -1) ? true : false; this.isWin=(navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false; this.isOpera=(navigator.userAgent.indexOf("Opera") != -1) ? true : false; this.default_flash_version=8; this.default_flash_bgcolor="#FFFFFF"; this.default_flash_wmode="window"; this.default_falsh_security="sameDomain"; this.default_flash_menu="false"; this.default_flash_quality="high"; this.default_flash_loop="false"; this.default_flash_autoinstall="false"; this.player_cnt=0; this.style_set=function() { var styleSheet=document.styleSheets; if(!styleSheet.length) { var newStyle=document.createElement("style"); newStyle.type="text/css"; document.getElementsByTagName("head")[0].appendChild(newStyle); } var style=document.styleSheets[0]; if (style.insertRule) { style.insertRule(".mc-flash-loader"+"{display:none;}", style.cssRules.length); style.insertRule("object"+"{outline:none;}", style.cssRules.length); } else if (style.addRule) { style.addRule(".mc-flash-loader", "display:none;"); style.addRule("object", "outline:none;"); } }; this.check_flash=function() { var my_code; var html_src=document.body.innerHTML; var flash_array=html_src.match(/<!-- flash\s*(\[.*\])+\s*flash -->/gm); if (flash_array && flash_array.length > 0) { for (var i=0; i < flash_array.length; i++) { my_code=flash_array[i].replace(/<!-- flash|\n|\t|\[|\]|\"|flash -->/gm, "").replace(/,+\s/gm, "|"); this.version_check(my_code); this.player_cnt ++; } } }; this.get_version=function() { var version='0.0.0'; if(navigator.plugins && navigator.mimeTypes['application/x-shockwave-flash']) { var plugin=navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin; if (plugin && plugin.description) { version=plugin.description.replace(/^[A-Za-z\s]+/, '').replace(/(\s+r|\s+b[0-9]+)/, "."); } } else { var x=''; try { var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); x=axo.GetVariable("$version"); } catch(e) { try { axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); x="WIN 6,0,21,0"; axo.AllowScriptAccess="always"; x=axo.GetVariable("$version"); } catch(e) { if (!x.match(/^WIN/)) { try { axo=null; axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3"); x=axo.GetVariable("$version"); } catch(e) { if (axo) { x="WIN 3,0,18,0"; } else { try { axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); x="WIN 2,0,0,11"; } catch(e) { x="WIN 0,0,0,0"; } } } } } } version=x.replace(/^WIN /,'').replace(/,[0-9]+$/,'').replace(/,/g,'.'); } if (version.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)) { return version.split("."); } else { return '0.0.0'; } }; this.version_check=function(flash_code) { var my_code; var param=new Array(); var flash=new Object(); my_code=flash_code.replace(/\s+/g, " ").replace(/^\s|\s$/gm, "").split(" "); flash.num=this.player_cnt; flash.version=(flash.version) ? flash.version : this.default_flash_version; for (var i in my_code) { if (my_code[i] != undefined) { param=my_code[i].split("="); flash[param[0]]=param[1]; } } if (flash.width==undefined || flash.height==undefined || flash.file==undefined) { alert("Not Found File/Width/Height of Flash..."); return false; } var my_parameter=""; flash.wmode=(flash.wmode) ? flash.wmode : this.default_flash_wmode; flash.bgcolor=(flash.bgcolor) ? flash.bgcolor.replace(/^([0-9a-zA-Z]+)$/,"#$1") : this.default_flash_bgcolor; flash.allowScriptAccess=(flash.allowScriptAccess) ? flash.allowScriptAccess : this.default_falsh_security; flash.menu=(flash.menu) ? flash.menu : this.default_flash_menu; flash.quality=(flash.quality) ? flash.quality : this.default_flash_quality; flash.loop=(flash.loop) ? flash.loop : this.default_flash_loop; flash.autoinstall=(flash.autoinstall) ? flash.autoinstall : this.default_flash_autoinstall; flash.nocache=(flash.nocache=="true") ? Math.random() : ""; flash.geturl=(flash.geturl=="true") ? window.location : ""; flash.parameter=(flash.parameter) ? flash.parameter.replace(/\s/gm, "").replace(/:/gm, "=").replace(/\|/gm, "&") : ""; if (flash.nocache != "") { flash.file += "?" + flash.nocache; } if (flash.geturl != "") { my_parameter += "&_geturl=" + flash.geturl; } if (flash.parameter != "") { my_parameter += "&" + flash.parameter; } if (my_parameter != "") { flash.FlashVars=my_parameter.replace(/^&/, ""); } var subversion=(flash.subversion) ? flash.subversion.replace(/\./gm, ",").split(",") : -1; delete flash.nocache; delete flash.geturl; delete flash.parameter; delete flash.subversion; var mc_flash_class=(document.getElementsByClassName) ? document.getElementsByClassName('mc-flash-loader') : this.getElementsByClass('mc-flash-loader'); if (mc_flash_class != "") { mc_flash_class[flash.num].style.display="block"; } else { return false; } var version=this.get_version(); if (subversion != -1 && !this.sub_version_check(version, subversion)) { if (flash.autoinstall=="true") { delete flash.autoinstall; if (this.sub_version_check(version, [6,0,65])) { this.write_updater(flash); } } else { return false; } } else { if (parseInt(version[0]) >= parseInt(flash.version)) { delete flash.autoinstall; this.write_flash(flash); } else { if (flash.autoinstall=="true") { delete flash.autoinstall; if (this.sub_version_check(version, [6,0,65])) { this.write_updater(flash); } } else { return false; } } } }; this.sub_version_check=function(current_ver, compare_ver) { if (parseInt(current_ver[0]) > parseInt(compare_ver[0])) { return true; } else if (parseInt(current_ver[0])==parseInt(compare_ver[0])) { if (parseInt(current_ver[1]) > parseInt(compare_ver[1])) { return true; } else if (parseInt(current_ver[1])==parseInt(compare_ver[1])) { if (parseInt(current_ver[2]) >= parseInt(compare_ver[2])) { return true; } else { return false; } } } else { return false; } }; 																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																										 this.diabled_noflash_img=function(num, src) { var cnt=0; var mc_flash_class=(document.getElementsByClassName) ? document.getElementsByClassName('mc-flash-loader') : this.getElementsByClass('mc-flash-loader'); for (var i in mc_flash_class) { if (cnt==num) { mc_flash_class[i].innerHTML=src; } cnt ++; } }; this.write_flash=function(flash) { var flash_id=flash.file.replace(/^(.*\/)*(.*)\.swf$/gm, "$2"); var sTag='<object id="'+flash_id+'" type="application/x-shockwave-flash" data="'+flash["file"]+'" width="'+flash.width+'" height="'+flash.height+'">'; for (var prop in flash) { if (prop != "num") { if (prop=="file") { sTag += '<param name="movie" value="'+flash[prop]+'" />'; } else if (prop != "version" && prop != "width" && prop != "height") { sTag += '<param name="'+prop+'" value="'+flash[prop]+'" />'; } } } sTag += ' </object>'; this.diabled_noflash_img(flash.num, (sTag)); }; this.getElementsByClass=function(searchClass) { if (document.all) { var classElements=new Array(); var allElements=document.all; for (i=0, j=0; i < allElements.length; i++) { if (allElements[i].className==searchClass) { classElements[j]=allElements[i]; j++; } } } else if (document.getElementsByTagName) { var classElements=new Array(); var allElements=document.getElementsByTagName("*"); for (i=0, j=0; i < allElements.length; i++) { if (allElements[i].className==searchClass) { classElements[j]=allElements[i]; j++; } } } else { return; } return classElements; }; this.write_updater=function(old_flash) { var MMPlayerType=(this.isIE==true) ? "ActiveX" : "PlugIn"; var MMredirectURL=window.location; document.title=document.title.slice(0, 47) + " - Flash Player Installation"; var MMdoctitle=document.title; var flash_path=old_flash.file.replace(/^(.*\/)*(.*)\.swf\?*.*/gm, "$1"); var flash=new Object(); flash.allowScriptAccess="always"; flash.width=(old_flash.width < 215) ? 215 : old_flash.width; flash.height=(old_flash.height < 138) ? 138 : old_flash.height; flash.scale="noscale"; flash.num=old_flash.num; flash.version=6; flash.align="middle"; flash.bgcolor="#FFFFFF"; flash.file=flash_path + "mc_flash_auto_installer.swf"; flash.FlashVars='MMredirectURL='+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle; this.write_flash(flash); }; };var mcFlashLoader=new mc_flash_loader();mcFlashLoader.style_set();})();