
function clearInput(obj,text) {
	if ($(obj).value == text) {
		$(obj).value = "";
	}
}

function fillInput(obj,text) {
	if ($(obj).value == "") {
		$(obj).value = text;
	}
}


function filialfinderUpdateList() {
	
	new Ajax.Updater(	'filialfinderliste', 
						'../requests/update_filialliste.php', { 
						method: 'post',
						parameters: {
							fwhere: $F('fwhere'),
							fexistingtrue: $F('fexistingtrue'),
							fexistingfalse: $F('fexistingfalse'),
							fshopin: $F('fshopin'),
							ftypedepot: $F('ftypedepot'),
							ftypehome: $F('ftypehome'),
							ftypeoutlet: $F('ftypeoutlet'),
							ftypexmas: $F('ftypexmas'),
							fcountry: $F('fcountry'),
							request: 'true',
							l_pre2: l_pre
						}
						
				});
	
}

function filialfinderShowDetail(id) {

	noopen = false;
	
	$$('.row').collect(function(element) {
		if (element.hasClassName("rowactive")) {
			element.removeClassName("rowactive");
			new Effect.SlideUp(element.firstDescendant().next(0));
			
			if (element.firstDescendant().next(0).identify() == $("filialfinderdetail"+id).identify()) {
				noopen = true;
			}
		}
	});
	
	if (!noopen) {
		new Ajax.Updater(	'ffinner'+id, 
							'../requests/update_filialdetail.php', { 
							method: 'post',
							parameters: {
								f_id: id,
								l_pre2: l_pre
							},
							onSuccess: function() {
								$('row'+id).addClassName("rowactive");
								new Effect.SlideDown("filialfinderdetail"+id);
							}
		});
	}

}

