I am attempting to create a menu using "ajax navigation 2" i found on javascript.internet.com. Unfortunantly while it works on the page i found it, it wont work when i copy the source as the siad to. The problem as best as i can find it that the XMLHttpRequest method is throwing back a access denied error on explorer. on Safari it just blinks and nothing loads. At the moment I only have the website on my usb drive, however it will become a business site that needs to work once uploaded to the server. I am only asking it to request another page from a different folder.

This is the js file:
var xmlhttp=false;
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp=false;
}
}


if (!xmlhttp){
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
}
/*@end @*/

if (!xmlhttp && window.createRequest) {
try {
xmlhttp = window.createRequest();
} catch (e) {
xmlhttp=false;
}
}


var please_wait = "Please wait...";

function open_url(url, targetId) {
if(!xmlhttp)return false;
var e=document.getElementById(targetId);if(!e)return false;
if(please_wait)e.innerHTML = please_wait;
xmlhttp.open("GET", url, true);
xmlhttp.onreadystatechange = function() { response(url, e); }
try{
xmlhttp.send(null);
}catch(l){
while(e.firstChild)e.removeChild(e.firstChild);//e.innerHTML="" the standard way
e.appendChild(document.createTextNode("request failed"));
}
}

function response(url, e) {
if(xmlhttp.readyState != 4)return;
var tmp= (xmlhttp.status == 200 || xmlhttp.status == 0) ? xmlhttp.responseText : "Ooops!! A broken link! Please contact the webmaster of this website ASAP and give him the following error code: " + xmlhttp.status+" "+xmlhttp.statusText;
var d=document.createElement("div");
d.innerHTML=tmp;
setTimeout(function(){
while(e.firstChild)e.removeChild(e.firstChild);//e.innerHTML="" the standard way
e.appendChild(d);
},10)
}


If anyone knows a way to make sure it works no matter what please tell me, or even another way to do this. My original intention was to be able to have a menu file to be inserted within each page of the site.
Thx for your time.