﻿function EzShopAD(PositionID) {
    this.ID = PositionID;
    this.ADID = 0;
    this.ADType = "";
    this.ADName = "";
    this.ADContent = "";
    this.PaddingLeft = 0;
    this.PaddingTop = 0;
    this.Width = 0;
    this.Height = 0;
    this.IsHitCount = "N";
    this.UploadFilePath = "";
    this.URL = "";
    this.SiteID = 0;
    this.ShowAD = showADContent;
}

function showADContent() {
    var content = this.ADContent;
var content2=this.ADContent2;
    var str = "<div id='ZCMSAD_" + this.ADID + "' style='width:" + this.Width + "px; height:" + this.Height + "px; text-align:center; padding-bottom: -10px;'>";
   
    if (this.ADType == "image") {
 var AD = eval('(' + content + ')');
        str += "<a href='" + this.URL + "?SiteID=" + this.SiteID + "&ADID=" + this.ADID + "&URL=" + AD.Images[0].imgADLinkUrl + "' target='" + ((AD.imgADLinkTarget == "Old") ? "_self" : "_blank") + "'>";
        str += "<img title='" + AD.Images[0].imgADAlt + "' src='" + this.UploadFilePath + AD.Images[0].ImgPath + "' width='" + this.Width + "' height='" + this.Height + "' style='border:0px;'>";
        str += "</a>";
    } else if (this.ADType == "flash") {
AD = eval('(' + content2 + ')');  
        str += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='" + this.Width + "' height='" + this.Height + "' id='FlashAD_" + this.ADID + "'>";
        str += "<param name='movie' value='" + this.UploadFilePath + AD.Images + "' />";
        str += "<param name='quality' value='high' />";
        str += "<param name='wmode' value='transparent'/>";
        str += "<param name='swfversion' value='8.0.35.0' />";
        str += "<embed wmode='transparent' src='" + this.UploadFilePath + AD.Images + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + this.Width + "' height='" + this.Height + "'></embed>";
        str += "</object>";
    } else if (this.ADType == "text") {
        var MaxDisPlay = new Number(AD.MaxDisPlay);
        var Count = new Number(AD.Images.length);
        if (MaxDisPlay < Count) {
            AD.Images.length = AD.MaxDisPlay;
        }
        for (var i = 0; i < AD.Images.length; i++) {
            str += "<li><a href=" + this.URL + "?SiteID=" + this.SiteID + "&ADID=" + this.ADID + "&URL=" + AD.Text[i].textLinkUrl + " style='color:" + AD.Text[i].TextColor + ";' target='_blank' title='" + AD.Text[i].textContent + "'>" + AD.Text[i].textContent + "</a></li>";
        }
    }
    str += "</div>";
    
    document.write(str);
}

var ezshopAD_19 = new EzShopAD('ezshopAD_19');
ezshopAD_19.ADID = 19;
ezshopAD_19.ADType = "image";
ezshopAD_19.ADName = "手指幼儿园宣传2";
ezshopAD_19.ADContent = "{'Images':[{'imgADLinkUrl':'http://www.1248e.com/album/playifunnykids11.23/index.html','imgADAlt':'','ImgPath':'20111128035529635.jpg'}],'imgADLinkTarget':'New','Count':'1011','showAlt':'Y'}";
ezshopAD_19.ADContent2 = "{'Images':'{'imgADLinkUrl':'http://www.1248e.com/album/playifunnykids11.23/index.html','imgADAlt':'','ImgPath':'20111128035529635.jpg'}','imgADLinkTarget':'New','Count':'1011','showAlt':'Y'}";
ezshopAD_19.URL = "/hjjy/ADClick.aspx";
ezshopAD_19.SiteID = 206;
ezshopAD_19.Width = 624;
ezshopAD_19.Height = 96;
ezshopAD_19.UploadFilePath = "/uploadfiles/";
ezshopAD_19.ShowAD();
showADContent();
 
