﻿function SearchRequest() {
    this.Make = '';
    this.CarzillaModelIds = [];
    this.PriceTo = 0;
    this.MileageFrom = 0;
    this.MileageTo = 0;
    this.PowerFrom = 0;
    this.PowerTo = 0;
    this.PriceFrom = 0;
    this.PriceTo = 0;
    this.FirstRegistrationYearFrom = 0;
    this.FirstRegistrationYearTo = 0;
    this.FuelType = '';
    this.BodyTypes = [];
    this.Regions = [];
    this.BaseColor;
    this.Equipment = [];
    this.Transmissions = [];
    this.VatShownSeparatly;
    this.VehicleStates = [];
    this.BranchId = [];
}

// Call WebService via jQuery 
var varType;
var varUrl;
var varData;
var varContentType;
var varDataType;
var varProcessData;
var varSuccessCal;

function CallService() {
    //alert(varData);
    $.ajax({
        type: varType, //GET or POST or PUT or DELETE verb
        url: varUrl, // Location of the service
        data: varData, //Data sent to server
        contentType: varContentType, // content type sent to server
        dataType: varDataType, //Expected data format from server
        processdata: varProcessData, //True or False
        success: varSuccessCall, //On Successfull service call
        error: ServiceFailed// When Service call fails
    });
}

function ServiceFailed(msg) {
    //alert(msg);
}
