﻿$("document").ready(function() {
    InfoCar();
    
});


var sTitulo, sTexto, sDetalhe,sImagem, sPreco = "";
this.nValorCarroModelo = new Number();
this.nValorCarro = new Number();
this.nIdCarro = new Number();



/************
Step Carro
************/
//Pega informacao do carro selecionado. Exibe e esconde informacoes
this.InfoCar = function() {

    try {
        $(".rent-form-content-step-1 dl dd img").mouseover(function() {
            $(".product-overview-call").hide();
            $(".no-current-product").hide();
            $(".current-product-car").show();
            sTitulo = $(this).attr("title");
            sTexto = $(this).attr("alt");
            sImagem = $(this).attr("src");
            sPreco = $(this).attr("name");
            sDetalhe = $(this).attr("detalhe");
            SetInfoCar();
        }).click(function() {
            $(".fldCarroId").val($(this).attr("Id"));
            $(".fldTitulo").val($(this).attr("title"));
            $(".fldTexto").val($(this).attr("alt"));
            $(".fldImagem").val($(this).attr("src"));
            $(".fldPreco").val($(this).attr("name"));
            $(".fldDetalhe").val($(this).attr("detalhe"));
        }).mouseout(function() {
            nIdCarro = $(".fldCarroId").val();
            sTitulo = $(".fldTitulo").val();
            sTexto = $(".fldTexto").val();
            sImagem = $(".fldImagem").val();
            sPreco = $(".fldPreco").val();
            sDetalhe = $(".fldDetalhe").val();

            if (sTitulo != "")
                SetInfoCar();
            else {
                $(".current-product-car").hide();
                $(".product-overview-call").show();
                $(".no-current-product").show();
            }
        });
    }
    catch (e) {
        //alert(e);
    }
}



//Seta informacao do carro no box de reserva
this.SetInfoCar = function() {
    $(".current-product-id").text(nIdCarro);
    $(".current-product-name").text(sTitulo);
    $(".current-product-default-items").text(sTexto);
    $(".current-product-image").attr("src", sImagem);
    $(".current-product-price-car").text(sPreco);
    $(".current-product-price").text(sPreco);
    $(".current-product-detail").text(sDetalhe);
}



