
function showHideHomeDetailsForScrapbook() {
	var value = document.editForm.homeId.options[document.editForm.homeId.selectedIndex].value;
	// alert("The value is currently > " + value);
	if (value == 0) {
	 	Effect.SlideDown('detailssection');
	} else {
		Effect.SlideUp('detailssection');
	}
}

function showHide(blockId) {
	var currentState = document.getElementById(blockId).style.display;
	if (currentState == "none") {
		Effect.SlideDown(blockId);
	} else {
		Effect.SlideUp(blockId);
	}
}

var ajax = new sack();

function getCountyList(sel)
{
	var stateCode = sel.options[sel.selectedIndex].value;
	if(stateCode.length>0){
		ajax.requestFile = '/lib/ajax/getCounties.php?stateCode='+stateCode;	// Specifying which file to get
		ajax.onCompletion = createCounties;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}


function getCountyListForLocator(sel)
{
	var stateCode = sel.options[sel.selectedIndex].value;
	if(stateCode.length>0){
		ajax.requestFile = '/lib/ajax/getCounties.php?stateCode='+stateCode;	// Specifying which file to get
		ajax.onCompletion = createCountiesForLocator;	// Specify function that will be executed after file has been found
		ajax.runAJAX();		// Execute AJAX function
	}
}


function createCountiesForLocator()
{
	document.getElementById('countyId').options.length = 0;	
	var obj = document.getElementById('countyId');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}

function createCounties()
{
	document.getElementById('addrCountyId').options.length = 0;	
	var obj = document.getElementById('addrCountyId');
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}

function getGeoCodes() {
	ajax.requestFile = '/lib/ajax/getGeoCode.php?';
	ajax.requestFile += 'addressNumber=' + document.editForm.addrNum.value;
	ajax.requestFile += '&addressDir=' + document.editForm.addrStrDirId.value;
	ajax.requestFile += '&address=' + document.editForm.addrStrName.value;
	ajax.requestFile += '&addressStrType=' + document.editForm.addrStrTypeId.value;
	ajax.requestFile += '&city=' + document.editForm.addrStrTypeId.value;
	ajax.requestFile += '&state=' + document.editForm.addrStateId.value;
	ajax.requestFile += '&zip=' + document.editForm.addrZip.value;
	ajax.onCompletion = populateGeoCodes;	// Specify function that will be executed after file has been found
	ajax.runAJAX();		// Execute AJAX function
}


function populateGeoCodes()
{
	eval(ajax.response);	// Executing the response from Ajax as Javascript code	
}

