//AJAX CODE
function makeRequest(url, targetDiv) {
	var httpRequest;

	if (window.XMLHttpRequest) { // Mozilla, Safari, ...
		httpRequest = new XMLHttpRequest();
		if (httpRequest.overrideMimeType) {
			httpRequest.overrideMimeType('text/xml');
			// See note below about this line
		}
	} 
	else if (window.ActiveXObject) { // IE
		try {
			httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) {
			try {
				httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) {}
		}
	}

	if (!httpRequest) {
		alert('Cannot create an XMLHTTP instance');
		return false;
	}
	
	httpRequest.onreadystatechange = function() { 
		alertContents(httpRequest, targetDiv, url); 
	};
	
	httpRequest.open('GET', url, true);
	httpRequest.send('');

}

function alertContents(httpRequest, targetDiv, url) {
	if (httpRequest.readyState == 4) {
		if (httpRequest.status == 200) {
			placeHolderVar=document.getElementById(targetDiv);
			placeHolderVar.innerHTML=httpRequest.responseText;
			pageTracker._trackPageview("/" + url);
			pixelHack();
		} else {
			alert('There was a problem with the request.');
		}
	}

}
  
//ROLLOVER BUTTON
function rolloverButtons(divID, imgSrc) {
	document.getElementById(divID).style.backgroundImage = "url(images/buttons/" + imgSrc + ")";
}

//PIXEL HACK
window.onresize = pixelHack;

function pixelHack(){
	if (navigator.appName == "Microsoft Internet Explorer"){
		document.getElementById('pixelHack').style.marginLeft = "199px";	
	}
  	var myHeight = document.getElementById('bodyWrapper').offsetHeight - 300;
	document.getElementById('pixelHack').style.height = myHeight + "px";
}

//Pop-up gallery function
function popUp(urlVar) {
	galleryWindow = window.open (urlVar, 'Gallery', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=662,height=600');
}

function popUpBig(urlVar) {
	galleryWindow = window.open (urlVar, 'Gallery', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=662,height=681');
}
