﻿function doIAd(l,u,w,h){
    document.write("<table style=\"width:"+w+"px;\"><tr><td>");
    if(h == "88") {
        document.write("<img src=\"http://ads.mxgames.com/cmn/image/advertisement-" + h + ".gif\" />")
        document.write("</td><td>");
    } 
    document.write("<a target=\"_blank\" href=\"" + l + "\">");
    document.write("<img src=\"" + u + "\" border=\"0\" width=\""+w+"\" height=\""+h+"\" />")
    document.write("</a></td></tr>");
    if (h == "578") {
        document.write("<tr><td align=\"center\">Advertisement</td></tr>");
    }
    document.write("</table>");
}

function doFAd(id,u,w,h,v){

    var mp_swver = 0;
    var mp_pos = 0;
    var mp_html = "";
    if( navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin ) {
      if( navigator.plugins && navigator.plugins["Shockwave Flash"] ) {
        mp_pos = navigator.plugins["Shockwave Flash"].description.indexOf("Shockwave Flash");
        mp_swver = navigator.plugins["Shockwave Flash"].description.substr(mp_pos+16,1);
      }
    } else if ( navigator.userAgent && navigator.userAgent.indexOf("MSIE") >= 0 && ( navigator.userAgent.indexOf("Windows") >= 0 ) ) {
      document.write("<SCR"+"IPT LANGUAGE=VBScript>\n");
      document.write("on error resume next\n");
      document.write("For mp_i=11 To 6 Step -1\n");
      document.write("If Not IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" & mp_i)) Then\n");
      document.write("Else\n");
      document.write("  mp_swver=mp_i\n");
      document.write("  Exit For\n");
      document.write("End If\n");
      document.write("Next\n");
      document.write("</SCR"+"IPT> \n");
    }
    

    document.write("<div style=\"text-align:center;padding:5px;\"><table><tr><td>");
    
    if( mp_swver >= 6 ) {
      mp_html =  "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"\" id=\""+id+"\" name=\""+id+"\" width=\""+w+"\" height=\""+h+"\">";
      
      if( mp_swver > 5 ) {
        mp_html += "<param name=\"FlashVars\" value=\""+v+"\">";
        mp_html += "<param name=\"movie\" value=\""+u+"\">";
      } else {
        mp_html += "<param name=\"movie\" value=\""+u+"?"+v+"\">";
      }
      
      mp_html += "<param name=\"wmode\" value=\"opaque\">";
      
      if( mp_swver > 5 ) {
        mp_html += "<embed wmode=\"opaque\" name=\""+id+"\" src=\""+u+"\" FlashVars=\""+v+"\"";
      } else {
        mp_html += "<embed wmode=\"opaque\" name=\""+id+"\" src=\""+u+"?"+v+"\"";
      }
      
      mp_html += " swLiveConnect=\"FALSE\" width=\""+w+"\" height=\""+h+"\" type=\"application/x-shockwave-flash\" pluginspage=\"\">";
      mp_html += "</embed>";
      mp_html += "</object>";
      
      if( window.DocumentWrite) DocumentWrite(mp_html);
      else document.write(mp_html);
        
    } else if(!(navigator.appName && navigator.appName.indexOf("Netscape") >= 0 && navigator.appVersion.indexOf("2.") >= 0)) {}

    document.write("</td></tr></table>");
    document.write("</div>");
}
