<%
If 	Session("statmentor_date1") = "" Then
	Response.Redirect "selectperiod.asp"
End If
%>
<!--#include file="incstats.asp"-->
<!--#include file="menu.inc"-->
<!--#include Virtual="/common/config.inc"-->
<html>

<head>
<%

%>



<title><%=strtitle%></title>
<style type="text/css">
<!--
     body {  font-family: Arial, Geneva, Helvetica, Verdana; font-size: smaller; color: #000000}
     td {  font-family: Arial, Geneva, Helvetica, Verdana; font-size: smaller; color: #000000}
     th {  font-family: Arial, Geneva, Helvetica, Verdana; font-size: smaller; color: #000000}
     A:link {text-decoration: none;}
     A:visited {text-decoration: none;}
     A:hover {text-decoration: underline;}
-->
</style>
</head>

<body>

<table align="center" bgColor="#003399" border="0" cellPadding="3" cellSpacing="0" height="100%" width="100%">
  <tbody>
    <tr>
      <td vAlign="top" width="50%" height="60">
      <b><font color="#ECECD9" face="verdana,arial,helvetica" size="1"><%=straddress%></font></b>
      </td>
      <td vAlign="top" width="468" height="60">
      <b><font color="#FFFFFF" face="verdana,arial,helvetica" size="+2"><%=strtitle%> Stats</font></b>
      </td>
    </tr>
    <tr>
      <td height="100%" vAlign="top" width="100%" colspan="2">
        <table align="center" bgColor="#ffffff" border="0" cellPadding="0" cellSpacing="0" height="100%" width="100%">
          <tbody>
            <tr>
              <td height="100%" vAlign="top" width="85%">
                <table bgColor="#ffffff" border="0" cellPadding="10" cellSpacing="0" height="100%" width="100%">
                  <tbody>
                    <tr>
                      <td align="left" height="100%" vAlign="top" width="65%">
                        <table border="0" width="100%">
                          <tr>
                            <td width="50%"><b><font color="#aa3333" face="verdana,arial,helvetica" size="4">Referers</font></b>
                             
                            </td>
                            <td width="50%">
                            <b>
                            Selected period</b><br>
                            From: <%
                            If Session("statmentor_date1")<> "" Then 
                            	Response.Write Session("statmentor_date1") 
                            End If%><br>
                            To: <%
                            If Session("statmentor_date2")<> "" Then 
                            	Response.Write Session("statmentor_date2") 
                            End If%>
                            </td>
                          </tr>
                        </table>
                        <font color="#aa3333" face="verdana,arial,helvetica" size="+2">
                        <hr color="#000066" noShade SIZE="1">
                             
                        </font>
                             
                        <table border="0" width="100%">
                          <tr>
                            <td width="120" valign="top">
                              <%StatWriteMenu%></td>
                            <td width="70%">
                             
                        <b><font size="3">Referer by actual page</font></b><br>
                        <table border="1">
                          <tr>
                            <td bgcolor="#ECECD9"><b>Page</b></td>
                            <td bgcolor="#ECECD9"><b>Count</b></td>
                          </tr>
<%
Dim oDict, oKey, nSum
nSum = 0
Set oDict = GetRefererCount(Session("statmentor_date1") , Session("statmentor_date2") )
For Each oKey In oDict.Keys 
%>                          
                          <tr>
                            <td><a href="<%=oKey%>" TARGET=_blank><%=oKey%></a></td>
                            <td><% Response.Write oDict.Item(oKey)
    nSum = nSum + oDict.Item(oKey)
    %></td>
                          </tr>
<%Next%>  
  <tr>
    <td><b>SUM</b></td>
    <td><b><%=nSum%></b></td>
  </tr>
                        </table>
                        <b><font size="3">Referer by domain</font></b><br>
                        <table border="1">
                          <tr>
                            <td bgcolor="#ECECD9"><b>Domain</b></td>
                            <td bgcolor="#ECECD9"><b>Count</b></td>
                          </tr>
<%
nSum = 0
Set oDict = DomainRefFromPageRef(oDict)
For Each oKey In oDict.Keys 
%>                          
                          <tr>
                            <td><a href="http://<%=oKey%>" TARGET=_blamk><%=oKey%></a></td>
                            <td><% Response.Write oDict.Item(oKey)
    nSum = nSum + oDict.Item(oKey)
    %></td>
                          </tr>
<%Next%>  
  <tr>
    <td><b>SUM</b></td>
    <td><b><%=nSum%></b></td>
  </tr>
                        </table>
                             
</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </td>
            </tr>
          </tbody>
        </table>
      </td>
    </tr>
  </tbody>
</table>

</body>

</html>
