﻿// Include relevant Javascript config files.
document.write('<script type="text/javascript" src="js_inc/functions.js"></script>');
document.write('<script type="text/javascript" src="js_inc/config/general.js"></script>');
document.write('<script type="text/javascript" src="js_inc/ajax/menu.js"></script>');
document.write('<script type="text/javascript" src="js_inc/ajax/main.js"></script>');
document.write('<script type="text/javascript" src="js_inc/ajax/user.js"></script>');
document.write('<script type="text/javascript" src="js_inc/ajax/shows.js"></script>');
document.write('<script type="text/javascript" src="js_inc/ajax/posts.js"></script>');
document.write('<script type="text/javascript" src="js_inc/ajax/watch_live.js"></script>');
document.write('<script type="text/javascript" src="js_inc/ajax/form_functions.js"></script>');

// Gets the browser specific XmlHttpRequest Object
function xmlHttpRequestObject() {
 
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest();
	} else if(window.ActiveXObject) {
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	
}

// Refreshes all page elements.
function refreshAll() {
	menuRefresh();  // Refreshes the menu bar.
	mainRefresh();  // Refreshes the main window.
	showsRefresh(); // Refreshes the Recent Show Announcements.
	postsRefresh("init"); // Refreshes the Recent Forum Posts.
	userRefresh();  // Refreshes the UserData box.
}

// Startup Commands -- What to do when the page loads.
function doPageStart() {

// Trigger the startup functions.
	refreshAll();
	
// Perform any initialization commands.
	// randomizeLogo(); // Picks a random logo image for the header.
	
	// Add a Refresh link for debugging purposes.
	// document.getElementById("div_logo_image").innerHTML = "<br /><a href=\"\" onClick=\"refreshAll(); return false;\">Refresh</a>";
		
}
