var myPrefetchedIndexPage;
$.ajax({
  url: "index.php?ajax=1",
  cache: true,
  success: function(html){
	myPrefetchedIndexPage = html;
  }
})

var myPrefetchedIndustryPage;
$.ajax({
  url: "industry.php?ajax=1",
  cache: true,
  success: function(html){
	myPrefetchedIndustryPage = html;
  }
})

var myPrefetchedPatientsPage;
$.ajax({
  url: "patients.php?ajax=1",
  cache: true,
  success: function(html){
	myPrefetchedPatientsPage = html;
  }
})

var myPrefetchedPatientFormPage;
$.ajax({
	url: "patients-form.php?ajax=1",
	cache: true,
	success: function(html){
	myPrefetchedPatientFormPage = html;
}
})


function loadPatients() {
	// load industry page on click
	//$("#ajax_contents").load("patients.html");
//	alert(myPrefetchedPatientsPage);
	if (myPrefetchedPatientsPage && myPrefetchedPatientsPage != "")
		$("#ajax_contents").html(myPrefetchedPatientsPage);
	else
		$("#ajax_contents").load("patients.php?ajax=1");
}

function loadIndustry() {
	// load industry page on click
//	$("#ajax_contents").load("industry.html");
//	alert(myPrefetchedIndustryPage);
	if (myPrefetchedIndustryPage && myPrefetchedIndustryPage != "")
		$("#ajax_contents").html(myPrefetchedIndustryPage);
	else
		$("#ajax_contents").load("industry.php?ajax=1");
}

function loadIndex() {
	// load index page on click
//	$("#ajax_contents").load("index.html");
//	alert(myPrefetchedIndexPage);
	if (myPrefetchedIndexPage && myPrefetchedIndexPage != "")
		$("#ajax_contents").html(myPrefetchedIndexPage);
	else
		$("#ajax_contents").load("index.php?ajax=1");
}

function Patients_Form()
{
	if (myPrefetchedPatientFormPage && myPrefetchedPatientFormPage != "")
		$("#ajax_contents").html(myPrefetchedPatientFormPage);
	else
		$("#ajax_contents").load("patients-form.php?ajax=1");
	
}
