<!--#include virtual="/includes/topofpage.asp"-->
<% ' EWEBEDIT - TOP OF PAGE - START' %>
<%
	'Number of eweb elements on the page, modify
		Const Max_Eweb = 1
								'eweb code, don't modify
								'Dim Hidden(50,2)
								Redim Hidden(Max_Eweb, 2)
								%><!--#include file = "includes/ewebtop.asp"-->
<% ' EWEBEDIT - TOP OF PAGE - END' %>
<%
	Set Conn = Server.CreateObject("ADODB.Connection")
	Conn.Open "DRIVER={SQL Server};SERVER=WEBSRV01;UID=web;pwd=w3bs1t3;DATABASE=AVANTE"

'eweb
'This is the code to retrieve the item and convert all characters back to original, required:
'Replace(Replace(Replace(Request.Form("InputName"), "\'", "'"), "'", "''"), "\script", "script")

%>

<!-- #include file="db-common.asp" -->
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!--<script language="JavaScript">
-
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

</script> -->
<link rel="stylesheet" href="/arrivares.css" type="text/css">
<link rel="stylesheet" href="/Style-sheets/bullet-List.css" type="text/css">
<STYLE>
BODY {SCROLLBAR-FACE-COLOR: #5e5ebe; SCROLLBAR-HIGHLIGHT-COLOR: #5e5ebe; SCROLLBAR-SHADOW-COLOR: #5e5ebe; SCROLLBAR-3DLIGHT-COLOR: #5e5ebe; SCROLLBAR-ARROW-COLOR:  #6666CC; SCROLLBAR-TRACK-COLOR: #E3E3E3; SCROLLBAR-DARKSHADOW-COLOR: #666666; }
</STYLE>

<style type="text/css">

   </style>

<link rel="stylesheet" href="/Style-sheets/scroll-boxes.css" type="text/css">
<link rel="stylesheet" href="/Style-sheets/scroll-boxes.css" type="text/css">
<script language="JavaScript">
<!--
function MM_changeProp(objName,x,theProp,theValue) { //v3.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}

function frmrequest(Inquiry_ID, Request_ID, Act) {
	formreq.action="message-que.asp#req";
	formreq.Act.value = Act;
	formreq.Inquiry_ID.value = Inquiry_ID;
	formreq.Request_ID.value = Request_ID;
	formreq.submit();
}

function frmpreview() {
	previewsubmit.submit();
}

//-->
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="jsClockTimeZonecst(); jsClockTimeZonepst(); jsClockTimeZoneest();">
<form name="formreq" id="formreq" action="message-que.asp" method="post">
<input type="hidden" name="Inquiry_ID" value="">
<input type="hidden" name="Request_ID" value="">
<input type="hidden" name="Act" value="">
</form>

<div id="bckgrnd" style="position:absolute; width:200px; height:366px; z-index:1; left: 0px; top: 270px; overflow: visible; background-image: url(/images/bckgrnd.jpg); layer-background-image: url(/images/bckgrnd.jpg); border: 1px none #000000; visibility: hidden"></div>
<!--#include virtual="/includes/toolbar-partner.asp" -->



<%'-- ******************************************* Process Response %>

<% If Not Request("Request_ID") = "" And Not Request("Inquiry_ID") = "" And lcase(Request("Act")) = "process" Then%>
<div id="processDisplay" style="position:absolute; width:687px; height:119px; z-index:9; left: 248px; top: 110px; visibility: visible"  align="right"> 
  <form name="form1" method="post" action="message-que.asp">
<a name="req">

<%

Message = Trim(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Request("Response"), Chr(13), ""), Chr(10), ""), "ewebquot;", """"), "ewebsquot;", "'"), "ewebpound;", "#"), "ewebamp;", "&"), "ewebquest;", "?"))
		Set myMail = Server.CreateObject("CDONTS.NewMail")

		myMail.Subject=Request("Addresses_Re")
		  myMail.From=Request("Addresses_From")
		  myMail.Body=Message
		  myMail.BodyFormat=0
		  myMail.MailFormat=0
		  myMail.To = Request("Addresses")
		  
		myMail.Bcc = "monitor@emagineering.com"
		myMail.Send
		set mymail=nothing

SQL = "Add_Inquiry_Response @Inquiry_ID = '" & Replace(Request("Inquiry_ID"), "'", "''''") & "', @Realm_ID = '" & Replace(Session("Realm_ID"), "'", "''''") & "', @CSR_ID = '" & Replace(Session("CSR_ID"), "'", "''''") & "', @Request_ID = '" & Replace(Request("Request_ID"), "'", "''''") & "', @Response_Copy = '" & Replace(Message, "'", "''''") & "'"
' a little note... as this query is being passed through multiple procedures, it needs 4 's instead of 2
'Response.Write SQL
Conn.Execute (SQL)

%>
<Br><br>
Your response has been processed.
<br><br>
<input type="submit" name="submit" value="Click here to continue">&nbsp;

  </form>
</div>
<% End If %>


<%'-- ******************************************* Preview Response %>

<% If Not Request("Request_ID") = "" And Not Request("Inquiry_ID") = "" And lcase(Request("Act")) = "preview" Then%>
<div id="previewDisplay" style="position:absolute; width:687px; height:119px; z-index:9; left: 248px; top: 110px; visibility: visible"  align="right"> 
<a name="req">
<% 
'MsgResponse = Trim(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Request("Response"), Chr(13), ""), Chr(10), ""), """", "ewebquot;"), "'", "ewebsquot;"), "#", "ewebpound;"), "&", "ewebamp;"), "?", "ewebquest;"))
%>
<%
set objFS = Server.CreateObject("Scripting.FileSystemObject")
Set Template = ObjFS.OpenTextFile("d:\web sites\arrivares\partner\documents\rvonthegoltrhd.htm", 1, False, 0)
Message = Template.ReadAll
Message = Replace(Message, "{Response}", Request("Response"))
Message = Replace(Message, "{From}", Request("Addresses_From"))
Message = Replace(Message, "{To}", Request("Addresses_Name"))
Message = Replace(Message, "{Re}", Request("Addresses_Re"))
Message = Replace(Message, "{Date}", Date)

%>


  <% ' Start of Eweb code chunk
			
		' Variables, modify
			Content =	Message			'Edit Contents
			Title	=	""			'Edit Title
			FNum	=	"1"			'Frame Object Name
			TName	=	"Response"		'Input Object Name
			FHeight	=	"480"			'Frame Height
			FWidth	=	"578"			'Frame Width
			FBorder	=	"0"			'Frame Border
			FScroll	=	"no"			'Frame Scrollbar
			EditWin	=	True			'Show the edit window.. False takes you right into eweb..
			Config	=	"inquiryman.xml"	'Config file, blank defaults to config.xml -- found in ewebedit directory
			JS	=	"http://www.arrivares.com/partner/includes/eweb-inquiry.js"
		%><div align="left"><input type="submit" name="submit" onClick="form1.submit();" value="Process this Response"></div><!--#include file="includes/ewebcomp.asp"-->
		<% ' End of Eweb code chunk %>

  <form name="form1" method="post" action="message-que.asp">
	<input type="hidden" name="Act" value="Process">
	<input type="hidden" name="Inquiry_ID" value="<%=Request("Inquiry_ID")%>">
	<input type="hidden" name="Request_ID" value="<%=Request("Request_ID")%>">
	<input type="hidden" name="Addresses_Re" value="<%=Request("Addresses_Re")%>">
	<input type="hidden" name="Addresses_From" value="<%=Request("Addresses_From")%>">
	<input type="hidden" name="Addresses_Name" value="<%=Request("Addresses_Name")%>">
	<input type="hidden" name="Addresses" value="<%=Request("Addresses")%>">

<% ' EWEBEDIT - INSIDE OF FORM - START' %>
<!--#include file="includes/ewebform.asp"-->
<% ' EWEBEDIT - INSIDE OF FORM - END' %>
  </form>
</div>
<% End If %>

<%'-- ******************************************* Request %>

<% If Not Request("Request_ID") = "" And Not Request("Inquiry_ID") = "" And lcase(Request("Act")) = "request" Then%>
<div id="previewDisplay" style="position:absolute; width:687px; height:119px; z-index:9; left: 248px; top: 110px; visibility: visible"  align="left"> 
  <form name="form1" method="post" action="message-que.asp">
<a name="req">
    <table width="98%" border="0" cellspacing="0" cellpadding="0" bgcolor="#ffffff">
      <tr> 
        <td valign="top" align="left" height="63"><img src="/images/composer-nav.jpg" usemap="#composernav" border="0" width="595" height="75"> 
          <map name="composernav"> 
            <area shape=RECT coords="16,14,102,29" href="#req"  alt="Attractions" onClick="MM_showHideLayers('GroupList','','show')">
            <area shape=RECT coords="170,15,256,31" href="#req"  alt="Events" onClick="MM_showHideLayers('GroupList','','show')">
            <area shape=RECT coords="16,43,102,58" href="#req"  alt="Availability" onClick="MM_showHideLayers('GroupList','','show')">
            <area shape=RECT coords="170,43,256,58" href="#req"  alt="Coupons" onClick="MM_showHideLayers('GroupList','','show')">
            <area shape=RECT coords="324,15,410,30" href="#req"  alt="Rallies" onClick="MM_showHideLayers('GroupList','','show')">
            <area shape=RECT coords="323,43,410,57" href="#req"  alt="Profile" onClick="MM_showHideLayers('GroupList','','show')">
            <area shape=RECT coords="478,43,564,58" href="javascript:frmpreview();"  alt="Preview this E-Mail" onClick="frmpreview();">
          </map>
        </td>
      </tr>
    </table>
<%
SQL = "Select * from Inquiry Where Inquiry_ID='" & Request("Inquiry_ID") & "'"
Set Inq = Conn.Execute(SQL)

SQL = "Select * from [Inquiries].[dbo].[Request_" & Request("Inquiry_ID") & "] where Request_ID='" & Request("Request_ID") & "'"
DBConnect(SQL)

If Not objRS.EOF Then

	SQL = "Get_Contact @Contact_ID='" & objRS("Contact_ID") & "'"
	'Response.Write SQL
	Set RSContact = Conn.Execute(SQL)

	Name_Prefix = RSContact("Name_Prefix")
	Name_First = RSContact("Name_First")
	Name_Pref = RSContact("Name_Pref")
	Name_MI = RSContact("Name_MI")
	Name_Last = RSContact("Name_Last")
	Name_Suffix = RSContact("Name_Suffix")
	Title = RSContact("Title")
	DOB = RSContact("DOB")
	Gender = RSContact("Gender")
	Address_1 = RSContact("Address_1")
	Address_2 = RSContact("Address_2")
	City = RSContact("City")
	State = RSContact("State")
	Zip = RSContact("Zip")
	Zip_4 = RSContact("Zip_4")
	Country = RSContact("Country")
	Phone_HM_Areacode = RSContact("Phone_HM_Areacode")
	Phone_HM = RSContact("Phone_HM")
	Pager_AreaCode = RSContact("Pager_AreaCode")
	Pager = RSContact("Pager")
	Mobile_AreaCode = RSContact("Mobile_AreaCode")
	Mobile = RSContact("Mobile")
	Fax_WK_AreaCode = RSContact("Fax_WK_AreaCode")
	Fax_WK = RSContact("Fax_WK")
	Phone_WK_Areacode = RSContact("Phone_WK_Areacode")
	Phone_WK = RSContact("Phone_WK")
	Phone_WK_Ext = RSContact("Phone_WK_Ext")
	Web = RSContact("Web")
	EMail_Home = RSContact("EMail_Home")
	EMail_Work = RSContact("EMail_Work")
	EMail_Other = RSContact("EMail_Other")
	Addresses_Re = Inq("Inquiry_Name")
	Addresses_From = "Rachael Doyle <rdoyle@encorefl.com>"

%>
<div class="lodging-hdln" style=" { width:578; text-align:right; } ">
Inquiry #: <%=Request("Inquiry_ID")%>-<%=objRS("Contact_ID")%>-<%=Request("Request_ID")%>
</div>
    <table width="587" border="0" cellspacing="0" cellpadding="0">
<% If Not Name_First = "" Or Not Name_Last = "" Then %>
	<% Addresses_Name = Name_First & " "  & Name_Last %>
      <tr> 
        <td width="291" class="lodging-hdln"><%=Name_Prefix%>&nbsp;<%=Name_First%><% If Not Name_Pref = "" Then Response.Write "(" & Name_Pref & ")"%>&nbsp;<%=Name_MI%>&nbsp;<%=Name_Last%>&nbsp;<%=Name_Suffix%></td>
        <td width="343">&nbsp;</td>
      </tr>
<% Else %>
      <tr> 
        <td colspan="2" class="lodging-hdln">This inquiry has incomplete contact information.</td>
      </tr>
<% End If %>
      <tr> 
        <td colspan="2" class="1p-rule5e5ebe">&nbsp;</td>
      </tr>
      <tr> 
        <td width="291" class="mssg-que-list">
<% If Not Address_1 = "" Then %>
	<%=Address_1%><br>
<% End If %>
<% If Not Address_2 = "" Then %>
	<%=Address_2%><br>
<% End If %>
<% If Not City = "" And Not State = "" Then %>
<%=City%>, <%=State%><br>
<% End If %>
<%=ZIP%><% If Not Zip_4 = "" And Not Zip_4 = "0" Then %>-<%=Zip_4%><% End If %></td>
        <td valign="top"> 
          <table width="100%" border="0" cellspacing="0" cellpadding="0" align="right">
<% If Not Phone_HM = "" And Not Phone_HM = "0" Then %>
            <tr> 
              <td class="transaction-GT">Phone(HM):</td>
              <td class="mssg-que-list" colspan="2"><% If Not Phone_HM_AreaCode = "" And Not Phone_HM_AreaCode = "0" Then %>(<%=Phone_HM_AreaCode%>)<% End If %> <% If Not Phone_HM = "" And Not Fax_WK = "0" Then %><%=Phone_HM%><% End If %></td>
            </tr>
<% End If %>
<% If Not Phone_WK = "" And Not Phone_WK = "0" Then %>
            <tr> 
              <td class="transaction-GT">Phone(WK):</td>
              <td class="mssg-que-list" colspan="2"><% If Not Phone_WK_AreaCode = "" And Not Phone_WK_AreaCode = "0" Then %>(<%=Phone_WK_AreaCode%>)<% End If %> <% If Not Phone_WK = "" And Not Fax_WK = "0" Then %><%=Phone_WK%><% End If %></td>
            </tr>
<% End If %>
<% If Not Fax_WK = "" And Not Fax_WK = "0" Then %>
            <tr> 
*              <td class="transaction-GT">Fax(WK):</td>
              <td class="mssg-que-list" colspan="2"><% If Not Fax_WK_AreaCode = "" And Not Fax_WK_AreaCode = "0" Then %>(<%=Fax_WK_AreaCode%>)<% End If %> <% If Not Fax_WK = "" And Not Fax_WK = "0" Then %><%=Fax_WK%><% End If %></td>
            </tr>
<% End If %>
<% If (Fax_WK = "" Or Fax_WK = "0") And (Phone_WK = "" Or Phone_WK = "0") And (Phone_HM = "" Or Phone_HM = "0") Then %>
            <tr> 
              <td class="transaction-GT" colspan="2">No Phone Details Provided.</td>
            </tr>
<% End If %>
<% If Not EMail_Home = "" Then %>
	<% Addresses = Addresses & EMail_Home & ";" %>
            <tr> 
              <td class="transaction-GT">E-mail:</td>
              <td class="mssg-que-list" colspan="2"><%=EMail_Home%></td>
            </tr>
<% End If %>
<% If Not EMail_Work = "" Then %>
	<% Addresses = Addresses & EMail_Home & ";" %>
            <tr> 
              <td class="transaction-GT">E-mail:</td>
              <td class="mssg-que-list" colspan="2"><%=EMail_Work%></td>
            </tr>
<% End If %>
<% If Not EMail_Other = "" Then %>
	<% Addresses = Addresses & EMail_Home & ";" %>
            <tr> 
              <td class="transaction-GT">E-mail:</td>
              <td class="mssg-que-list" colspan="2"><%=EMail_Other%></td>
            </tr>
<% End If %>
<% If (Email_Other = "" Or Email_Other = "0") And (EMail_Work = "" Or EMail_Work = "0") And (EMail_Home = "" Or EMail_Home = "0") Then %>
            <tr> 
              <td class="transaction-GT" colspan="2">No E-Mail Details Provided.</td>
            </tr>
<% End If %>
          </table>
        </td>
      </tr>
      <tr> 
        <td colspan="2" class="mssg-que-list"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td valign="top" colspan="2"><table border="0" cellspacing="0" cellpadding="0" width="100%">
<%
	Cnt = 0
	For each objField in objRS.Fields

		If 	Not trim(lcase(objField.Name)) = "request_id" _
			And Not trim(lcase(objField.Name)) = "inquiry_id" _
			And Not trim(lcase(objField.Name)) = "realm_id" _
			And Not trim(lcase(objField.Name)) = "csr_id" _
			And Not trim(lcase(objField.Name)) = "request_status" _
			And Not trim(lcase(objField.Name)) = "comments" _
			And Not trim(lcase(objField.Name)) = "contact_id" _
			And Not trim(lcase(objField.Name)) = "user_id" _
			And Not trim(lcase(objField.Name)) = "affiliate_id" _
		Then
			val = objRS(objField.Name)
			if val = "" or isNull(val) = True Then val = "N/A or No"
			if val = True Then val = "Yes"
			if val = False Then val = "No"

			  If (Cnt Mod 2) Then
				Response.Write "<td class=""transaction-GT"">" & Replace(objField.Name, "_", " ") & ": </td><td class=""mssg-que-list"">" & val & "</td></tr>"
			  Else
				Response.Write "<tr><td class=""transaction-GT"">" & Replace(objField.Name, "_", " ") & ": </td><td class=""mssg-que-list"">" & val & "</td>"
			  End If

  		  	Cnt = Cnt + 1

		End If

	Next
If (Cnt Mod 2) Then
	Response.Write "<td>&nbsp;</td>"
End IF
%>
</tr></table></td></tr>

<%
	objRS.MoveFirst()
	Contact_ID = objRS("Contact_ID")
	For each objField in objRS.Fields
		If trim(lcase(objField.Name)) = "comments" Then

%>
	<!--            <tr> 
	              <td class="transaction-GT">Topic:</td>
	              <td class="mssg-que-list" colspan="2"> Sunburst RV Park-Orange City</td>
	            </tr>
	            <tr> 
	              <td class="transaction-GT">Arrival:</td>
	              <td valign="middle"> 
	                <input name="rateDisplay226"  value="12/31/02""style="border-style:none;  " size="9" class="mssg-que-list">
	              </td>
	              <td class="transaction-GT" valign="middle">Departure: 
	                <input name="rateDisplay2262"  value="05/28/02"style="border-style:none; " size="9" class="mssg-que-list">
	             </td>
	            </tr>
	-->
	            <tr> 
	              <td class="transaction-GT" colspan="2"><br>
						<table border="0" cellspacing="0" cellpadding="0" bgcolor="#5e5ebe" class="box-padding2px" width="367">
							<td align="left" class="mssg-que-label"><font color="#ffffff">&nbsp;Comments:<br></font>
					             <textarea name="comments" readonly="readonly" style="border-style:none; " cols="80"  rows="5" wrap="VIRTUAL" class="box-padding2px"><%=objRS("Comments")%></textarea>
							</td>
						</table>
	              </td>
	            </tr>
</table>
<%
	   	End If

	Next
End If

%>            
	              </td>
	            </tr>
          </table>
        </td>
      </tr>
    </table>

</form>
<a name="enlarge">
<div id="floatframe" style="position:relative; text-align:top: left: 1px; top: 1px; width: 595; height: 200px; overflow: auto; visibility: visible; z-index: 2;"> 

<% If Len(strErrMsg) > 0 Then %>
<br><br>
<font face="Arial,Helvetica" color=red size=2><b><% =strErrMsg %></b></font>
<% Else %>
  <% ' Start of Eweb code chunk
			
		' Variables, modify
			Content =	strContent		'Edit Contents
			Title	=	""			'Edit Title
			FNum	=	"1"			'Frame Object Name
			TName	=	"Response"		'Input Object Name
			FHeight	=	"100%"			'Frame Height
			FWidth	=	"100%"			'Frame Width
			FBorder	=	"0"			'Frame Border
			FScroll	=	"no"			'Frame Scrollbar
			EditWin	=	True			'Show the edit window.. False takes you right into eweb..
			Config	=	"inquiryman.xml"	'Config file, blank defaults to config.xml -- found in ewebedit directory
			JS	=	"http://www.arrivares.com/partner/includes/eweb-inquiry.js"
		%><!--#include file="includes/ewebcomp.asp"-->
		<% ' End of Eweb code chunk %>
<% End If %>
</div>
<a href="#enlarge" onClick="floatframe.style.height='500px';">Enlarge the Response Window</a>
<form name="previewsubmit" id="previewsubmit" method="post" value="" action="#req">
<input type="hidden" name="Act" value="Preview">
<input type="hidden" name="Inquiry_ID" value="<%=Request("Inquiry_ID")%>">
<input type="hidden" name="Request_ID" value="<%=Request("Request_ID")%>">
<input type="hidden" name="Addresses_Re" value="<%=Addresses_Re%>">
<input type="hidden" name="Addresses_From" value="<%=Addresses_From%>">
<input type="hidden" name="Addresses_Name" value="<%=Addresses_Name%>">
<input type="hidden" name="Addresses" value="<%=Addresses%>">

<% ' EWEBEDIT - INSIDE OF FORM - START' %>
<!--#include file="includes/ewebform.asp"-->
<% ' EWEBEDIT - INSIDE OF FORM - END' %>
</form>

</div>

<% Else %>

<% End If %>



<%'-- ******************************************* Reply %>

<% If Not Request("Request_ID") = "" And Not Request("Inquiry_ID") = "" And lcase(Request("Act")) = "reply" Then%>
<div id="inquiryDisplay" style="position:absolute; width:687px; height:119px; z-index:9; left: 248px; top: 110px; visibility: visible"  align="left"> 
  <form name="form1" method="post" action="message-que.asp">
<a name="req">
    <table width="98%" border="0" cellspacing="0" cellpadding="0" bgcolor="#ffffff">
      <tr> 
        <td valign="top" align="left" height="63"><img src="/images/composer-nav.jpg" usemap="#composernav" border="0" width="595" height="75"> 
          <map name="composernav"> 
            <area shape=RECT coords="16,14,102,29" href="#req"  alt="Attractions" onClick="MM_showHideLayers('GroupList','','show')">
            <area shape=RECT coords="170,15,256,31" href="#req"  alt="Events" onClick="MM_showHideLayers('GroupList','','show')">
            <area shape=RECT coords="16,43,102,58" href="#req"  alt="Availability" onClick="MM_showHideLayers('GroupList','','show')">
            <area shape=RECT coords="170,43,256,58" href="#req"  alt="Coupons" onClick="MM_showHideLayers('GroupList','','show')">
            <area shape=RECT coords="324,15,410,30" href="#req"  alt="Rallies" onClick="MM_showHideLayers('GroupList','','show')">
            <area shape=RECT coords="323,43,410,57" href="#req"  alt="Profile" onClick="MM_showHideLayers('GroupList','','show')">
            <area shape=RECT coords="478,43,564,58" href="javascript:frmrequest('<%=Request("Inquiry_ID")%>', '<%=Request("Request_ID")%>', 'Preview');"  alt="Preview this E-Mail" onClick="frmrequest('<%=Request("Inquiry_ID")%>', '<%=Request("Request_ID")%>', 'Preview');">
          </map>
        </td>
      </tr>
    </table>
<%

SQL = "Select * from [Inquiries].[dbo].[Request_" & Request("Inquiry_ID") & "] where Request_ID='" & Request("Request_ID") & "'"

DBConnect(SQL)

If Not objRS.EOF Then

	SQL = "Get_Contact @Contact_ID='" & objRS("Contact_ID") & "'"
	'Response.Write SQL
	Set RSContact = Conn.Execute(SQL)

	Name_Prefix = RSContact("Name_Prefix")
	Name_First = RSContact("Name_First")
	Name_Pref = RSContact("Name_Pref")
	Name_MI = RSContact("Name_MI")
	Name_Last = RSContact("Name_Last")
	Name_Suffix = RSContact("Name_Suffix")
	Title = RSContact("Title")
	DOB = RSContact("DOB")
	Gender = RSContact("Gender")
	Address_1 = RSContact("Address_1")
	Address_2 = RSContact("Address_2")
	City = RSContact("City")
	State = RSContact("State")
	Zip = RSContact("Zip")
	Zip_4 = RSContact("Zip_4")
	Country = RSContact("Country")
	Phone_HM_Areacode = RSContact("Phone_HM_Areacode")
	Phone_HM = RSContact("Phone_HM")
	Pager_AreaCode = RSContact("Pager_AreaCode")
	Pager = RSContact("Pager")
	Mobile_AreaCode = RSContact("Mobile_AreaCode")
	Mobile = RSContact("Mobile")
	Fax_WK_AreaCode = RSContact("Fax_WK_AreaCode")
	Fax_WK = RSContact("Fax_WK")
	Phone_WK_Areacode = RSContact("Phone_WK_Areacode")
	Phone_WK = RSContact("Phone_WK")
	Phone_WK_Ext = RSContact("Phone_WK_Ext")
	Web = RSContact("Web")
	EMail_Home = RSContact("EMail_Home")
	EMail_Work = RSContact("EMail_Work")
	EMail_Other = RSContact("EMail_Other")

	ResponseSQL = "Get_Inquiry_Response @Inquiry_ID = '" & Request("Inquiry_ID") & "', @Request_ID='" & Request("Request_ID") & "'"
	Set RSResponse = Conn.Execute(ResponseSQL)
%>
<div class="lodging-hdln" style=" { width:578; text-align:right; } ">
Inquiry #: <%=Request("Inquiry_ID")%>-<%=objRS("Contact_ID")%>-<%=Request("Request_ID")%>
</div>
    <table width="587" border="0" cellspacing="0" cellpadding="0">
<% If Not Name_First = "" Or Not Name_Last = "" Then %>
      <tr> 
        <td width="291" class="lodging-hdln"><%=Name_Prefix%>&nbsp;<%=Name_First%><% If Not Name_Pref = "" Then Response.Write "(" & Name_Pref & ")"%>&nbsp;<%=Name_MI%>&nbsp;<%=Name_Last%>&nbsp;<%=Name_Suffix%></td>
        <td width="343">&nbsp;</td>
      </tr>
<% Else %>
      <tr> 
        <td colspan="2" class="lodging-hdln">This inquiry has incomplete contact information.</td>
      </tr>
<% End If %>
      <tr> 
        <td colspan="2" class="1p-rule5e5ebe">&nbsp;</td>
      </tr>
      <tr> 
        <td width="291" class="mssg-que-list">
<% If Not Address_1 = "" Then %>
	<%=Address_1%><br>
<% End If %>
<% If Not Address_2 = "" Then %>
	<%=Address_2%><br>
<% End If %>
<% If Not City = "" And Not State = "" Then %>
<%=City%>, <%=State%><br>
<% End If %>
<%=ZIP%><% If Not Zip_4 = "" And Not Zip_4 = "0" Then %>-<%=Zip_4%><% End If %></td>
        <td valign="top"> 
          <table width="100%" border="0" cellspacing="0" cellpadding="0" align="right">
<% If Not Phone_HM = "" And Not Phone_HM = "0" Then %>
            <tr> 
              <td class="transaction-GT">Phone(HM):</td>
              <td class="mssg-que-list" colspan="2"><% If Not Phone_HM_AreaCode = "" And Not Phone_HM_AreaCode = "0" Then %>(<%=Phone_HM_AreaCode%>)<% End If %> <% If Not Phone_HM = "" And Not Fax_WK = "0" Then %><%=Phone_HM%><% End If %></td>
            </tr>
<% End If %>
<% If Not Phone_WK = "" And Not Phone_WK = "0" Then %>
            <tr> 
              <td class="transaction-GT">Phone(WK):</td>
              <td class="mssg-que-list" colspan="2"><% If Not Phone_WK_AreaCode = "" And Not Phone_WK_AreaCode = "0" Then %>(<%=Phone_WK_AreaCode%>)<% End If %> <% If Not Phone_WK = "" And Not Fax_WK = "0" Then %><%=Phone_WK%><% End If %></td>
            </tr>
<% End If %>
<% If Not Fax_WK = "" And Not Fax_WK = "0" Then %>
            <tr> 
              <td class="transaction-GT">Fax(WK):</td>
              <td class="mssg-que-list" colspan="2"><% If Not Fax_WK_AreaCode = "" And Not Fax_WK_AreaCode = "0" Then %>(<%=Fax_WK_AreaCode%>)<% End If %> <% If Not Fax_WK = "" And Not Fax_WK = "0" Then %><%=Fax_WK%><% End If %></td>
            </tr>
<% End If %>
<% If (Fax_WK = "" Or Fax_WK = "0") And (Phone_WK = "" Or Phone_WK = "0") And (Phone_HM = "" Or Phone_HM = "0") Then %>
            <tr> 
              <td class="transaction-GT" colspan="2">No Phone Details Provided.</td>
            </tr>
<% End If %>
<% If Not EMail_Home = "" Then %>
            <tr> 
              <td class="transaction-GT">E-mail:</td>
              <td class="mssg-que-list" colspan="2"><%=EMail_Home%></td>
            </tr>
<% End If %>
<% If Not EMail_Work = "" Then %>
            <tr> 
              <td class="transaction-GT">E-mail:</td>
              <td class="mssg-que-list" colspan="2"><%=EMail_Work%></td>
            </tr>
<% End If %>
<% If Not EMail_Other = "" Then %>
            <tr> 
              <td class="transaction-GT">E-mail:</td>
              <td class="mssg-que-list" colspan="2"><%=EMail_Other%></td>
            </tr>
<% End If %>
<% If (Email_Other = "" Or Email_Other = "0") And (EMail_Work = "" Or EMail_Work = "0") And (EMail_Home = "" Or EMail_Home = "0") Then %>
            <tr> 
              <td class="transaction-GT" colspan="2">No E-Mail Details Provided.</td>
            </tr>
<% End If %>
          </table>
        </td>
      </tr>
      <tr> 
        <td colspan="2" class="mssg-que-list"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td valign="top" colspan="2"><table border="0" cellspacing="0" cellpadding="0" width="100%">
<%
	Cnt = 0
	For each objField in objRS.Fields

		If 	Not trim(lcase(objField.Name)) = "request_id" _
			And Not trim(lcase(objField.Name)) = "inquiry_id" _
			And Not trim(lcase(objField.Name)) = "realm_id" _
			And Not trim(lcase(objField.Name)) = "csr_id" _
			And Not trim(lcase(objField.Name)) = "request_status" _
			And Not trim(lcase(objField.Name)) = "comments" _
			And Not trim(lcase(objField.Name)) = "contact_id" _
			And Not trim(lcase(objField.Name)) = "user_id" _
			And Not trim(lcase(objField.Name)) = "affiliate_id" _
		Then
			val = objRS(objField.Name)
			if val = "" or isNull(val) = True Then val = "N/A or No"
			if val = True Then val = "Yes"
			if val = False Then val = "No"

			  If (Cnt Mod 2) Then
				Response.Write "<td class=""transaction-GT"">" & Replace(objField.Name, "_", " ") & ": </td><td class=""mssg-que-list"">" & val & "</td></tr>"
			  Else
				Response.Write "<tr><td class=""transaction-GT"">" & Replace(objField.Name, "_", " ") & ": </td><td class=""mssg-que-list"">" & val & "</td>"
			  End If

  		  	Cnt = Cnt + 1

		End If

	Next
If (Cnt Mod 2) Then
	Response.Write "<td>&nbsp;</td>"
End IF
%>
</tr></table></td></tr>
        </td>
      </tr>
    </table>
<%
	objRS.MoveFirst()
	Contact_ID = objRS("Contact_ID")
	For each objField in objRS.Fields
		If trim(lcase(objField.Name)) = "comments" Then

%>
	<!--            <tr> 
	              <td class="transaction-GT">Topic:</td>
	              <td class="mssg-que-list" colspan="2"> Sunburst RV Park-Orange City</td>
	            </tr>
	            <tr> 
	              <td class="transaction-GT">Arrival:</td>
	              <td valign="middle"> 
	                <input name="rateDisplay226"  value="12/31/02""style="border-style:none;  " size="9" class="mssg-que-list">
	              </td>
	              <td class="transaction-GT" valign="middle">Departure: 
	                <input name="rateDisplay2262"  value="05/28/02"style="border-style:none; " size="9" class="mssg-que-list">
	             </td>
	            </tr>
	-->
	            <tr> 
	              <td class="transaction-GT" colspan="2"><br>
						<table border="0" cellspacing="0" cellpadding="0" bgcolor="#5e5ebe" class="box-padding2px" width="367" align="left">
							<td align="left" class="mssg-que-label"><font color="#ffffff">&nbsp;Comments:<br></font>
					             <textarea name="comments" readonly="readonly" style="border-style:none; " cols="80"  rows="5" wrap="VIRTUAL" class="box-padding2px"><%=objRS("Comments")%></textarea>
							</td>
						</table>
	              </td>
	            </tr>

</table>

<%
	   	End If

	Next
End If

   IF Not RSResponse.EOF Then
%><table border="0" cellspacing="0" cellpadding="0" width="587" align="left">
<%

	Do While Not RSResponse.EOF
%>            
	            <tr> 
	              <td class="transaction-GT" colspan="2"><br>
						<table border="0" cellspacing="0" cellpadding="0" bgcolor="#5e5ebe" class="box-padding2px" width="367">
						   <Tr>
							<td align="left" class="mssg-que-label"><font color="#ffffff">&nbsp;Your Response (<%=RSResponse("Response_Date")%>):</font>
					             <div id="Response<%=RSResponse("Response_ID")%>" style="background-color:#ffffff; vertical-align:top; position:relative; width:578px; height:240; z-index:12; overflow: scroll;"><%=RSResponse("Response_Copy")%></div></td>
						   </tr>
						</table>
	              </td>
	            </tr>

<%
		RSResponse.MoveNext
	Loop
%>
</table>
<%
   Else
%>
	            <tr> 
	              <td class="transaction-GT" colspan="2"><br>
						<table border="0" cellspacing="0" cellpadding="0" bgcolor="#5e5ebe" class="box-padding2px" width="367">
							<td align="left" class="mssg-que-label"><font color="#ffffff">&nbsp;Your Response:<br></font>
					             <textarea name="Response" readonly="readonly" style="border-style:none; " cols="80"  rows="5" wrap="VIRTUAL" class="box-padding2px">No Response on File</textarea>
							</td>
						</table>
	              </td>
	            </tr>
</table>
<% End If %>
	              </td>
	            </tr>
          </table>

</form>
</div>

<% Else %>

<% End If %>




<%'-- ******************************************* Group List %>

<div id="GroupList" style="position:absolute; width:200; height:150; z-index:103; left: 6px; top: 391px; background-color: #5e5ebe; layer-background-color: #5e5ebe; border: 1px none #000000; overflow: auto; visibility: hidden" class="box-padding2px"> 
  <!--<div id="GroupList" style="position:absolute; width:200; height:150; z-index:103; left: 925px; top: 160px; background-color: #5e5ebe; layer-background-color: #5e5ebe; border: 1px none #000000; overflow: auto; visibility: hidden" class="box-padding2px"> -->
  <table width="100%" border="0" cellspacing="0" cellpadding="2">
    <tr> 
      <td bgcolor="#FFFFFF" class="roomdetails-Hghlgt5e5ebe">
        <div align="left">&nbsp;&nbsp;Resorts</div>
      </td>
      <td bgcolor="#ffffff" class="roomdetails-Hghlgt5e5ebe">
        <div align="right"><a onClick="MM_showHideLayers('GroupList','','hide','GroupListSub','','hide')"><font color="#e3e3e3" style="{cursor:hand}">Go!&nbsp;</font></a></div>
      </td>
    </tr>
    <tr><td colspan="2">
	<div id="GroupListSub" style="position:relative; width:100%; height:123px; z-index:103; left: 0px; top: 0px; background-color: #5e5ebe; layer-background-color: #ffffff; border: 1px none #000000; overflow: auto; visibility: hidden" class="box-padding2px"> 
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
	    <tr> 
	      <td bgcolor="#FFFFFF" class="park-list"> 
	<% 'Realm ID for encore is 15..
			SQL = "Get_Groups_by_Realm @Realm_ID='15'"
			Set GroupList = Conn.Execute(SQL)
			Do While Not GroupList.EOF
			%>
				<div id="list<%=GroupList("Group_ID")%>" style="background:white;"><a href="#req" onClick="MM_changeProp('list<%=GroupList("Group_ID")%>','','style.backgroundColor','cccccc','DIV')" onDblClick="MM_changeProp('list<%=GroupList("Group_ID")%>','','style.backgroundColor','ffffff','DIV')"><span class="park-list"><%=GroupList("Name")%></span></a></div>
	        <%
				GroupList.MoveNext
	        Loop
	        %>
	        </td>
	    </tr>
	  </table>
	</div>
  </td></tr>
    <tr> 
      <td colspan="2" class="1p-rule5e5ebe">&nbsp;</td>
    </tr>
  </table>
</div>

<%'-- ******************************************* Nav Queue: Pending %>
<% If Trim(LCase(Request("Act"))) = "pending" Or Trim(LCase(Request("Act"))) = "request" Or Trim(LCase(Request("Act"))) = "" Then %>
<div id="pendingNav" style="position:absolute; width:220px; height:18px; z-index:101; left: 7px; top: 115px;"> 
  <table border="0" cellpadding="0" cellspacing="0" width="220" bgcolor="#5e5ebe">
    <tr> 
      <td width="110"><a onClick="frmrequest('', '', 'Pending');" style=" { cursor:hand }"><img name="pending2" src="/images/pending-toggle.gif" border="0" onLoad="" width="100" height="18"></a></td>
      <td width="110"><a onClick="frmrequest('', '', 'Processed');" style=" { cursor:hand }"><img src="/images/processed-dim.gif" width="115" height="18" name="processDim" border="0"></a></td>
    </tr>
  </table>
</div>
<% Else %>
<%'-- ******************************************* Nav Queue: Processed %>
<div id="processedNav" style="position:absolute; width:220px; height:18px; z-index:101; left: 7px; top: 115px;"> 
  <table border="0" cellpadding="0" cellspacing="0" width="220" bgcolor="#5e5ebe">
    <tr> 
      <td width="110"><a onClick="frmrequest('', '', 'Pending');" style=" { cursor:hand }"><img name="pending2" src="/images/pending-dim.gif" border="0" onLoad="" width="100" height="18"></a></td>
      <td width="110"><a onClick="frmrequest('', '', 'Processed');" style=" { cursor:hand }"><img src="/images/processed.gif" width="115" height="18" name="processDim" border="0"></a></td>
    </tr>
  </table>
</div>
<% End If %>

<%'-- ******************************************* List Queue: Pending %>

<% If Trim(LCase(Request("Act"))) = "pending" Or Trim(LCase(Request("Act"))) = "request" Or Trim(LCase(Request("Act"))) = "" Then %>
<div id="queListPending" style="position:absolute; width:220px; height:215; z-index:12; left: 7px; top: 135px; overflow: auto; visibility: hidden"> 
  <table border="0" cellspacing="0" cellpadding="0" align="left" width="200">
    <tr> 
      <td class="mssg-que-header">Inquiry Type</td>
      <td class="mssg-que-header" align="center" width="55">Date</td>
    </tr>
    <tr> 
      <td colspan="2" class="1p-rule5e5ebe">&nbsp;</td>
    </tr>
<% 	RecCount = 0
	SQL = "Get_Inquiry_Queue @Group_ID='" & Session("Entity_Group_ID") & "', @Request_Status='1'"
	Set RSQueue = Conn.Execute(SQL)
	Do While Not RSQueue.EOF
		Start_Tag = ""
		End_Tag = ""
		If CStr(RSQueue("Request_ID")) = Request("Request_ID") And CStr(RSQueue("Inquiry_ID")) = Request("Inquiry_ID") Then
			Start_Tag = "<font color='#bb0000'>"
			End_Tag = "</font>"
		ElseIf CStr(RSQueue("Contact_ID")) = Contact_ID Then
			Start_Tag = "<font color='#00bb00'>"
			End_Tag = "</font>"
		End If
%>
		    <tr> 
		      <td class="mssg-que-list"><a onClick="frmrequest('<%=RSQueue("Inquiry_ID")%>', '<%=RSQueue("Request_ID")%>', 'Request');" style=" { cursor:hand }"><%=Start_Tag%><%=RSQueue("Inquiry_Name")%><%=End_Tag%></a></td>
		      <td class="mssg-que-list" align="right"><%=Month(RSQueue("Request_Date")) & "/" & Day(RSQueue("Request_Date")) & "/" & Year(RSQueue("Request_Date"))%></td>
		    </tr>

<%		RSQueue.MoveNext
		RecCount = RecCount + 1
	Loop
	Set RSQueue = Nothing
%>
    <tr> 
      <td colspan="2" class="1p-rule5e5ebe">&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="2" align="right" class="mssg-que-list"><%=RecCount%> Pending.&nbsp;&nbsp;</td>
    </tr>
  </table>
  <script language="javascript">
//	alert(self.innerHeight);
	queListPending.style.height=((screen.height /2)+70);
	
	MM_showHideLayers('queListPending','','show');
  </script>
</div>

<% Else %>

<%'-- ******************************************* List Queue: Processed %>

<div id="queListProcessed" style="position:absolute; width:220px; height:215; z-index:12; left: 7px; top: 135px; overflow: auto; visibility: hidden"> 
  <table width="200" border="0" cellspacing="0" cellpadding="0">
    <tr> 
      <td class="mssg-que-header">Inquiry Type</td>
      <td class="mssg-que-header" align="center" width="55">Date</td>
    </tr>
    <tr> 
      <td colspan="2" class="1p-rule5e5ebe">&nbsp;</td>
    </tr>
<% 	RecCount = 0
	SQL = "Get_Inquiry_Queue @Group_ID='" & Session("Entity_Group_ID") & "', @Request_Status='3'"
	Set RSQueue = Conn.Execute(SQL)
	Do While Not RSQueue.EOF
		Start_Tag = ""
		End_Tag = ""
		If CStr(RSQueue("Request_ID")) = Request("Request_ID") And CStr(RSQueue("Inquiry_ID")) = Request("Inquiry_ID") Then
			Start_Tag = "<font color='#bb0000'>"
			End_Tag = "</font>"
		ElseIf CStr(RSQueue("Contact_ID")) = Contact_ID Then
			Start_Tag = "<font color='#00bb00'>"
			End_Tag = "</font>"
		End If
%>
		    <tr> 
		      <td class="mssg-que-list"><a onClick="frmrequest('<%=RSQueue("Inquiry_ID")%>', '<%=RSQueue("Request_ID")%>', 'Reply');" style=" { cursor:hand }"><%=Start_Tag%><%=RSQueue("Inquiry_Name")%><%=End_Tag%></a></td>
		      <td class="mssg-que-list" align="right"><%=Month(RSQueue("Request_Date")) & "/" & Day(RSQueue("Request_Date")) & "/" & Year(RSQueue("Request_Date"))%></td>
		    </tr>

<%		RSQueue.MoveNext
		RecCount = RecCount + 1
	Loop
	Set RSQueue = Nothing
%>
    <tr> 
      <td colspan="2" class="1p-rule5e5ebe">&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="2" align="right" class="mssg-que-list"><%=RecCount%> Processed.&nbsp;&nbsp;</td>
    </tr>
  </table>
  <script language="javascript">
//	alert(self.innerHeight);
	queListProcessed.style.height=((screen.height /2)+70);
	
	MM_showHideLayers('queListProcessed','','show');
  </script>
  </table>
</div>
<% End If %>
</body>
</html>


<% ' EWEBEDIT - BOTTOM OF PAGE - START' %>
<!--#include file = "includes/ewebbottom.asp"-->
<% ' EWEBEDIT - BOTTOM OF PAGE - END' %>
