<%
response.CacheControl = "no-cache"
	set con = Server.CreateObject("ADODB.Connection")
	con.Open Application("CString")

	if Request("NewsID") <> Empty and IsNumeric(Request("NewsID")) then
		i_NewsID = Request("NewsID") 
	end if
	
	strSQL = "SELECT * FROM News WHERE NewsID = "& i_NewsID
	set rsPage = con.execute(strSQL)
	
	s_Title 			= ""
	s_NewsDate			= ""
	s_NewsDateEnd		= ""
	s_ShortDesc 		= ""
	s_Headline 			= ""
	s_Article 			= ""
	
	if not rsPage.EOF then
		
		rsPage.MoveFirst()
		
		s_Title 			= rsPage("Title")
		s_NewsDate			= rsPage("NewsDate")
		s_NewsDateEnd			= rsPage("NewsDateEnd")
		s_ShortDesc			= rsPage("ShortDesc")
		s_Headline			= rsPage("Headline")
		s_Article 			= rsPage("Article")	
		
	end if
	
	set rsPage = Nothing
	if not IsNull(s_Redirect) and s_Redirect <> Empty then
		response.redirect(s_Redirect)
	elseif not IsNull(s_FileName) and Trim(s_FileName) <> Empty then
		Response.Redirect("Uploads/"& s_FileName)
	elseif not IsNull(s_OverView) and  Trim(s_OverView) <> Empty then 'Go to resort page
		response.redirect("content_resort.asp?ResortID="&i_NewsID)
	end if
	strSQL = "SELECT * FROM Page_Images WHERE NewsID = " & i_NewsID
		set rsImages = server.createobject("ADODB.RecordSet")
		rsImages.open strSQL, Application("CString")
	s_Heading = "Newsroom"
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><%=Server.HTMLEncode(s_Title)%> :. P.K. Ferraris & Associates - Financial Planning South Africa</title>
<!--#include file="meta.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="styles.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="javaFunctions.js"></script>
<% if not rsImages.EOF then %>
<link rel="stylesheet" href="lightbox/css/lightbox.css" type="text/css" media="screen" />
<script src="lightbox/js/prototype.js" type="text/javascript"></script>
<script src="lightbox/js/scriptaculous.js?load=effects" type="text/javascript"></script>
<script src="lightbox/js/lightbox.js" type="text/javascript"></script>
<% end if%>
</head>

<body>
<!--#include file="header.asp"-->

<%
		
                  if not rsImages.EOF then
					do until rsImages.EOF
					  		i_tmp_PageID = rsImages("PageID")
							s_tmp_Directory_File = rsImages("Directory_File")
							i_tmp_PageType = rsImages("PageType")
							i_tmp_ProjectID = rsImages("ProjectID")
							i_tmp_NewsID = rsImages("NewsID")
							i_tmp_Width = rsImages("Width")
							i_tmp_Height = rsImages("Height")
							b_tmp_Clickable = rsImages("Clickable")
							s_tmp_Description = rsImages("Description")
					  %><div class="ContentImageContainer">
					   <table border="0" cellspacing="0" cellpadding="0" width="100">
            <tr>
          	  <td class="ContentImage">
						<%if b_tmp_Clickable then%><a href="page_images/Big/<%=s_tmp_Directory_File%>" rel="lightbox[content]"  title="<%=s_tmp_Description%>"><img src="page_images/thumbs/<%=s_tmp_Directory_File%>" alt="<%=Server.HTMLEncode(s_tmp_Description)%>" name="imageField" border="0" type="image"></a>
					<%else%><img src="page_images/thumbs/<%=s_tmp_Directory_File%>" name="imageField" border="0" type="image" alt="<%=Server.HTMLEncode(s_tmp_Description)%>"><%end if%></td></tr>
												
                           <% 		
		if s_tmp_Description <> empty and not isNull(s_tmp_Description) then 
%>
            <tr>
          	  <td align="center" class="ImageDescr"><%=s_tmp_Description%></td>
            </tr>
<% 		
		end if
%>
     </table></div>
<%rsImages.MoveNext
					  loop
					  end if%>
					<h1><%=s_Title%></h1>
				<p><%=s_Article%></p>
				<br>
          <input name="Button" type="button" class="button" value="Back To News Index" onClick="javascript:history.go(-1);">
          <br>
        <!--#include file="footer.asp"-->
</body>
</html>
