jQuery(document).ready(function(){

	$('#ppchckoutdemo').submit(function(){
		var thisform = $(this);
		var total=0;
		$("#ppchckoutdemo select").each(function(){
			total+=Number($(this).val());
		});
		if(total>0){
			$(thisform).ajaxSubmit(function(data){   				
   				$('#ppchckoutdemo').parent().html(data);
   			});			
		} else {
			//alert('not  valid');
		}	
		return false;
	});

});

jQuery.fn.clearForm = function() {
  return this.each(function() {
 var type = this.type, tag = this.tagName.toLowerCase();
 if (tag == 'form')
   return jQuery(':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;
  });
};
