<% @ Language = vbscript EnableSessionState = False %>
<%
Option Explicit
Response.Buffer = True
%>

<%
Dim MLS,ID,RL 
MLS = Request.Querystring("MLS")
ID = Request.Querystring("ID")
RL = Request.Querystring("RL")

Dim objFSO,objFileTextStream
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFileTextStream = objFSO.OpenTextFile(Server.MapPath("/database/agents.txt"))


Dim strstart,stragentfirst,stragentlast,strrealitorabb,strrealitordesc,strgrouping
Dim stremail,strbus,strres,strpgr,dwStripe,Foundbol
Dim bgcolor,strLine,strmls,strprice,stragent,strLocation,strpricecat,strbedroom
Dim strbathroom,strpano,strpending

Do While objFileTextStream.AtEndOfStream <> TRUE
	strstart = Trim(Server.HTMLEncode(objFileTextStream.ReadLine))
if strstart = "TRUE" then
	strLine = Trim(Server.HTMLEncode(objFileTextStream.ReadLine))
	strLine = Split(strLine, "^")
If strLine(2) = RL  then
        stragentfirst = strLine(0)
        stragentlast = strLine(1)
	strrealitorabb = strLine(2)
	strrealitordesc = strLine(3)
	strgrouping =strLine(4)
	stremail = strLine(5)
	strbus = strLine(6)
	strres = strLine(7)
	strpgr = strLine(8)
end if
end if
Loop


If objFSO.FileExists(Server.MapPath(MLS & ".txt" )) Then
    
Dim objFolder3,objItem3
Dim count,i,showimage
count = 0 

Set objFolder3 = objFSO.GetFolder(Server.MapPath("/images/" & MLS & "/"))
showimage = "/webimages/loadback.jpg"
%>


<HTML>
<HEAD>
<TITLE>Notes <%=strrealitordesc%> / MLS#<%=MLS%></TITLE>
<style type="text/css">
A:link	{color: blue;}
A:visited	{color: blue;}
A:hover	{color: red;}
a{text-decoration:none}
</style>

<script language="JavaScript">
<!-- Hide from old browsers
//  Script Created by Scott Slinkard slinkard1@yahoo.com 12-29-99 

function goForit() {
  var completefile;  
  var name;
  name=<%=MLS%>
  completefile="/viewhome.asp?MLS=" + name
  place(completefile)  
}

function place(completefile) {
     opener.location.href=completefile
     theKeeper=window.close() 
 
} 
// End hiding --->
</SCRIPT>


</HEAD>
<body TEXT="#000000" BGCOLOR="#ffffff"   LINK="blue" VLINK="blue" ALINK="red"   marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" OnLoad="javascript:nextimg()">
<center>
<table border="0"  bgcolor="#ffffff" cellpadding="0" cellspacing="0" width="400">
<tr>
<td align="center" bgcolor="#ffffff" colspan="3">
<font face="arial"><b><small>Agent Notes for MLS#<%=MLS%></small></b></font></td>
</tr>
<tr>
<td align="center" bgcolor="#ffffff" colspan="3">
<font face="arial"><b><%=strrealitordesc%></b></font></td>
</tr>
<tr>
<td align="center" bgcolor="#f5f5eb" height="105"  colspan="3">
<%
Dim MyTextfile
 Set MyTextfile = objFSO.OpenTextFile(Server.MapPath(MLS & ".txt" ))
 WHILE NOT MyTextFile.AtEndOfStream
 Response.Write(MyTextFile.ReadLine & Chr(10))
 WEND
 MyTextFile.Close
%>
</td>
</tr>



<tr>
<td VALIGN="middle" ALIGN="Right" height="97">
<a href="" OnClick="previmg();return false;"><font  size="1"><b>Back</b></a></font></td>
<td VALIGN="middle" ALIGN="center" height="97">
<a href="javascript:goForit()"><img src="<%=showimage%>" name="image1" ALT="Click to View Inside MLS#<%=MLS%>" Border="0"  style="filter:revealTrans(duration=.5,transition=23)"></a></td>
<td VALIGN="middle" ALIGN="Left" height="97">
<a href="" OnClick="nextimg(); return false;"><font size="1"><b>Next</b></a></font></td>
</td>
</tr>




<tr>
<td align="center" bgcolor="#f5f5eb" colspan="3">
<font face="arial" size="2"><b><a href="javascript:goForit()">View Inside</b></a></font></td>
</tr>
<tr>
<td align="center" bgcolor="#ffffff" colspan="3">
<%

 Response.Write("<b>Contact:&nbsp;&nbsp;" & stragentfirst & " " & stragentlast & "</b><br>" & chr(13))
%>
</td>
</tr>
<tr>
<td align="center" bgcolor="#ffffff" colspan="3">
<%
 Response.Write("<font size=1><b>Buisness:" & "&nbsp;&nbsp;" & strbus & "</b></font><br>" & chr(13))
 Response.Write("<font size=1><b>Res:" & "&nbsp;&nbsp;" & strres & "</b></font><br>" & chr(13))
 Response.Write("<font size=1><b>Pgr/Mbl:" & "&nbsp;&nbsp;" & strpgr & "</b></font><br>" & chr(13))
 Response.Write("<font size=1><b>Email:" & "&nbsp;&nbsp;<a href=" & chr(34) & "mailto:" & stremail & chr(34) & ">" & stremail & "</a></b></font><br>" & chr(13))


else
 Response.Write("No Notes currently added, or current record is missing")
end if


objFileTextStream.Close
Set objFSO = Nothing
%>
</td>
</tr>
</table>
<font face="arial" size="1" color="black"><b>2000-2001 Houseviewonline.com</b></font>
</center>

<script language="JavaScript">
<!-- Hide from old browsers
// Copyright © 2000 Scott Slinkard
// Created by Scott Slinkard
//  http://www.houseviewonline.com
        var i = 1
        var images = new Array()

<%
For Each objItem3 In objFolder3.Files
for i = 1 to 19 step 1
if Left(UCase(objItem3.Name),3) = "OUT"  and count < 19 then
	If UCase(objItem3.Name) =  Left(UCase(objItem3.Name),5) & "0" & i & ".JPG" OR  UCase(objItem3.Name) =  Left(UCase(objItem3.Name),5) & i & ".JPG" then
%>
        images[<%=i%>] = "/images/<%=MLS%>/<%=objItem3.Name%>"
<%
count = count + 1
showimage = "/images/" & MLS & "/" & objItem3.Name
foundbol = "True"
end if
end if

Next
Next

If Foundbol <> "True" then 
showimage = "/webimages/hvlogosmall.gif"
count = 4
%>
images[1] = "/webimages/hvlogosmall.gif"
images[2] = "/webimages/hvlogosmall.gif"
images[3] = "/webimages/hvlogosmall.gif"
images[4] = "/webimages/hvlogosmall.gif"
<% End if %>

var preloadedimages=new Array()
for (s=0;s<images.length;s++){
preloadedimages[s]=new Image()
preloadedimages[s].src=images[s]
}

function applyeffect(){
if (document.all){
image1.filters.revealTrans.Transition=12
image1.filters.revealTrans.stop()
image1.filters.revealTrans.apply()
}
}
function playeffect(){
if (document.all)
image1.filters.revealTrans.play()
}

function previmg(){
        if (i != 1){
                applyeffect()
                document.image1.src = images[i-1]
                i--
                playeffect()
                document.title = i + "/<%=count%>" + " Notes <%=strrealitordesc%> / MLS#<%=MLS%>"             
        }
}

function nextimg(){
        if (i != <%=count%>){ 
                applyeffect()
                document.image1.src = images[i+1]
                i++
                playeffect()
                document.title = i + "/<%=count%>" + " Notes <%=strrealitordesc%> / MLS#<%=MLS%>" 
        }
}

// -- End Hiding Here -->
</script>

</body>
</html>