var advertProgress = null; var advertProgressPersent = null; var advertProgressText = null; var advertIntervalId = 0; var advertLoadPersent = 0; function swfWrite(swfFileName, swfWidth, swfHeight, swfHideRef) { var isSWF = swfFileName.substr(swfFileName.length - 4).toLowerCase() == '.swf' || swfFileName.substr(swfFileName.length - 8).toLowerCase() == '.unity3d'; flashGameAdvertWidth = swfWidth; flashGameAdvertHeight = swfHeight; document.write('
'); if (isSWF) document.write(''); else document.write(''); document.write(''); document.write('
'); document.write('
'); document.write("
"); document.write('
'); document.write('
'); document.write('
'); document.write('
'); document.write(''); } var flashGameAdvert = document.getElementById("flashgameadvert"); var flashGameAdvertProgress = document.getElementById("flashgameadvertprogress"); var flashGame = document.getElementById("flashgame"); var flashGameAdvertContent = document.getElementById("flashgameadvertcontent"); var flashFrame = document.getElementById("flashframe"); if (flashGameAdvert && flashGame && flashGameAdvertProgress && flashGameAdvertContent) { if (0) showFlash(); else { flashGameAdvertProgress.innerHTML = "
"; advertProgress = document.getElementById("advertprogress"); advertProgressPersent = document.getElementById("advertprogresspersent"); advertProgressText = document.getElementById("advertprogresstext"); if (advertProgress && advertProgressPersent && advertProgressText) advertIntervalId = setInterval(loadAdvert, 200); } } else showFlash(); function loadAdvert() { advertLoadPersent++; advertProgressPersent.style.width = advertProgress.clientWidth*advertLoadPersent/100 + "px"; advertProgressText.style.width = advertProgress.clientWidth + "px"; advertProgressText.innerHTML = "Загрузка... " + advertLoadPersent + "%"; if (advertLoadPersent == 100) { clearInterval(advertIntervalId); showFlash(); } } function showFlash() { if (flashGameAdvertContent) flashGameAdvertContent.style.display = "none"; if (flashGame) flashGame.style.display = "block"; if (flashFrame) { flashFrame.style.width = flashGameAdvertWidth; flashFrame.style.height = flashGameAdvertHeight; } }