<?php
/*
**	preBody($title, $stylesheetAddress)
**	headerDiv($page)
**	navDiv($currentPage)
**	footerDiv($updateDate)
*/
function preBody($title)
{
echo
"
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">
<head>
	<title>$title</title>
	<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />
	<meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />
	<meta name=\"author\" content=\"Clement Ting\" />
	<meta name=\"description\" content=\"$title\" />
	<meta name=\"keywords\" content=\"$title, IT Assignment\" />
	<script type=\"text/javascript\" src=\"scripts/scripts.js\"></script>
	<link rel=\"stylesheet\" type=\"text/css\" title=\"Style1\" href=\"css/style1/style1.css\" />
	<link rel=\"stylesheet\" type=\"text/css\" title=\"Style2\" href=\"css/style2/style2.css\" />
	<link rel=\"stylesheet\" type=\"text/css\" title=\"Print\" media=\"print\" href=\"css/print.css\" />
	<link rel=\"stylesheet\" type=\"text/css\" title=\"Print2\" href=\"css/print.css\" />	
</head>
";
//<link rel=\"stylesheet\" type=\"text/css\" title=\"PrintStyle\" href=\"css/print.css\" />
}

function navDiv($currentPage ,$page)
{

$navDivArray = array("","","","","","","","","");

switch($currentPage)
{
case "index":
	$navDivArray[0] = " class=\"currentPage\"";
	break;
case "about":
	$navDivArray[1] = " class=\"currentPage\"";
	break;
case "store":
	$navDivArray[2] = " class=\"currentPage\"";
	break;
case "gallery":
	$navDivArray[3] = " class=\"currentPage\"";
	break;
case "events":
	$navDivArray[4] = " class=\"currentPage\"";
	break;
case "career_opportunities1":
	$navDivArray[5] = " class=\"currentPage\"";
	break;
case "career_opportunities1":
	$navDivArray[6] = " class=\"currentPage\"";
	break;
case "contact_us":
	$navDivArray[7] = " class=\"currentPage\"";
	break;
case "feedback_form":
	$navDivArray[8] = " class=\"currentPage\"";
	break;
}

echo
"
<body onload=\"set_style_from_cookie()\">
	<div class =\"banner\" id=\"top\">
		<h1>tHe Spring</h1>
	</div>
	<div class=\"navigation\">
		<ul>
			<li$navDivArray[0]><a href=\"index.php\">Home</a></li>
			<li$navDivArray[1]><a href=\"about.php\">About Us</a></li>
			<li$navDivArray[2]><a href=\"store.php\">Store Directory</a></li>
			<li$navDivArray[3]><a href=\"gallery.php\">Gallery</a></li>
			<li$navDivArray[4]><a href=\"events.php\">Events</a></li>
			<li$navDivArray[5]><a href=\"career_opportunities1.php\">Career Opportunities[1]</a></li>
			<li$navDivArray[6]><a href=\"career_opportunities2.php\">Career Opportunities[2]</a></li>
			<li$navDivArray[7]><a href=\"contact_us.php\">Contact Us</a></li>
			<li$navDivArray[8]><a href=\"feedback_form.php\">Feedback</a></li>
		</ul>
	</div>
	<div class=\"main\">
		<h2 class=\"header\">$page</h2>
";
}

function footerDiv($dateUpdated)
{
echo
"
	</div>
	<div class=\"footer\">
		<p><a href=\"#\" onclick=\"switch_style('Style1');\">CLICK FOR STYLE 1</a></p>
		<p><a href=\"#\" onclick=\"switch_style('Style2');\">CLICK FOR STYLE 2</a></p>
		<p>This website is created by Clement Ting from <a href=\"about_our_group.php\">Group ETC</a></p>
		<p>And was last updated on $dateUpdated</p>
		<p class=\"disclaimer\">
			Disclaimer: The information used to make this page is gotten from <a href=\"http://www.thespring.com.my/\">The Spring's Website</a> 
			and are used for education purposes only. 
		</p>
		<p >
			<a href=\"http://validator.w3.org/check?uri=referer\">
				<img src=\"http://www.w3.org/Icons/valid-xhtml10\" alt=\"Valid XHTML 1.0 Strict\" height=\"31\" width=\"88\" />
			</a>
			<br/>
		    <a href=\"http://jigsaw.w3.org/css-validator/check/referer\">
				<img style=\"border:0;width:88px;height:31px\"
				src=\"http://jigsaw.w3.org/css-validator/images/vcss\"
				alt=\"Valid CSS!\" />
			</a>	
			<br/>
			Last validated on $dateUpdated.
		</p>	
	</div>
</body>
</html>	
";
}

function simplifyPic($number)
{
	setGetPicture("img$number.jpg",100,"auto");
}

function setGetPicture($pictureName, $height, $width)
{
echo
"
		<li>
			<a href=\"galleryimage.php?picture=$pictureName\">
				<img src=\"images/small_gallery_images/$pictureName\" alt=\"This should show $pictureName\" height=\"$height\" width=\"$width\" 
				title=\"Click for larger version of picture\"/>
			</a>
		</li>
";



}

?>