for (var i = 3; i <= 9; i++) {
  eval('MM_VB_FlashCanPlay' + i + ' = 0;');
}

if (navigator.userAgent && navigator.userAgent.indexOf("MSIE") >= 0 && navigator.appVersion.indexOf("Win") != -1) {
  var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

  if (!plugin) {
    document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
    document.write('on error resume next \n');
    document.write('MM_VB_FlashCanPlay3 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")))\n');
    document.write('MM_VB_FlashCanPlay4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
    document.write('MM_VB_FlashCanPlay5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
    document.write('MM_VB_FlashCanPlay6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
    document.write('MM_VB_FlashCanPlay7 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7")))\n');
    document.write('MM_VB_FlashCanPlay8 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
    document.write('MM_VB_FlashCanPlay9 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9")))\n');
    document.write('</SCR' + 'IPT\> \n');
  }
}

function AVP_ActivateFlash (htmlCode) {
  document.writeln(htmlCode);
}

function AVP_ActivateFlashByVersion (flashCode, alternateCode, requiredVersion) {
  if (!alternateCode || alternateCode.length == 0) {
    document.writeln(flashCode);
  }

  else {
    var MM_contentVersion = requiredVersion;
    var MM_PluginVersion = 0;
    var MM_FlashCanPlay = 0;

    var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

    if (plugin) {
      var words = navigator.plugins["Shockwave Flash"].description.split(" ");

      for (var i = 0; i < words.length; ++i) {
        if (isNaN(parseInt(words[i]))) {
          continue;
        }

        MM_PluginVersion = words[i];
      }

      MM_FlashCanPlay = (MM_PluginVersion >= MM_contentVersion);
    }

    else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE") >= 0 && navigator.appVersion.indexOf("Win") != -1) {
      if (MM_VB_FlashCanPlay3 && requiredVersion <= 3) { MM_FlashCanPlay = 1; }
      else if (MM_VB_FlashCanPlay4 && requiredVersion <= 4) { MM_FlashCanPlay = 1; }
      else if (MM_VB_FlashCanPlay5 && requiredVersion <= 5) { MM_FlashCanPlay = 1; }
      else if (MM_VB_FlashCanPlay6 && requiredVersion <= 6) { MM_FlashCanPlay = 1; }
      else if (MM_VB_FlashCanPlay7 && requiredVersion <= 7) { MM_FlashCanPlay = 1; }
      else if (MM_VB_FlashCanPlay8 && requiredVersion <= 8) { MM_FlashCanPlay = 1; }
      else if (MM_VB_FlashCanPlay9 && requiredVersion <= 9) { MM_FlashCanPlay = 1; }
      else { MM_FlashCanPlay = 0; }
    }

    if (MM_FlashCanPlay) {
      document.writeln(flashCode);
    }

    else {
      document.writeln(alternateCode);
    }
  }
}


function processimgcode(theimg) { var imghtml = "";
if(theimg[1]!= "") { imghtml+='<a href="'+theimg[1]+'" title="" target="_blank">'; } else { imghtml += ""; }
penitis = new Image(); penitis.src = theimg[0];
imghtml+='<img src="'+penitis.src+'" alt="" style="border: solid 1px #ccc;" />';
if(theimg[1]!= "") { imghtml+='</a>'; } else { imghtml += ""; }
return imghtml;
}

function changeimage(slideindex){
document.getElementById("seqslide"+slideindex).innerHTML=processimgcode(seqslides[curimgindex]); curimgindex++;
if (curimgindex >= seqslides.length) { curimgindex = 0; }
}

function displayit() { if(curslide < slidestoreveal) { if(!isfirstcycle) { changeimage(curslide); } curslide++; }
else { isfirstcycle = 0; for (i=0; i < slidestoreveal; i++) { changeimage(0); curslide=1; } } }


function ttick(now_h, now_m, now_s)  {
    var t = document.getElementById('ttick');
    now_s += 1;
    if (now_s == 60) {
        now_s = 0;
        now_m += 1;
        if (now_m == 60) {
            now_m = 0;
            now_h += 1;
            if (now_h == 24) {
                now_h = 0;
            }
        }
    }
    if (t) {
        t.innerHTML = (now_h < 10 ? '0' : '') + now_h + ':' + (now_m < 10 ? '0' : '') + now_m + ':' + (now_s < 10 ? '0' : '') + now_s;
    }
    window.setTimeout('ttick()', 1000);
}
