function searchbox(mode) {
	if(mode == 1) {
		if($('shopsearch').value == $('defsearch').value) $('shopsearch').value = "";
	}
	else {
		if($('shopsearch').value == "") $('shopsearch').value = $('defsearch').value;
	}
}

function loadcat(baseurl) {
	var cat = $('cat').value;
	window.location = baseurl + 'content/client_directory/?cat=' + cat;
}
function loadserv(baseurl) {
	var cat = $('cat').value;
	window.location = baseurl + 'content/company_directory/?cat=' + cat;
}

function checksize(el) {
	var oh = $(el).style.height;
	oh = oh.replace(/px/g, "");
	$(el).style.height = "1px";
	if($(el).scrollHeight < 32) var nh = 32;
	else var nh = $(el).scrollHeight;
	$(el).style.height = nh + "px";
}

var initboxes = new Array();
function checkchange(box) {
	var show;
	if(box == 'status' || box == 'loanpurpose' || box == 'howhear' || box == 'activity') {
		if($(box).value == $(box).length - 1) show = "block";
		else show = "none";
		$(box + 'other').style.display = show;
		if(show == "block" && initboxes[box] == 1) $(box + 'other').focus();
		initboxes[box] = 1;
	}
	if(box == 'status') {
		if($(box).value == 3) show = "block";
		else show = "none";
		$('label_regno').style.display = show;
		$('regno').style.display = show;
	}
	if(box == 'efg_0' || box == 'efg_1') {
		if($('efg_0').checked == true) show = "block";
		else show = "none";
		$('label_efglender').style.display = show;
		$('efglender').style.display = show;
		$('label_efgamount').style.display = show;
		$('efgamount').style.display = show;
		$('label_efgref').style.display = show;
		$('efgref').style.display = show;
	}
	if(box == 'otherfunding_0' || box == 'otherfunding_1') {
		if($('otherfunding_0').checked == true) show = "block";
		else show = "none";
		$('otherfundbox').style.display = show;
	}
}
