$.fn.clearForm = function() {
  return this.each(function() {
	var type = this.type, tag = this.tagName.toLowerCase();
	if (tag == 'form')
	  return $(':input',this).clearForm();
	if (type == 'text' || type == 'password' || tag == 'textarea')
	  this.value = '';
	else if (type == 'checkbox' || type == 'radio')
	  this.checked = false;
	else if (tag == 'select')
	  this.selectedIndex = -1;
  });
};
//
$(document).ready(function(){
	
	$('#form_brochure').livequery('submit', function(event){//alert("mahmoud");
		var param = $('#form_brochure :input').serialize();
		//alert(param);
			$.post('php/brochure-send.php', param, function(data)
			{
				$('#brochure-div').html(data);
			});
		return false;
	});
	
	$('#reset').livequery('click', function(event){
		$('#form_brochure').clearForm();
		//return false;
	});
});
