// JavaScript Documentfunction showbuildings(){	$('#addbuilding').css({display: "block"});	$('#addcontacts').css({display: "none"});	$('#content').html("");	$('#instructions').html("");	$('#instructions').load('instructions/buildings.html');	}function showcontacts(){	$('#addbuilding').css({display: "none"});	$('#content').html("");	$('#addcontacts').css({display: "block"});	$.post("process/contacts1.php",{},function(data){$('#addcontacts').html(data);});	$('#instructions').html("");	$('#instructions').load('instructions/contacts.html');}function contactsbuildings(){	$('#addbuilding').css({display: "none"});	$('#content').html("");	$('#addcontacts').html("");	$('#addcontacts').css({display: "block"});	$.post("process/contactsbuildingsproc.php",{},function(data){$('#content').html(data);});	$('#instructions').html("");	$('#instructions').load('instructions/contactsbuilding.html');}function viewaddbuildings(a){	$('#addbuilding').css({display: "none"});	$('#content').html("");	$('#addcontacts').html("");	$('#addcontacts').css({display: "block"});	$.post("process/viewaddbuildingsproc.php",{a:a},function(data){$('#addcontacts').html(data);});	}function addbuildingcontact(a){	var b = $('#buildinglist2').val();	$('#addbuilding').css({display: "none"});	$('#content').html("");	$('#addcontacts').html("");	$('#addcontacts').css({display: "block"});	$.post("process/addbuildingcontactproc.php",{a:a,b:b},function(data){$('#addcontacts').html(data);});}function deletebuildingcontact(a,b){	var answer = confirm("You are about to permanently remove the selected building from the contact shown, it will not be recoverable. Click 'OK' to remove this building or click 'Cancel' to abort this process");	if (answer)	{	$('#addbuilding').css({display: "none"});	$('#content').html("");	$('#addcontacts').html("");	$('#addcontacts').css({display: "block"});		$.post("process/deletebuildingcontactproc.php",{a:a,b:b},function(data){$('#addcontacts').html(data);});	}}	function addbuilding(){	a = $('#buildingname').val();	if (a == "")	{		alert('You must enter a building name');	}	else	{		$('#content').html("");		$.post("process/addbuildingprocess.php",{a:a},function(data){$('#content').html(data);});		$('#buildingname').val("");	}}function viewallbuildings(){	$('#content').html("");	$.post("process/viewallbuildingsproc.php",{},function(data){$('#content').html(data);});	$('#instructions').html("");	$('#instructions').load('instructions/viewallbuildings.html');}function deletebuilding(a){	var answer = confirm("You are about to permanently delete the selected building from the database, it will not be recoverable.  Click 'OK' to delete this building or click 'Cancel' to abort this process");	if (answer)	{	$.post("process/deletebuildingproc.php",{a:a},function(data){$('#content').html(data);});	}}function addcontact(){	var problem = "no";	for(i=0;i<6;i++)	{	a = $('#b'+i).val();		if (a == "")		{			$('#a'+i).html("*");			problem = "yes";		}		else		{			$('#a'+i).html("");			problem == "no";		}	}	if (problem == "yes")	{		alert("Fields marked with '*' are required");	}	else	{		$('#content').html("");		b = $('#b1').val();		c = $('#b2').val();		d = $('#b3').val();		e = $('#b4').val();		f = $('#b5').val();		g = $('#emergency1').val();		h = $('#emergency2').val();		$.post("process/addcontactproc.php",{b:b,c:c,d:d,e:e,f:f,g:g,h:h},function(data){$('#content').html(data);});		$('#addcontacts').html("");		$.post("process/contacts1.php",{},function(data){$('#addcontacts').html(data);});	}}function viewallcontacts(){	$('#content').html("");	$.post("process/viewallcontactsproc.php",{},function(data){$('#content').html(data);});	$('#instructions').html("");	$('#instructions').load('instructions/viewallcontacts.html');}function updatecontact(a){	$('#addbuilding').css({display: "none"});	$('#content').html("");	$('#addcontacts').css({display: "block"});	$.post("process/contacts2.php",{a:a},function(data){$('#addcontacts').html(data);});}function updatecontact2(z){	var problem = "no";	for(i=0;i<6;i++)	{	a = $('#b'+i).val();		if (a == "")		{			$('#a'+i).html("*");			problem = "yes";		}		else		{			$('#a'+i).html("");			problem == "no";		}	}	if (problem == "yes")	{		alert("Fields marked with '*' are required");	}	else	{		$('#content').html("");		b = $('#b1').val();		c = $('#b2').val();		d = $('#b3').val();		e = $('#b4').val();		f = $('#b5').val();		g = $('#emergency1').val();		h = $('#emergency2').val();		$.post("process/updatecontactproc.php",{z:z,b:b,c:c,d:d,e:e,f:f,g:g,h:h},function(data){$('#content').html(data);});		$('#addcontacts').html("");		$.post("process/contacts1.php",{},function(data){$('#addcontacts').html(data);});	}}function deletecontact(a){	var answer = confirm("You are about to permanently delete the selected contact from the database. Their information will not be recoverable.  Click 'OK' to delete or click 'Cancel' to abort this process");	if (answer)	{	$.post("process/deletecontactproc.php",{a:a},function(data){$('#content').html(data);});	}}function getpagebuilding(a){	$('#content') .load('process/viewallbuildingsproc.php',{'p': a});}function getpagecontacts(a){	$('#content') .load('process/viewallcontactsproc.php',{'p': a});}function getpagecontactsbuildings(a){	$('#content') .load('process/contactsbuildingsproc.php',{'p': a});}function viewcontact(){	var a = $('#viewcontactinfo').val();	$('#viewcontacts').html("");	$.post("process/viewcontactsandinfo.php",{a:a},function(data){$('#viewcontacts').html(data);});}	
