<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="Mvcmode"%>
<%@ Import Namespace="Mvcbll"%>
var ad_theme="";
<%
    List<Mvc_ad> adlistleft = ViewData["adlistleft"] as List<Mvc_ad>;
    List<Mvc_ad> adlistright = ViewData["adlistright"] as List<Mvc_ad>;
    //可随机显示三个
    int adwidth = 0;
    int adheight = 0;
    
 string adfileleft1 = "";
 string adfileright1 = "";
 string adfileleft2= "";
 string adfileright2 = "";
 string adfileleft3 = "";
 string adfileright3 = "";
 string url1 = "";
 string url2 = "";
 string url3 = "";
 string right_url1 = "";
 string right_url2 = "";
 string right_url3 = "";
 string adfile = "";
 int i = 0;
 int k = 0;
 foreach (var ad in adlistleft)
  {
      i = i + 1;      
      adfile = Fun.Webdirectory + ad.Adfile;
      if (i == 1)
      {
          adwidth = ad.Adwidth;
          adheight = ad.Adheight;
          adfileleft1 = adfile;
          url1 =ad.Adlink;
      }
      else if (i == 2)
      {
          adfileleft2 = adfile;
          url2 = ad.Adlink;
      }
      else if (i == 3)
      {
          adfileleft3 = adfile;
          url3 = ad.Adlink;
      }
   }
 foreach (var ad in adlistright)
 {
     k = k + 1;
     if (k > 3)
         break;  
     adfile = Fun.Webdirectory + ad.Adfile;
     if (k == 1)
     {
         adwidth = ad.Adwidth;
         adheight = ad.Adheight;
         adfileright1 = adfile;
         right_url1 = ad.Adlink;
     }
     else if (k == 2)
     {
         adfileright2 = adfile;
         right_url2 = ad.Adlink;
     }
     else if (k == 3)
     {
         adfileright3 = adfile;
         right_url3 = ad.Adlink;
     }
     
 }
 if (i>0 && i==k){   //有广告上传并对称%>
var adsidewidth = <%=adwidth%>;
var adsideheight =<%=adheight%>;
var ad_theme = "<%=ViewData["webd"]%>Content/themes/dali/";
var adInfoTempDL =
{
<%
 string tempurl="";
 string tempurl_right = "";
 string templeft="";
 string tempright="";
 for (int j = 0; j < i; j++)
 {
    if (j == 0)
     {
        templeft= adfileleft1 ;
        tempright= adfileright1 ;
        tempurl=url1;
        tempurl_right = right_url1;
     }
     else if (i == 1)
     {
         templeft= adfileleft2 ;
         tempright= adfileright2 ;
         tempurl=url2;
         tempurl_right = right_url2;
     }
     else if (i == 2)
     {
         templeft= adfileleft3 ;
         tempright= adfileright3 ;
         tempurl=url3;
         tempurl_right = right_url3;
     }
 %>
    lsSrc1: "",
    rsSrc1: "",
    lbSrc1: "",
    rbSrc1: "",
    lgSrc1: "<%=templeft%>",
    rgSrc1: "<%=tempright%>",
    url1: "<%=tempurl%>",
    right_url1: "<%=tempurl_right%>",
    <%} %>
    loop: 1,
    top:202
}
<%} %>