//this file accompanies the template's default ajax.js

//global var used in swapContent
var eventsAttached = false;


//simple ajax wrapper that will also be sure to attach onclick events to the navigation to
//stop safari's players when clicked
function swapContent(url){
	xmlhttpURL(url,load);
	try { 
		var navItems = document.getElementById('mnav').getElementsByTagName("a");
		if (!eventsAttached){
			for (x=0; x < navItems.length; x++)
				AttachEvent(navItems[x], "click", stopPlayer);
			eventsAttached = true;
		}
	}
	catch(err) {alert( err );}
}

function load(){
	if (xmlhttp.readyState == 4 && (xmlhttp.status==200 || window.location.href.indexOf("http")==-1)){
		document.getElementById("feature").innerHTML = xmlhttp.responseText;
		loadAjax(); //reload if they click again (IE needs this)
	}
}
function stopPlayer() { 
	try {
		document.qtplayer.Stop();
	} 
	catch(err) {} 
}
	
