I've torn all of my hair out trying to figure this out. I am trying to use Javascript to load an image and display it in a div. It works just fine when I use an absolute for the file name. When I try to use a variable, it does nothing. When I trace the variable, it does contain the correct value. I'm stumped.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html lang = "en">
		<meta charset="utf-8">
		<title>List of Parks</title>
		<link href="guide.css" rel="stylesheet" type="text/css">
		<style type="text/css"></style>
		<script type="text/javascript" src="../jQuery/jQuery.js"></script>
		<script type="text/javascript">

			function showImage()


	<div id="container">
		<div id="state"></div>
		<div id="list">		
			<?php foreach ($datas as $name): 
				if ($name['state'] == 'PA')

			<input type="hidden" name="id" value="<?php echo $name['id']; ?>">
			<h2><?php echo htmlspecialchars($name['name'], ENT_QUOTES, 'UTF-8');?></h2>
			<?php htmlspecialchars($name['site'], ENT_QUOTES, 'UTF-8');?>
			<?php $link = $name['site']; ?>
			<ul id="link">
			<li class="l1"><?php echo "<a href=$link>$link</a>" ?></li>
			<?php echo htmlspecialchars($name['description'], ENT_QUOTES, 'UTF-8');?>
			<?php echo htmlspecialchars($name['street'], ENT_QUOTES, 'UTF-8');?>
			<?php echo htmlspecialchars($name['city'], ENT_QUOTES, 'UTF-8');?> ,
			<?php echo htmlspecialchars($name['state'], ENT_QUOTES, 'UTF-8');?>
			<?php echo htmlspecialchars($name['zip'], ENT_QUOTES, 'UTF-8');?> 

		<?php $file = $name['id'];
		$image = '../maps/'.$file.'.gif';?>	
		<input type="button" value="click for map" onclick="showImage();"/>

			<div id="trailmap">
				<img id="loadingImage" src="<?php $image ?>" style="visibility:hidden"/>
			<?php echo $image?>
		<hr width="100%" size="3" black />	
				endforeach; ?>			
	<div class="fixbox">
	<div id="statemap"></div>
	<div id="home"></div>
	<div id="guide"></div>