
function loadModel(action,div,id){
    $("#AJAX_LODE_CONTENT").html("<center><img src='../images/ajax-loader.gif' /></center>");
    dataURL = "action="+action+"&id="+id,
    $.ajax({
    type: "POST",
    url: http_path+"manager/ajax-lode/general_ajax_code.php",
    data: dataURL,
    success: function(msg){
        $("#"+div).html(msg);	
    }
 });
}
function quickSerach(PAGE){   // lode Body type for dash board

    $("#AJAX_LODE_SEARCH_DATA").html("<div style='background: none repeat scroll 0 0 #000000; float: left; height:70%; min-height: 105px; min-width:20%; opacity: 0.5; -moz-opacity: 0.5; -webkit-opacity: 0.5; position: absolute; width: 57%; z-index: 50;'><img src='../images/siteimages/loadinfo.gif'  style='margin:21% 0 0 41%;'/></div>");

	$.post(http_path+"ajax-lode/serach_result.php",{ads_car_brand:$("#ads_car_brand").val(),ads_car_model:$("#ads_car_model").val(),yearfrom:$("#yearfrom").val(),yearto:$("#yearto").val(),ads_enginefrom:$("#ads_enginefrom").val(),ads_engineto:$("#ads_engineto").val(),action:"quickSerach",page:PAGE},function(data){
// alert(data);
        $("#AJAX_LODE_SEARCH_DATA").html(data);	
    });
       
    }
 function advanceSearch(PAGE){   // lode Body type for dash board
   $("#AJAX_LODE_SEARCH_DATA").html("<div style='background: none repeat scroll 0 0 #000000; float: left; height:70%; min-height: 105px; min-width:20%; opacity: 0.5; -moz-opacity: 0.5; -webkit-opacity: 0.5; position: absolute; width: 57%; z-index: 50;'><img src='../images/siteimages/loadinfo.gif'  style='margin:21% 0 0 41%;'/></div>");
    $.post(http_path+"ajax-lode/serach_result.php",{ads_car_brand:$("#ads_car_brand").val(),ads_car_model:$("#ads_car_model").val(),yearfrom:$("#yearfrom").val(),yearto:$("#yearto").val(),ads_enginefrom:$("#ads_enginefrom").val(),ads_engineto:$("#ads_engineto").val(),ads_car_type:$("#ads_car_type").val(),ads_ex_color:$("#ads_ex_color").val(),
	ads_fuel:$("#ads_fuel").val(),ads_transmission:$("#ads_transmission").val(),ads_drive_type:$("#ads_drive_type").val(),action:"advanceSerach",page:PAGE},function(data){
		   
        $("#AJAX_LODE_SEARCH_DATA").html(data);	
    });
       
    }
 function setBodyType(id){
	 document.getElementById('ads_car_type').value=id;
 }
 function setColor(id){
	 document.getElementById('ads_ex_color').value=id;
 }

function addUser()
{
        alert('giya');
        var user_firstname = document.getElementById("user_firstname").value;
        var user_lastname = document.getElementById("user_lastname").value;
        var user_email = document.getElementById("user_email").value;
        var user_phonenum = document.getElementById("user_phonenum").value;
        var user_postalcode = document.getElementById("user_postalcode").value;
        var user_dob = document.getElementById("user_dob").value;
        var user_password = document.getElementById("user_password").value;
        var user_confirm = document.getElementById("user_confirm").value;
        var user_type = document.getElementById("user_type").value;
        var active = document.getElementById("active").value;

        //alert(model_make_name);
        alert(user_firstname);
        if(user_firstname =='' || user_lastname=='' || user_email=='' || user_phonenum==''){
            
            alert('here');
            //$("#error").html('Insert Missing Field');
            
        }else{
            alert("else");
        $("#ajaxloadimg").show();
           $.ajax({
           type: "POST",
           url: "../manager/_controller/add__vehicle_type_controller.php",
           data: "user_firstname=" +user_firstname+"&user_lastname="+user_lastname+"&user_email="+user_email+"&user_phonenum="+user_phonenum+"&user_postalcode="+user_postalcode+"&action="+"action",
           success: function(msg)
           {
                 alert(msg);
                 $("#ajaxloadimg").hide();
            	 $("#article-add-dialog").fadeIn(2000);
	 
    	 	document.getElementById("user_firstname").value = "";
            document.getElementById("user_lastname").value = "";
            document.getElementById("user_email").value = "";
            document.getElementById("user_phonenum").value = "";
            document.getElementById("user_postalcode").value = "";
            document.getElementById("user_dob").value = "";
            document.getElementById("user_password").value = "";
            document.getElementById("user_confirm").value = "";
            document.getElementById("user_type").value = "";
            document.getElementById("active").value = "";
          }
   });
   }//end of else

}
