function ajax(store,module,method,form) {
	if (typeof store == 'undefined') var store='store';
	if (typeof module == 'undefined') var module='show';
	if (typeof method == 'undefined') var method='404';
	if (form) {
		str = form.serializeArray();
		form = JSON.stringify(str);
	} ;
	$.post('/ajax/'+module+'/'+method, {form:form}, function(data) {
	  	store.html(data);
	});
}	

function ajax_formval(store,module,method,form) {
	if (typeof store == 'undefined') var store='store';
	if (typeof module == 'undefined') var module='show';
	if (typeof method == 'undefined') var method='404';
	if (form) {
		str = form.serializeArray();
		form = JSON.stringify(str);
	} ;
	$.post('/ajax/'+module+'/'+method, {form:form}, function(data) {
	  	store.val(data);
	});
}	

function ajax_val(store,module,method,form) {
	if (typeof store == 'undefined') var store='store';
	if (typeof module == 'undefined') var module='show';
	if (typeof method == 'undefined') var method='404';
	if (form) {
		form = JSON.stringify(form);
	} ;
	$.post('/ajax/'+module+'/'+method, {form:form}, function(data) {
	  	store.val(data);
	});
}


function ajax_clear(module,method,form) {
	if (typeof store == 'undefined') var store='store';
	if (typeof module == 'undefined') var module='show';
	if (typeof method == 'undefined') var method='404';
	if (form) {
		str = form.serializeArray();
		form = JSON.stringify(str);
	} ;
	$.post('/ajax/'+module+'/'+method, {form:form}, function(data) {
	  	
	});
}

$(function() {
	var user_enter = $("#user-enter");
	
	user_enter.click(function() {		
		ajax($('#store'),'user','enter');
	});
});

function show_hide(id) {
	win = document.getElementById(id);
	if (win.style.display=='none') win.style.display='block';
	else win.style.display='none';
}
