var xml;

function initPage(){
	// this is where all the specific functions get called
	
	// we begin by creating our ajax object
	xml = startAjax();
	
	if(!xml)
	{
		return; // no ajax, so just quit out now
	}
	
	initTestimonials();
	initLeftGallery();
	initRightGallery();
	
}

function addEvent(elm, evType, fn, useCapture){
	if(elm.addEventListener){
		elm.addEventListener(evType, fn, useCapture);
		return true;
	}
	else if (elm.attachEvent){
		var r = elm.attachEvent('on' + evType, fn);
		return r;
	}
	else{
		elm['on' + evType] = fn;
	}
}

addEvent(window, 'load', initPage, false);



function startAjax(){
	// returns an ajax object if possible
	var xmlHttp=null;
	try
  	{
  		// Firefox, Opera 8.0+, Safari
  		xmlHttp=new XMLHttpRequest();
  	}
	catch (e)
  	{
  		// Internet Explorer
  		try
    	{
    		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    	}
  		catch (e)
    	{
    		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    	}
  	}
	return xmlHttp;
}

