metalix 0 Posting Whiz in Training

Hi there
I am having some trouble with a script.
What it does is uses the http request (similar to googles search suggestions) to replace the entire page content div, this works fine but some of these pages use javascript.
one has a lightbox, another has contact form verification. is there a way make this javascript work?
code is as follows

index.php

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>title</title>
<script type="text/javascript">
function showPage(str)
{
if (str.length==0)
  { 
  document.getElementById("link").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest();
  }
else
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("link").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET",""+str+".php",true);
xmlhttp.send();
}
</script>
<style type="text/css">
//stylesheet
</style>
</head>

<body onload="showPage('start')">
<div id="title"><a onclick="return showPage('start')"><img src="images/title.png" width="800" height="200" border="0" /></a><br />
</div>

<div id="sitelink">
<a onclick="return showPage('services')">Our Services</a>
&nbsp;&nbsp; | &nbsp;&nbsp;
<a onclick="return showPage('team')">Our Team</a>
&nbsp;&nbsp; | &nbsp;&nbsp;
<a onclick="return showPage('contact')">Contact Us</a>
</div>
<span>some page content</span>
<div id="link"></div>
</body>
</html>

team.php -- page with lightbox

<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<div style="position:absolute;
	left:30%;
	text-align:center;
	top:270px;
	width:45%;
	height:68px;
	z-index:2;">
  <h2>
    <div id="header">Our Team</div></h2>
</div>

<div id="main" style="position:absolute;
	left:10%;
	top:350px;
	width:80%;
	height:300px;
	z-index:4;"><div id="content">
  <p>Blurb about the team</p>
  
<table width="100%"><tr>
<td width="10%" height="102" align="center" valign="middle"><a href="images/pics/steve.png" rel="lightbox[thumb]" sectext='<p><font size="+1">steve</font></p>
            info about steve
            </p>'><img src="images/pics/stevethumb.png" width="100" height="101" border="0" /></a></td>
</tr></table>
</div></div>

This has been modified to only show necessary bits.

thank you in advance for any support :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.