function ObjectAD() {
  /* Define Variables*/
  this.ADID        = 0;
  this.ADType      = 0;
  this.ADName      = "";
  this.ImgUrl      = "";
  this.ImgWidth    = 0;
  this.ImgHeight   = 0;
  this.FlashWmode  = 0;
  this.LinkUrl     = "";
  this.LinkTarget  = 0;
  this.LinkAlt     = "";
  this.Priority    = 0;
  this.CountView   = 0;
  this.CountClick  = 0;
  this.InstallDir  = "";
  this.ADDIR       = "";
}

function BannerZoneAD(_id) {
  /* Define Constants */
  this.adNum       = 0;
  this.adDelay     = 6000;

  /* Define Common Variables*/
  this.ID          = _id;
  this.ZoneID      = 0;
  this.ZoneName    = "";
  this.ZoneWidth   = 0;
  this.ZoneHeight  = 0;
  this.ShowType    = 1;
  this.DivName     = "";
  this.Div         = null;

  /* Define Unique Variables*/

  /* Define Objects */
  this.AllAD       = new Array();
  this.ShowAD      = null;

  /* Define Functions */
  this.AddAD       = BannerZoneAD_AddAD;
  this.GetShowAD   = BannerZoneAD_GetShowAD;
  this.Show        = BannerZoneAD_Show;
  this.LoopShow    = BannerZoneAD_LoopShow;

}

function BannerZoneAD_AddAD(_AD) {
  this.AllAD[this.AllAD.length] = _AD;
}

function BannerZoneAD_GetShowAD() {
  if (this.ShowType > 1) {
    this.ShowAD = this.AllAD[0];
    return;
  }
  var num = this.AllAD.length;
  var sum = 0;
  for (var i = 0; i < num; i++) {
    sum = sum + this.AllAD[i].Priority;
  }
  if (sum <= 0) {return ;}
  var rndNum = Math.random() * sum;
  i = 0;
  j = 0;
  while (true) {
    j = j + this.AllAD[i].Priority;
    if (j >= rndNum) {break;}
    i++;
  }
  this.ShowAD = this.AllAD[i];
}

function BannerZoneAD_Show() {
  if (!this.AllAD) {
    return;
  } else {
    this.GetShowAD();
  }

  if (this.ShowAD == null) return false;
  this.DivName = "BannerZoneAD_Div" + this.ZoneID;
  if (!this.ShowAD.ImgWidth) this.ShowAD.ImgWidth = this.ZoneWidth
  if (!this.ShowAD.ImgHeight) this.ShowAD.ImgHeight = this.ZoneHeight
  if (this.ShowAD.ADDIR=="") this.ShowAD.ADDIR = "AD"
  if (this.ShowType == 3) {
    if(document.all) {
      document.write("<div id='" + this.DivName + "' style='visibility:visible; z-index:1; width:" + this.ZoneWidth + "px; height:" + this.ZoneHeight + "px; filter: revealTrans(duration=2,transition=20);'>" + AD_Content(this.ShowAD) + "</div>");
    }
    else {
      document.write("<div id='" + this.DivName + "' style='visibility:visible; z-index:1; width:" + this.ZoneWidth + "px; height:" + this.ZoneHeight + "px'>" + AD_Content(this.ShowAD) + "</div>");
    }
  } 
  else {
    document.write("<div id='" + this.DivName + "' style='visibility:visible; z-index:1; width:" + this.ZoneWidth + "px; height:" + this.ZoneHeight + "px;'>" + AD_Content(this.ShowAD) + "</div>");
    if (this.ShowAD.CountView) {
      document.write ("<script src='" + this.ShowAD.InstallDir + this.ShowAD.ADDIR + "/ADCount.asp?Action=View&ADID=" + this.ShowAD.ADID + "'></" + "script>")
    }
  }
  this.Div = document.getElementById(this.DivName);
  if (this.ShowType == 3) this.LoopShow();
}

function BannerZoneAD_LoopShow() {
  if(document.all) {
    if(this.adNum<this.AllAD.length-1) this.adNum++ ; 
    else this.adNum=0; 
    this.Div.filters.revealTrans.Transition=Math.floor(Math.random()*23); 
    this.Div.filters.revealTrans.apply(); 
    if (this.AllAD[this.adNum].ImgWidth) this.AllAD[this.adNum].ImgWidth = this.ZoneWidth
    if (this.AllAD[this.adNum].ImgHeight) this.AllAD[this.adNum].ImgHeight = this.ZoneHeight
    this.Div.innerHTML=AD_Content(this.AllAD[this.adNum]);
    this.Div.filters.revealTrans.play() 
    this.Div.timer=setTimeout(this.ID+".LoopShow()",this.adDelay);
  }
  else {
    if(this.adNum<this.AllAD.length-1) this.adNum++ ; 
    else this.adNum=0;
    if (this.AllAD[this.adNum].ImgWidth) this.AllAD[this.adNum].ImgWidth = this.ZoneWidth
    if (this.AllAD[this.adNum].ImgHeight) this.AllAD[this.adNum].ImgHeight = this.ZoneHeight
    this.Div.innerHTML=AD_Content(this.AllAD[this.adNum]);
    this.Div.timer=setTimeout(this.ID+".LoopShow()",this.adDelay);
  }
}

function AD_Content(o) {
  var str = "";
  if (o.ADType == 1 || o.ADType == 2) {
  imgurl = o.ImgUrl .toLowerCase()
    if (o.InstallDir.indexOf("http://") != - 1) imgurl = o.InstallDir.substr(0, o.InstallDir.length - 1) + imgurl;
    if (imgurl.indexOf(".swf") !=  - 1) {
      str = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0'";
      str += " name='AD_" + o.ADID + "' id='AD_" + o.ADID + "'";
      str += " width='" + o.ImgWidth + "px'";
      str += " height='" + o.ImgHeight + "px'";
      if (o.style) str += " style='" + o.style + "'";
      if (o.extfunc) str += " " + o.extfunc + " ";
      str += ">";
      str += "<param name='movie' value='" + imgurl + "'>";
      if (o.FlashWmode == 1) str += "<param name='wmode' value='Transparent'>";
      if (o.play) str += "<param name='play' value='" + o.play + "'>";
      if (typeof(o.loop) != "undefined") str += "<param name='loop' value='" + o.loop + "'>";
      str += "<param name='quality' value='autohigh'>";
      str += "<embed ";
      str += " name='AD_" + o.ADID + "' id='AD_" + o.ADID + "'";
      str += " width='" + o.ImgWidth + "px'";
      str += " height='" + o.ImgHeight + "px'";
      if (o.style) str += " style='" + o.style + "'";
      if (o.extfunc) str += " " + o.extfunc + " ";
      str += " src='" + imgurl + "'";
      if (o.FlashWmode == 1) str += " wmode='Transparent'";
      if (o.play) str += " play='" + o.play + "'";
      if (typeof(o.loop) != "undefined") str += " loop='" + o.loop + "'";
      str += " quality='autohigh'"
      str += " pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed>";
      str += "</object>";
    } else if (imgurl.indexOf(".gif") !=  - 1 || imgurl.indexOf(".jpg") !=  - 1 || imgurl.indexOf(".jpeg") !=  - 1 || imgurl.indexOf(".bmp") !=  - 1 || imgurl.indexOf(".png") !=  - 1) {
      if (o.LinkUrl) {
        if (o.CountClick) o.LinkUrl = o.InstallDir + o.ADDIR + "/ADCount.asp?Action=Click&ADID=" + o.ADID
        str += "<a href='" + o.LinkUrl + "' target='" + ((o.LinkTarget == 0) ? "_self" : "_blank") + "' title='" + o.LinkAlt + "'>";
      }
      str += "<img ";
      str += " name='AD_" + o.ADID + "' id='AD_" + o.ADID + "'";
      if (o.style) str += " style='" + o.style + "'";
      if (o.extfunc) str += " " + o.extfunc + " ";
      str += " src='" + imgurl + "'";
      if (o.ImgWidth) str += " width='" + o.ImgWidth + "px'";
      if (o.ImgHeight) str += " height='" + o.ImgHeight + "px'";
      str += " border='0'>";
      if (o.LinkUrl) str += "</a>";
    }
  } else if (o.ADType == 3 || o.ADType == 4) {
    str = o.ADIntro
  } else if (o.ADType == 5) {
    str = "<iframe id='" + "AD_" + o.ADID + "' marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no width=100% height=100% src='" + o.ADIntro + "'>wait</iframe>";
  }
  return str;
}


var ZoneAD_17 = new BannerZoneAD("ZoneAD_17");
ZoneAD_17.ZoneID      = 17;
ZoneAD_17.ZoneWidth   = 950;
ZoneAD_17.ZoneHeight  = 1;
ZoneAD_17.ShowType    = 1;

var objAD = new ObjectAD();
objAD.ADID           = 231;
objAD.ADType         = 4;
objAD.ADName         = "全部顶部导航";
objAD.ImgUrl         = "";
objAD.InstallDir     = "/";
objAD.ImgWidth       = 0;
objAD.ImgHeight      = 0;
objAD.FlashWmode     = 0;
objAD.ADIntro        = "<table cellSpacing=0 cellPadding=0 width=1002 align=center border=0>\n\r    <tr>\n\r      <td background=/Skin/2009xmxx/images_gongyong/xmxx2009_bg_all.gif>\n\r        <table cellSpacing=0 cellPadding=0 width=950 align=center border=0>\n\r          <tr>\n\r            <td height=8></td>\n\r          </tr>\n\r          <tr>\n\r            \n\r          <td align=middle> <object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"958\" height=\"198\">\n\r              <param name=\"movie\" value=\"/AD/sjyg960200.swf\">\n\r              <param name=\"quality\" value=\"high\">\n\r              <embed src=\"/AD/sjyg960200.swf\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"958\" height=\"198\"></embed></object></td>\n\r          </tr>\n\r          <tr>\n\r            \n\r          <td height=1></td>\n\r          </tr>\n\r        </table>\n\r        <table cellSpacing=0 cellPadding=0 width=950 align=center border=0>\n\r          <tr>\n\r            <td vAlign=center background=/Skin/2009xmxx/images_index/z00.gif height=39>\n\r              <table cellSpacing=0 cellPadding=0 width=\"98%\" align=center border=0>\n\r                <tr>\n\r                  <td vAlign=center align=middle><IFRAME id=UserLogin style=\"BACKGROUND-COLOR: transparent\" src=\"/UserLogin.asp?ShowType=2\" frameBorder=0 width=700 scrolling=no height=22 allowTransparency></IFRAME></td>\n\r                  <td vAlign=center align=middle width=\"6%\">{$Rss}</td>\n\r                </tr>\n\r              </table>\n\r            </td>\n\r          </tr>\n\r        </table>\n\r        <table height=92 cellSpacing=0 cellPadding=0 width=950 align=center border=0>\n\r          <tr>\n\r            <td width=10 background=/Skin/2009xmxx/images_index/2-01.gif height=92>\n\r            <P align=center></P></td>\n\r            <td width=272 background=/Skin/2009xmxx/images_index/2-01.gif><A href=\"http://www.ycxlrx.com/\" target=_self><IMG height=92 alt=江苏心理咨询网 src=\"/Skin/2009xmxx/logoycxlrx27290.gif\" width=272 border=0></A></td>\n\r            <td width=13><IMG height=92 src=\"/Skin/2009xmxx/images_index/2-03.gif\" width=13></td>\n\r            <td align=left width=640 background=/Skin/2009xmxx/images_index/2-04.gif><table cellSpacing=0 cellPadding=0 border=0 100%??>\n\r    <tr>\n\r      <td height=25><A href=\"/index.html\">网站首页</A> |  <A href=\"/xlzxzx/Index.html\">咨询中心</A> |  <A href=\"/psychedu/Index.html\">考试培训</A> |  <A href=\"/Soft/Index.html\" target=_blank>心理软件</A> |  <A href=\"/edu/Index.html\">教育心理</A> |  <A href=\"/szmed/Index.html\" target=_blank>婚姻心理</A> |  <A href=\"/smkxzn/Index.html\" target=_blank><FONT color=#990000>睡眠心理</FONT></A> |  <A href=\"/etxlzx/Index.html\" target=_blank><FONT color=#3300ff>儿童心理</FONT></A> |  <A href=\"Article/Index.html\" target=_blank>医学心理</A></td>\n\r    </tr>\n\r    <tr>\n\r      <td height=25><A href=\"/yypx/Index.html\" target=_blank>营养培训</A> | <A href=\"/zyxlzx/Index.html\" target=_blank> 企业心理</A> |  <A href=\"/softreg/\" target=_blank><FONT color=#009900>软件注册</FONT></A> |  <A href=\"/shxl/Index.html\">网瘾矫治</A> |  <A href=\"/xlcssoft/Index.html\">心理测验</A> |  <A href=\"/painmed/Index.html\" target=_blank>疼痛医学</A> |  <A href=\"/xlzxs/hyjtzxs.htm\"><FONT color=#000000>联系我们</FONT></A> |  <A href=\"/zxbm/index.asp\" target=_blank><FONT color=red>在线报名</FONT></A> |  <A href=\"/GuestBook/index.asp\" target=_blank>留言中心</A> </td>\n\r    </tr>\n\r  </table></td>\n\r            <td width=14 background=/Skin/2009xmxx/images_index/2-01.gif></td>\n\r          </tr>\n\r        </table>\n\r        <table cellSpacing=1 cellPadding=0 width=950 align=center bgColor=#999999 border=0>\n\r          <tr>\n\r            \n\r          <td bgColor=#ffffff>\n\r\n\r<script language=\"JavaScript\">\n\r<!--\n\rfunction objSP_Article() {this.ImgUrl=\"\"; this.LinkUrl=\"\"; this.Title=\"\";}\n\rfunction SlidePic_Article(_id) {this.ID=_id; this.Width=0;this.Height=0; this.TimeOut=5000; this.Effect=23; this.TitleLen=0; this.PicNum=-1; this.Img=null; this.Url=null; this.Title=null; this.AllPic=new Array(); this.Add=SlidePic_Article_Add; this.Show=SlidePic_Article_Show; this.LoopShow=SlidePic_Article_LoopShow;}\n\rfunction SlidePic_Article_Add(_SP) {this.AllPic[this.AllPic.length] = _SP;}\n\rfunction SlidePic_Article_Show() {\n\rif(this.AllPic[0] == null) return false;\n\rdocument.write(\"<div align=\'center\'><a id=\'Url_\" + this.ID + \"\' href=\'\'><img id=\'Img_\" + this.ID + \"\' style=\'width:\" + this.Width + \"; height:\" + this.Height + \"; filter: revealTrans(duration=2,transition=23);\' src=\'javascript:null\' border=\'0\'></a>\");\n\rif(this.TitleLen != 0) document.write(\"<br><span id=\'Title_\" + this.ID + \"\'></span></div>\");\n\rthis.Img = document.getElementById(\"Img_\" + this.ID);\n\rthis.Url = document.getElementById(\"Url_\" + this.ID);\n\rthis.Title = document.getElementById(\"Title_\" + this.ID);\n\rthis.LoopShow();\n\r}\n\rfunction SlidePic_Article_LoopShow() {\n\rif(this.PicNum<this.AllPic.length-1) this.PicNum++ ; \n\relse this.PicNum=0; \n\rthis.Img.filters.revealTrans.Transition=this.Effect; \n\rthis.Img.filters.revealTrans.apply(); \n\rthis.Img.src=this.AllPic[this.PicNum].ImgUrl;\n\rthis.Img.filters.revealTrans.play();\n\rthis.Url.href=this.AllPic[this.PicNum].LinkUrl;\n\rif(this.Title) this.Title.innerHTML=\"<a href=\"+this.AllPic[this.PicNum].LinkUrl+\" target=_blank>\"+this.AllPic[this.PicNum].Title+\"</a>\";\n\rthis.Img.timer=setTimeout(this.ID+\".LoopShow()\",this.TimeOut);\n\r}\n\r//-->\n\r</script>\n\r<script language=JavaScript>\n\rvar SlidePic_625 = new SlidePic_Article(\"SlidePic_625\");\n\rSlidePic_625.Width = 950;\n\rSlidePic_625.Height =90;\n\rSlidePic_625.TimeOut = 5000;\n\rSlidePic_625.Effect = 23;\n\rSlidePic_625.TitleLen = 20;\n\r\n\rvar oSP = new objSP_Article();\n\roSP.ImgUrl = \"/AD/UploadADPic/201006/2010062819191492.gif\";\n\roSP.LinkUrl = \"/xlzxs/xlzxs.htm\";\n\rSlidePic_625.Add(oSP);\n\r\n\rvar oSP = new objSP_Article();\n\roSP.ImgUrl = \"/AD/xlzxs95090.gif\";\n\roSP.LinkUrl = \"/xlzxs/xlzxs.htm\";\n\rSlidePic_625.Add(oSP);\n\r\n\r\n\rvar oSP = new objSP_Article();\n\roSP.ImgUrl = \"/ad/hyjtzxs95090.gif\";\n\roSP.LinkUrl = \"/xlzxs/hyjtzxs.htm\";\n\rSlidePic_625.Add(oSP);\n\r\n\rSlidePic_625.Show();\n\r\n\r</script>\n\r\n\r</td>\n\r          </tr>\n\r          <tr>\n\r            <td bgColor=#ffffff height=8>\n\r            <script language=\'javascript\' src=\'/ad/200601/12.js\'></script> </td>\n\r          </tr>\n\r        </table>\n\r      </td>\n\r    </tr>\n\r  </table>";
objAD.LinkUrl        = "";
objAD.LinkTarget     = 1;
objAD.LinkAlt        = "";
objAD.Priority       = 1;
objAD.CountView      = 1;
objAD.CountClick     = 0;
objAD.ADDIR          = "AD";
ZoneAD_17.AddAD(objAD);

ZoneAD_17.Show();
