<?php

error_reporting(E_ALL);

define("ROOT",$_SERVER['DOCUMENT_ROOT']);
define("TODAY",date('Y-m-d'));

class Weather {
	
	var $values;
	
	////  XML CHARACTER DATA  ////
	function xmlCharacterData($parser, $cdata) {
		global $is_inside, $tag;
		$tags = array("TEMP_F","TEMP_C","WEATHER","LOCATION");
		if ($is_inside) {
			if (in_array($tag,$tags)) $this->values[$tag] = $cdata;
		}
	}
	
	////  XML START FUNCTION  ////
	function xmlStartElement($parser, $name, $attrs) {
		//global $is_inside, $tag;
		//$is_inside = true;
		//$tag = $name;
		if ($name=="YWEATHER:LOCATION") $this->values['city'] = $attrs['CITY'];
		if ($name=="YWEATHER:FORECAST" && !isset($this->values['LOW'])) $this->values = array_merge($this->values,$attrs);
	}
	
	////  XML END FUNCTION  ////
	function xmlEndElement($parser, $name) {
		//global $is_inside, $tag;
		//$is_inside = false;
		//$tag = NULL;
	}
		
	function Weather() {
		// Set Path of XML File and Test if Recent
		$file = ROOT."/weather.xml";
		//clearstatcache();
		if (!file_exists($file) || date('Y-m-d',filemtime($file))!=TODAY) {
			$fp = fopen($file,'wb');
			$xml = file_get_contents("http://xml.weather.yahoo.com/forecastrss?p=29902");
			fwrite($fp,$xml);
			fclose($fp);
			unset($xml);
		}
		// Setup XML Parser
		$this->xml_parser = xml_parser_create();
		xml_set_object($this->xml_parser, $this);
		xml_set_element_handler($this->xml_parser, "xmlStartElement", "xmlEndElement");
		//xml_set_character_data_handler($this->xml_parser, "xmlCharacterData");
		if (!($fp = fopen($file, "r"))) {
			//die("could not open XML input");
		}
		// Parse File
		while ($data = fread($fp, 4096)) {
			if (!xml_parse($this->xml_parser, $data, feof($fp))) {
				 //die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($this->xml_parser)), xml_get_current_line_number($this->xml_parser)));
			}
		}
		xml_parser_free($this->xml_parser);
	}

}

$beaufort = new Weather;

header("Content-type: text/html; charset=ISO-8859-1");
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Beaufort SC Best Western Hotel - Sea Island Inn</title>
<meta name="description" content="Beaufort, South Carolina hotel located in historic district, near Parris Island, shopping, dining, and waterfront">
<meta name="keywords" content="beaufort sc, sc hotel, south carolina hotel, parris island, sea island inn, sea-island-inn, buford, bufort, beaufort lodging, beaufort hotel, parris island hotel, paris island">
<meta name="robots" content="all">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" media="screen, projection" href="/stylesheets/screen.css">
<script src="/javascripts/seaislandinn.js" type="text/javascript"></script>
</head>
<body id="home">


<div id="property">

	<div id="header">
	
		<div id="logo">
			<a href="/"><img src="/images/hdr-logo.gif" width="98" height="89" alt="Best Western"></a>
			<h1><em>Best Western Sea Island Inn</em><br>Beaufort, South Carolina</h1>
		</div>

		<div id="menus">
			<dl id="globalNav"> 
				<dd class="first"><a href="mailto:seaislandinn1@yahoo.com">Customer Service</a><img src="/images/ico-topnav.gif" width="11" height="11" alt=""></dd>
				<dd><a href="http://www.bestwestern.com">Best Western</a><img src="/images/ico-topnav.gif" width="11" height="11" alt=""></dd>
			</dl>
			
			<p>Book Online or Call <strong>(843) 522-2090</strong></p>
		</div>
	</div>

	<dl id="siteNav">
		<dd class="skip"><a href="#content">Jump to Content</a></dd>
	</dl>

	<!-- CONTENT AREA -->
	<div id="body">

		<a name="content"></a>

		<div id="content">
			<div id="mainPhoto">
				<ul id="photoList">
					<li>6</li>
					<li>5</li>
					<li>4</li>
					<li>3</li>
					<li>2</li>
					<li>1</li>
				</ul>
			</div>
			<div id="intro">
				<h2>Best Western Sea Island Inn</h2>
				<p>Welcome to beautiful Beaufort, South Carolina. We are located in the Historic District, the perfect spot to explore and enjoy Beaufort and all its charms. For many decades we have welcomed friends and families who have chosen us for Parris Island Marine Corps graduations, annual festivals, weddings, or just a weekend getaway. Business travelers prefer us for our quiet, comfortable, and well-appointed guest rooms. Just steps from our front door, you will find an array of fine restaurants, shops, galleries, boutiques, historic sites and much more. Come stay with us and experience Southern hospitality at its finest.</p>
			</div>
			
			<div id="about">
				<h4>Features and Amenities</h4>
				<div id="amenities">
					<p>
						<strong>Number of Guest Rooms:</strong> 43<br>
						<strong>Number of Floors:</strong> 2<br>
						<strong>Check-In:</strong> 3:00 P.M.<br>
						<strong>Check-Out:</strong> 11:00 A.M.<br>
						<strong>Currency:</strong> United States Dollars (USD)<br>
						<strong>Time Zone:</strong> Eastern Standard Time<br>
						<strong>Hotel Ratings:</strong> AAA-3 Diamonds, Mobil-1 Star<br>
						<strong>Pet Policy:</strong> No pets allowed Guide and hearing dogs only<br>
						<strong>Child Policy:</strong> Children 17 And Under Are Free In Room With One Paying Adult In Existing Bedding.
					</p>
					<p>
						<img src="/images/ico-business.gif" width="16" height="16" alt=""> Business Services<br>
						<img src="/images/ico-freebreakfast.gif" width="16" height="16" alt=""> Free Breakfast<br>
						<img src="/images/ico-fitness.gif" width="16" height="16" alt=""> Fitness Center<br>
						<img src="/images/ico-restaurant.gif" width="16" height="16" alt=""> Restaurant On-Site/Nearby<br>
						<img src="/images/ico-internet.gif" width="16" height="16" alt=""> High Speed Internet
					</p>
				</div>
			</div>
		</div>

		<div id="sidebar">
			<div id="findHotel" class="clearfix">
				<h3>Make a Reservation</h3>
				<form action="/redirect.php" id="reservations" method="get" name="reservations">
				<input name="propertyCode" value="41046" type="hidden">
				<input name="sob" value="P480" type="hidden">
				<table>
					<tr>
						<td width="70"><strong>Check-In:</strong></td>
						<td>
							<select name="arrivalDay">
<? for ($i=1;$i<=31;$i++) { ?>
								<option<? if ($i==date('d')) { ?> selected="selected"<? } ?> value="<?=$i?>"><?=$i?></option>
<? } ?>
							</select>
						</td>
						<td>
							<a id="arrCal" href="calendar.php?t=arrival"><img src="/images/ico-calendar2.gif" width="16" height="16" alt=""></a>
						</td>
						<td>
							<select name="arrivalMonthYear">
<?
for ($i=0;$i<12;$i++) {
	$month = date("F",strtotime("+$i month"));
	$year = date("Y",strtotime("+$i month"));
	$bw_year = date("Y",strtotime("+".($i-1)." month"));
	$bw_month = date("m",strtotime("+".($i-1)." month"));
?>
								<option value="<?=$bw_year.$bw_month?>"><?=$month?>, <?=$year?></option>
<? } ?>
							</select>
						</td>
					</tr>
					<tr>
						<td><strong>Check-Out:</strong></td>
						<td>
							<select name="departureDay">
<? for ($i=1;$i<=31;$i++) { ?>
								<option<? if ($i==(date('d')+1)) { ?> selected="selected"<? } ?> value="<?=$i?>"><?=$i?></option>
<? } ?>
							</select>
						</td>
						<td>
							<a id="depCal" href="calendar.php?t=departure"><img src="/images/ico-calendar2.gif" width="16" height="16" alt=""></a>
						</td>
						<td>
							<select name="departureMonthYear">					
<?
for ($i=0;$i<12;$i++) {
	$month = date("F",strtotime("+$i month"));
	$year = date("Y",strtotime("+$i month"));
	$bw_year = date("Y",strtotime("+".($i-1)." month"));
	$bw_month = date("m",strtotime("+".($i-1)." month"));
?>
								<option value="<?=$bw_year.$bw_month?>"><?=$month?>, <?=$year?></option>
<? } ?>
							</select>
						</td>
					</tr>
					<tr>
						<td colspan="4" align="right"><a id="submit" href="javascript:document.getElementById('reservations').submit();">Check Rates &amp; Availability</a></td>
					</tr>
				</table>
				</form>
			</div>

			<div id="contact">
				<h4>Contact Us</h4>
				<p>
					<a href="http://maps.google.com/maps?f=q&hl=en&geocode=&q=1015+Bay+Street,+Beaufort+SC+29902&sll=37.0625,-95.677068&sspn=61.969195,82.177734&ie=UTF8&ll=32.431185,-80.673069&spn=0.008213,0.010031&z=17&g=1015+Bay+Street,+Beaufort+SC+29902&iwloc=r0&layer=c&cbll=32.43" target="_blank"><img src="/images/map.gif" alt="Jump to Google Maps" width="144" height="124" border="0"></a>
					<strong>Need Assistance?<br>
			    Contact our front desk:</strong><br>
					1015 Bay Street<br>Beaufort, SC, 29902-5514<br>Phone: 843-522-2090<br>Fax: 843-521-4858<br>
					<a href="mailto:seaislandinn1@yahoo.com">Send&nbsp;Email&nbsp;&gt;</a><br>
                    <a href="http://maps.google.com/maps?f=q&hl=en&geocode=&q=1015+Bay+Street,+Beaufort+SC+29902&sll=37.0625,-95.677068&sspn=61.969195,82.177734&ie=UTF8&ll=32.431185,-80.673069&spn=0.008213,0.010031&z=17&g=1015+Bay+Street,+Beaufort+SC+29902&iwloc=r0&layer=c&cbll=32.43" target="_blank">Visit Google Maps&nbsp;&gt;</a>
			  </p>
		  </div>
			
			<div id="ads">
			</div>
			
			<div id="weather">
				<h4>Weather for Beaufort, SC</h4>
				<table id="theReport">
					<tr>
						<td colspan="3" class="conditions"><?=$beaufort->values['TEXT']?></td>
					</tr>
					<tr>
						<td class="first temp">hi<br><strong id="highTemp"><?=$beaufort->values['HIGH']?>&deg;F</strong></td>
						<td class="temp">low<br><strong id="lowTemp"><?=$beaufort->values['LOW']?>&deg;F</strong></td>
						<td width="*" class="right"><a href="http://weather.yahoo.com/forecast/29902_f.html">Yahoo! Weather Forecast ></a></td>
					</tr>
				</table>
			</div>
			
			<div id="gcci">
				<h4>Gold Crown Club® International</h4>
				<p>
					<a href="https://www.goldcrownclub.com"><img src="/images/pro-home-gcci.gif" width="144" height="92" alt="Gold Crown Club® International"></a>
					<strong>Make your stays more rewarding</strong><br>
					You can choose to earn points or miles by staying at Best Western hotels and through our partners, special offers and Best Western MasterCard®. <a href="https://www.goldcrownclub.com">Join the club today&nbsp;&gt;</a>
				</p>
			</div>

		</div>

	</div>
	<!-- END CONTENT AREA -->

</div>

<div id="footer">
	<p><span class="fineprint">Best Western hotels are independently owned and operated. Copyright &copy; 2007 Best Western International. All Rights Reserved.</span></p>
</div>

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
<script type="text/javascript">
_uacct = "UA-503289-1";
urchinTracker();
</script>

</body>
</html>