
var ajax = new sack();

function showContent(){	// Displaying content in the content <div>
	$('loadDiv').innerHTML='';
	$('loadDiv').style.height='0px';
	$('loadDiv').style.overflow='hidden';
	$('continue').innerHTML = ajax.response;	// ajax.response is a variable that contains the content of the external file	
}
function evalContent()	// Displaying content in the content <div>
{
	//$('contentContainer').innerHTML=ajax.response;
eval(ajax.response);	// ajax.response is a variable that contains the content of the external file	
}
function showWaitMessage()
{
	$('loadDiv').innerHTML = '<img src="../../images/animated_loading.gif" /> Please wait';
}
function getAjaxFile(fileName,opt)
{
	
	ajax.requestFile = fileName;	// Specifying which file to get
	if(opt==true) ajax.onCompletion = evalContent;	
	else ajax.onCompletion = showContent;	// Specify function that will be executed after file has been found
	ajax.onLoading = showWaitMessage;	// Action when AJAX is loading the file
	ajax.runAJAX();		// Execute AJAX function	
}

///////////////////////////////////// another file call //////////////////////
function loadGeneralPage(url,opt)
{
	
	ajax.requestFile = url;	// Specifying which file to get
	if(opt==true) ajax.onCompletion = evalContent;	
	else ajax.onCompletion = showGeneralContent;	// Specify function that will be executed after file has been found
	ajax.onLoading = showGeneralWaitMessage;	// Action when AJAX is loading the file
	ajax.runAJAX();		// Execute AJAX function	
}
function showGeneralContent(){
	$('loadDiv1').style.height='0px';
	$('loadDiv1').style.overflow='hidden';
	$('loadDiv1').innerHTML='';
	$('mcontent').innerHTML = ajax.response;
	}
function showGeneralWaitMessage(){
	$('loadDiv1').innerHTML = '<img src="images/animated_loading.gif" /> Please wait';
	}