function switchContent(aDoc){
	var curContent = document.getElementById('curContent');
	var curDir = aDoc.substring(0,aDoc.indexOf("_"));
	// var firstContent = document.getElementById('firstContent');
	var myPHPfile = curDir + '/' + aDoc + '.php';
	// alert("myPHPFile:" + myPHPfile);
 	curContent.innerHTML = "";
 	// firstContent.style.visibility = "hidden";
 	// curContent.style.visibility = "visible";
  try{     
      var oAjax=new Ajax.Updater({success: 'curContent'},myPHPfile, { insertion: Insertion.top });
  }catch(e){
      alert('Failed to call Ajax');
  }
 
}

function switchContentJQ(aDoc){
	var curContent = document.getElementById('curContent');
	var newContent = document.getElementById(aDoc).innerHTML;
	// var firstContent = document.getElementById('firstContent');
	var curDir = aDoc.substring(0,aDoc.indexOf("_"));
	var quotePHP = 'get_quote.php';
	var myPHPfile = curDir + '/' + aDoc + '.php';
	// alert("myPHPFile:" + myPHPfile);
 	curContent.innerHTML = "";
 	// firstContent.style.visibility = "hidden";
 	// curContent.style.visibility = "visible";
    $("#curContent").load(quotePHP);
    $("#curContent").append(newContent);
    //$("<div>").load(myPHPfile, function() {
    //	$(this).appendTo('#curContent')
    //	$('#curContent').cycle();});
 
}

function addOPO(){
	 // var curVehNum = document.getElementById('curCarNum').value;
	 // curVehNum++;
	 
	 var vehicleNum_val=parseInt($("#curCarNum").val()) + 1;
	 $("#curCarNum").val(vehicleNum_val);
	 
	 $.post("ajax/add_opo.php", {vehicleNum : vehicleNum_val}, function(data){
	 	if (data.length>0){
	 		$("#owners").append(data);
	 	}
	})
	// document.getElementById('curCarNum').value = curVehNum;
}

function addPayroll(){
	 // var curVehNum = document.getElementById('curCarNum').value;
	 // curVehNum++;
	 
	 var vehicleNum_val=parseInt($("#curCarNum").val()) + 1;
	 $("#curCarNum").val(vehicleNum_val);
	 
	 $.post("ajax/add_payroll.php", {vehicleNum : vehicleNum_val}, function(data){
	 	if (data.length>0){
	 		$("#payroll").append(data);
	 	}
	})
	// document.getElementById('curCarNum').value = curVehNum;
}


function addVehicle(){
	 // var curVehNum = document.getElementById('curCarNum').value;
	 // curVehNum++;
	 
	 var vehicleNum_val=parseInt($("#curCarNum").val()) + 1;
	 $("#curCarNum").val(vehicleNum_val);
	 
	 $.post("ajax/add_vehicle.php", {vehicleNum : vehicleNum_val}, function(data){
	 	if (data.length>0){
	 		$("#vehicles").append(data);
	 	}
	})
	// document.getElementById('curCarNum').value = curVehNum;
}

function addRecVehicle(){
	 // var curVehNum = document.getElementById('curCarNum').value;
	 // curVehNum++;
	 
	 var vehicleNum_val=parseInt($("#curRecVehNum").val()) + 1;
	 $("#curRecVehNum").val(vehicleNum_val);
	 
	 $.post("ajax/add_recvehicle.php", {vehicleNum : vehicleNum_val}, function(data){
	 	if (data.length>0){
	 		$("#recvehicles").append(data);
	 	}
	})
	// document.getElementById('curCarNum').value = curVehNum;
}

function addDriver(){
	 // var curVehNum = document.getElementById('curCarNum').value;
	 // curVehNum++;
	 
	 var driverNum_val=parseInt($("#curDriverNum").val()) + 1;
	 $("#curDriverNum").val(driverNum_val);
	 
	 $.post("ajax/add_driver.php", {driverNum : driverNum_val}, function(data){
	 	if (data.length>0){
	 		$("#drivers").append(data);
	 	}
	})
	// document.getElementById('curCarNum').value = curVehNum;
}
function addOperator(){
	 // var curVehNum = document.getElementById('curCarNum').value;
	 // curVehNum++;
	 
	 var driverNum_val=parseInt($("#curDriverNum").val()) + 1;
	 $("#curDriverNum").val(driverNum_val);
	 
	 $.post("ajax/add_operator.php", {driverNum : driverNum_val}, function(data){
	 	if (data.length>0){
	 		$("#operators").append(data);
	 	}
	})
	// document.getElementById('curCarNum').value = curVehNum;
}
function addChild(){
	 // var curVehNum = document.getElementById('curCarNum').value;
	 // curVehNum++;
	 
	 var kidNum_val=parseInt($("#curKidNum").val()) + 1;
	 $("#curKidNum").val(kidNum_val);
	 
	 $.post("ajax/add_child.php", {kidNum : kidNum_val}, function(data){
	 	if (data.length>0){
	 		$("#children").append(data);
	 	}
	})
	// document.getElementById('curCarNum').value = curVehNum;
}

function addChildHealth(){
	 // var curVehNum = document.getElementById('curCarNum').value;
	 // curVehNum++;
	 
	 var kidNum_val=parseInt($("#curKidNum").val()) + 1;
	 $("#curKidNum").val(kidNum_val);
	 
	 $.post("ajax/add_childhealth.php", {kidNum : kidNum_val}, function(data){
	 	if (data.length>0){
	 		$("#children").append(data);
	 	}
	})
	// document.getElementById('curCarNum').value = curVehNum;
}

function addBoat(){
	 // var curVehNum = document.getElementById('curCarNum').value;
	 // curVehNum++;
	 
	 var boatNum_val=parseInt($("#curBoatNum").val()) + 1;
	 $("#curBoatNum").val(boatNum_val);
	 
	 $.post("ajax/add_boat.php", {boatNum : boatNum_val}, function(data){
	 	if (data.length>0){
	 		$("#boats").append(data);
	 	}
	})
	// document.getElementById('curCarNum').value = curVehNum;
}
function addProperty(){
	 // var curVehNum = document.getElementById('curCarNum').value;
	 // curVehNum++;
	 
	 var propNum_val=parseInt($("#curPropNum").val()) + 1;
	 $("#curPropNum").val(propNum_val);
	 
	 $.post("ajax/add_property.php", {propNum : propNum_val}, function(data){
	 	if (data.length>0){
	 		$("#properties").append(data);
	 	}
	})
	// document.getElementById('curCarNum').value = curVehNum;
}
function addViolation(){
	 // var curVehNum = document.getElementById('curCarNum').value;
	 // curVehNum++;
	 
	 var violationNum_val=parseInt($("#curViolationNum").val()) + 1;
	 $("#curViolationNum").val(violationNum_val);
	 
	 $.post("ajax/add_violation.php", {violationNum : violationNum_val}, function(data){
	 	if (data.length>0){
	 		$("#violations").append(data);
	 	}
	})
	// document.getElementById('curCarNum').value = curVehNum;
}

function toggleBox(){
	
	//toggle message_body
		
		$("#testme").next(".accordian").hide();
	
	

}

function origToggleBox(){

$(".accordion h3:first").addClass("active");
	$(".accordion p:not(:first)").hide();

	$(".accordion h3").click(function(){
		$(this).next("p").slideToggle("slow")
		.siblings("p:visible").slideUp("slow");
		$(this).toggleClass("active");
		$(this).siblings("h3").removeClass("active");
	});

}