//cross browser request 
function getHTTPObject() {
	var xhr = false;
	if (window.XMLHttpRequest) {
		//safari, firefox, opera, IE 7
		xhr = new XMLHttpRequest();
	} else if (window.AcitiveXobject) {
		try {
			//IE 5, 6
			xhr = new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e) {
			try {
				xhr=new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
				xhr =false;

			}
		}
	}
	return xhr;
}
//prepare request
function grabFile(file){
	var request = getHTTPObject();
	if (request){
		request.onreadystatechange =function(){
			parseResponse(request);
		};
		request.open("GET", file, true);
		request.send(null);
	}
}

//parse request and inject into content div
function parseResponse(request){
	if (request.readyState ==4){
		if(request.status ==200 || reguest.status ==304){
			var content= document.getElementById("content");
			content.innerHTML = request.responseText;

		}
	}
}
//allow for multiple onload events, takes a load function as argument
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}
//get the news onload
function showNews(){
	window.onload = grabFile("wordpress")
	return false;
}

addLoadEvent(showNews);



//preload images
function imagePreload(){
	idiot= new image;
	collages= new image;
	dots= new image;
	

	idiot.src="/media/static.gif";
	collages.src="/media/Dots.png";
    dots.src="/media/collages.gif";
}
//don't use addloadevent!
 onLoad(imagePreload);
//to do  
//make a function so all the images don't have to be listed but rather 
//it will loop through an array of all the images on the site