
function form2array(theForm) {
  var type;
  var arr = new Object;
  for(i=0; i<theForm.elements.length; i++){
    type = theForm.elements[i].type;
    if(type == "text" || type == "textarea" || type == "password" || type == "hidden"  /*|| type == "button"*/ || type == "select-one"){
      arr[theForm.elements[i].name] = theForm.elements[i].value;
    } else if(type == "checkbox" || type == "radio"){
      if ( theForm.elements[i].checked ) {
        arr[theForm.elements[i].name] = theForm.elements[i].value;
      }
    }
  }
  return arr;
}


      
     
  

function repair_check(myThis)
{
	
	  var query = form2array(myThis);
	  $.ajax({
	    type: "POST",
	    url: "/wp-content/themes/alisa/ajax.php",
	    data: query,
	    dataType: "json",
	    success: function(data){

			if( data && data['data'] ){
				$('#repair_status').html(data['data']);
				$('#repair_status').show();
				
			}
		    
//	      if( !data['error'] ){
//	        if( data['reloadNeed'] == 'y' ){
//	          alert(data['statusMess']);
//	          window.location = data['reloadUrl'];
//	        }else{
//	          document.getElementById("additional_status").innerHTML = data['statusMess'];
//	        }
//	      }else{
//	        document.getElementById("additional_status").innerHTML = data['statusMess'];
//	      }  
	            
	    }
	    
	  });  	
	return false;
}
