var forms = new Array();
var handlers = new Array();
function newFn () {
	alert($('#forms_div').html())
}
function toggle_form(id) {
//	if (typeof(forms[id]) == 'undefined') {
//		$('#forms_div').load('forms.php?form='+id,{},function() {forms[id] = $('#forms_div').html()});
//	} else {
//		$('#forms_div').html(forms[id]);
//	}
$('#forms_div').load('forms.php?form='+id,{},function() {});
//$('#forms_div').load('forms.php?form='+id,{},function() {forms[id] = $('#forms_div').html()});

}
function verify_form(id) {
	$("#client_form").submit(function() {

	})
	//
	//	if (typeof(handlers[id]) == 'undefined') {
	//		$('#forms_div').load('forms.php?form='+id,{},function() {handlers[id] = $('#forms_div').html()});
	//	} else {
	//		$('#forms_div').html(handlers[id]);
	//	}
}
setFocus = function(e){
	if (document.getElementById(e)) document.getElementById(e).focus();
	return this;
}
function submit_form() {
		var params = {};
		$("#client_form")
		.find("input[@checked], input[@type='text'], input[@type='hidden'], input[@type='password'], input[@type='submit'], option[@selected], textarea")
		.filter(":enabled")
		.each(function() {
			params[ this.name || this.id || this.parentNode.name || this.parentNode.id ] = this.value;
		});

		$('#forms_div').load($("#client_form").get(0).getAttribute("action_ajax") , params, function(){
//			var forms = new Array();
			window.location='#message_place';
			focus_field = $('#focus_field').get(0).getAttribute("value");
			if (document.getElementById(focus_field)) document.getElementById(focus_field).focus();
					});
		return false;
	}

function remember_form() {
}

