
////site-uploads/1001328/scribt/Search_script4.js
setTimeout(function() {
    document.getElementById("searchbox2")?.addEventListener("keyup", function(event) {
        event.preventDefault();
        if (event.key === "Enter") {
            document.getElementById("searchbtn2")?.click();
        }
    });
}, 2000);


function srch() {
    //var e = document.getElementById("pagedd");
    //var dest= e.options[e.selectedIndex].value;
    var valuee = document.getElementById('searchbox2')?.value;
    if (valuee != "") {
        window.location = "/Search-Inventory/search/".concat(valuee);
    } else {
        document.getElementById('searchbox2').placeholder = "This field is required";
        var sheet = window.document.styleSheets[0];
        sheet.insertRule('input#searchbox2::-webkit-input-placeholder {color: red !important}', sheet.cssRules.length);
        sheet.insertRule('input#searchbox2::-moz-placeholder {color:#909; opacity:1;}', sheet.cssRules.length);
        sheet.insertRule('input#searchbox2:-moz-placeholder {color:#909; opacity:1;}', sheet.cssRules.length);
    }
	 
}

$(function(){
	
	/* Focus on input afrer modal open */
	$('#searchModal').on('shown.bs.modal', function () {
		$('#searchbox2').focus();
	}); 
});
////site-uploads/1001328/scribt/Search_script11.js
setTimeout(function() {
    document.getElementById("searchbox_mob")?.addEventListener("keyup", function(event) {
        event.preventDefault();
        if (event.key === "13") {
			srch_mob();
            //document.getElementById("searchbtn3")?.click();
        }
    });
}, 2000);


function srch_mob() {
    //var e = document.getElementById("pagedd");
    //var dest= e.options[e.selectedIndex].value;
    var valuee = document.getElementById('searchbox_mob')?.value;
    if (valuee != "") {
        window.location = "/Search-Inventory/search/".concat(valuee);
    } else {
        document.getElementById('searchbox_mob').placeholder = "This field is required";
        var sheet = window.document.styleSheets[0];
        sheet.insertRule('input#searchbox_mob::-webkit-input-placeholder {color: red !important}', sheet.cssRules.length);
        sheet.insertRule('input#searchbox_mob::-moz-placeholder {color:#909; opacity:1;}', sheet.cssRules.length);
        sheet.insertRule('input#searchbox_mob:-moz-placeholder {color:#909; opacity:1;}', sheet.cssRules.length);
    }
	 
}

$(function(){
	
	/* Focus on input afrer modal open */
	$('#searchModal').on('shown.bs.modal', function () {
		$('#searchbox_mob').focus();
	}); 
});
////site-uploads/1001328/scribt/front4.js
$(function(){
	//REmove CenterDic content when in Details page
	if($('#detailsParentDiv').size()){
        var  x=document.getElementsByClassName("request-quote-btn")
        for (let index = 0; index < document.getElementsByClassName("request-quote-btn").length
        ; index++) {
            
            
      
       var  x = document.getElementsByClassName("request-quote-btn")[index];
         x.id=`id${index}`
		document.getElementById(`id${index}`).innerHTML = 	document.getElementById(`id${index}`)?.innerHTML.replace("Quote","Get Out the Door Price")
        
	}



}
});

$(function(){

    $(".share-this").html(`<span class="glyphicon glyphicon-share">&nbsp;</span> Show a Friend`)

    $(".get-financed").html(`<span class="glyphicon glyphicon-share">&nbsp;</span>  Get Approved`)
});


$(function() {
    $(window).on("scroll", function() {
        if ($(window).scrollTop() > 100) {
            $("#comp_1622104809019").addClass("sticky-header");
            var centerDivMargin = $('#comp_1622104809019').height();
            $('#CenterDiv').css({ "margin-top": centerDivMargin });
        } else {
            $("#comp_1622104809019").removeClass("sticky-header");
            $('#CenterDiv').css({ "margin-top": 0 });
        }
    });
	
	if ($(window).width() <= 768 && $("#normal_vdp").size() > 0) {
		$(".price-box").after($(".option-label"),$(".main-option"));
	}
	
	
});
