<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%//以下获取logo
    string templogo = "";
    if (ViewData["Logo"] != null)
        templogo = ViewData["Logo"].ToString();
    else
        templogo = Data.Defautlogo;
    templogo = Fun.Webdirectory + templogo;
    if (ViewData["Logotype"].ToString() == "1")
        ViewData["Site_logo"] = "<script type=\"text/javascript\">mEmbed('src=" + templogo + "','width=270','height=60');</script>";
    else
        ViewData["Site_logo"] = "<img src=\"" + templogo + "\" alt=\"" + ViewData["Sitename"] + "\" />";
    
  string tempad = "";
  if (ViewData["adsrc"] != null)
  {
      switch (ViewData["adtype"].ToString())
      {
          case "0":
              tempad = "<img src=\"" + ViewData["adsrc"] + "\" alt=\"\"  />  ";
              break;
          case "1":
              if (ViewData["swfwidth"] != null)
                  tempad = "<script type=\"text/javascript\">mEmbed('src=" + ViewData["adsrc"] + "','width=" + ViewData["swfwidth"] + "','height=60');</script>";
              else
                  tempad = "<script type=\"text/javascript\">mEmbed('src=" + ViewData["adsrc"] + "','width=332','height=60');</script>";

              break;
          case "2":
              break;
          default:
              tempad = "<img src=\"" + ViewData["adsrc"] + "\" alt=\"\" height=\"60\" />  ";
              break;
      }
  }      
 %>
<%--顶部--%>
<%if (Fun.Isnews=="1")
  { %>
<div class="headerLinks"><%=ViewData["topmenu"]%></div>
<%} %>

<%--头部--%>
<div class="top_bar clearfix">
<div class="logo left"><a href="<%=ViewData["Weburl"]%>"><%=ViewData["Site_logo"]%></a></div>
<div class="topad right"><%=tempad %></div>
</div>

<%--导航--%>
<script type="text/javascript" src="<%=ViewData["webd"]%>Content/themes/default/js/dingyue.js"></script>
           <script type="text/javascript">
               function downfile() {
                   alert('本期暂未提供下载文件！');
               }
               function isParenttop(obj, pobj) {
                   while (obj && obj.tagName.toUpperCase() != 'BODY') {
                       if (obj == pobj)
                           return true;
                       obj = obj.parentNode;
                   }
                   return false;
               }

               var isout = false;
               $(document).ready(function () {
                   $("#dinghref").click(function () {
                       // $("#liuyan").css("display","block");
                       $("#email_subscription").slideDown();
                       isout = false;
                   });

                   $("#email_subscription").bind("mouseout", function (e) {
                       var flag = true;
                       if (isie)
                           flag = isParenttop(event.toElement, $(this)[0]);
                       else
                           flag = isParenttop(e.relatedTarget, $(this)[0]);
                       if (!flag) {
                           isout = true;
                       }
                   });
                   $("#email_subscription").bind("mouseover", function (e) {
                       var flag = true;
                       if (isie)
                           flag = isParenttop(event.toElement, $(this)[0]);
                       else
                           flag = isParenttop(e.relatedTarget, $(this)[0]);
                       if (flag) {
                           isout = false;
                       }
                   });
                   // $("div:not(#email_subscription)").click(function (e) {});
                   $(document).click(function (e) {
                       var flag = true;
                       if (isie)
                           flag = isParenttop(event.toElement, $("#email_subscription")[0]);
                       else
                           flag = isParenttop(e.relatedTarget, $("#email_subscription")[0]);
                       if (flag) {
                           isout = false;
                       }
                       if (isout) { $("#email_subscription").slideUp(); };
                   });

                   $("#dingsubmit").click(function () {
                       var dingsubmiturl="<%=ViewData["webd"]%>dingyue/dingyuesave";
                       var dingfromurl = "<%=ViewData["fromurl"]%>";  
                       dingsubmitsave(dingsubmiturl,dingfromurl, 0);            
                  });
               });
</script>

<div class="menutop clearfix">
     <div class="nowdate">今日&nbsp; <%=ViewData["today"]%></div>
     <%Html.RenderAction("Calendarqi", "Userinc", new {idate=ViewData["issuedate"]}); %>
     <div class="welcome">您好，欢迎阅读数字报刊！
      &nbsp;
      <div style="position:relative;display:inline;" id="dingli">
      <a href="javascript:void(0)" id="dinghref" rel="nofollow">在线订阅</a>
      <div class="email_subscription" id="email_subscription">
               邮件地址：<input type="text" name="s_email" id="s_email"  value="" />
               <img src="<%=ViewData["webd"]%>Content/themes/basic/images/ding.gif" width="84" height="29" id="dingsubmit" alt="马上订阅" />
               </div>
      </div>
     <a href="<%=ViewData["Webd"]%>search/advanced"><%=Data.Bkname%>检索</a>
     <a href="<%=ViewData["Webd"]%>review">[往期回顾]</a>
     </div>
     
</div>
