/* 
 * This file contains functions used by the Image Editor 
 */

//this function helps to show the form for editing customer reviews
function view_selectedCar(input)
{
       var delim =',';
       var car_id =parseInt(getTokenAt(input,0,delim,2));
       var div_car_more_info_id=getTokenAt(input,1,delim,2);

       var action_file_path = "view_car/index.php";
       var actioncmd = "?view_selected_car_request=1&&"+
       "car_id="+car_id;

       var url = action_file_path+actioncmd;
       url=url+"&sid="+Math.random();

      //get the content to display using ajax
        $.ajax({
            method: "get",url:url,data: "page",
            beforeSend: function()
            {
                showSpinner(div_car_more_info_id);
            }, 
            complete: function(){}, 
            success: function(html)
            {
            $("#"+div_car_more_info_id).html(html);
           }
         }); //close $.ajax()
}//view_selectedCar()

 
     function view_car_listCars()
     {
          //url
           var action_file_path = "view_car/index.php";
           var actioncmd = "?view_car_list_request=1";
           var url = action_file_path+actioncmd;
           url=url+"&sid="+Math.random();

            $.ajax({
                method: "get",url:url,data: "page",
                beforeSend: function()
                {
                   showSpinner('div_main_content_area');
                },
                complete: function()
                {},
                success: function(html)
                {
                    updateWindowTitle("Cars All models and types");
                    $("#div_main_content_area").html(html);
                }
     }); //close $.ajax()

 }//view_car_listCars()


//this function helps to show the form for editing customer reviews
function view_carShowCar(car_id,div_show_car_id)
{
       var action_file_path = "view_car/index.php";
       var actioncmd = "?show_car_request=1&&"+
        "&&show_car_photos_request"+
        "car_id="+car_id;

       var url = action_file_path+actioncmd;
       url=url+"&sid="+Math.random();

      //get the content to display using ajax
        $.ajax({
            method: "get",url:url,data: "page",
            beforeSend: function()
            {
                showSpinner(div_show_car_id);
            },
            complete: function(){},
            success: function(html)
            {
            $("#"+div_show_car_id).html(html); //show the html inside .content div
           }
         }); //close $.ajax()
         
}//view_selectedCar()


