var ajax = new sack();
var contentObj1
var contentObj2

var isLoaded1
var isLoaded2


function showContent1()	// Displaying content in the content <div>
{
	contentObj1.innerHTML = ajax.response;	// ajax.response is a variable that contains the content of the external file	
	isLoaded1 = true;
	if( !isLoaded2 )
		getAjaxFile2('../../_inc/jobs_getElements2.ajax.php')
	
}
function showContent2()	// Displaying content in the content <div>
{
	contentObj2.innerHTML = ajax.response;	// ajax.response is a variable that contains the content of the external file	
	isLoaded2 = true;
}

function showWaitMessage1()
{
	contentObj1.innerHTML = 'Incarcare oferte locuri de munca .....';
}
function showWaitMessage2()
{
	contentObj2.innerHTML = 'Incarcare cereri locuri de munca .....';
}
function getAjaxFile1(fileName)
{
	ajax.requestFile = fileName;	// Specifying which file to get
	ajax.onCompletion = showContent1;	// Specify function that will be executed after file has been found
	ajax.onLoading = showWaitMessage1;	// Action when AJAX is loading the file
	ajax.runAJAX();		// Execute AJAX function	
}
function getAjaxFile2(fileName)
{
	ajax.requestFile = fileName;	// Specifying which file to get
	ajax.onCompletion = showContent2;	// Specify function that will be executed after file has been found
	ajax.onLoading = showWaitMessage2;	// Action when AJAX is loading the file
	ajax.runAJAX();		// Execute AJAX function	
}

function initAjaxDemo()
{
	contentObj1 = document.getElementById('contentContainer1');
	contentObj2 = document.getElementById('contentContainer2');

	isLoaded1 = false ;
	isLoaded2 = false ;

	getAjaxFile1('../../_inc/jobs_getElements1.ajax.php');
//	getAjaxFile2('../_php/logistic_getElements2.ajax.php');
//	getAjaxFile3('../_php/logistic_getElements3.ajax.php');
//	getAjaxFile4('../_php/logistic_getElements4.ajax.php');
}
window.onload = initAjaxDemo;

