// Create reference for a new sack object to 
// handle all XMLHttpRequests to files on the 
// system.
var ajax;

function adjustWindowSize(){
    
    // Get the height of the current body
    var height = document.body.offsetHeight;
    
    // Hack to fix explorer's redraw bug for scrollbars            
    if (document.all) { //IE only
        document.body.style.overflow = 'auto';    
    }
    
    // Hack to fix safari's redraw bug for scrollbars
    // http://en.wikipedia.org/wiki/Wikipedia:Browser_notes#Mac_OS_X
    if (self.screenTop && self.screenX){
        window.resizeTo(self.outerWidth + 1, self.outerHeight);    
        window.resizeTo(self.outerWidth - 1, self.outerHeight);                
    }
}

function fetchContent(url) {
	ajax.resetVars();
	ajax.method  	 = "GET";
	ajax.requestFile = url;
	ajax.runAJAX();
} 

function setupContent(element) {
	ajax = new sack();
	ajax.element 	  = element;
	ajax.method  	  = "GET";
}

function toggleDisplay(element) {
	element.style.display = (element.style.display == 'block') ? 'none' : 'block';
}