

/* Copyright © Website Engineers Limited */

// Page Load
$(document).ready(
    function () {
        // Feature
        var featureImgs = 0;
        $(".Feature img").each(
            function () {
                featureImgs += 1;
            }
        );
        if (featureImgs == 1) {
            $(".Feature img").show();
        }
        else {
            $(".Feature").cycle(
                {
                    fx: "scrollLeft",
                    timeout: 8000,
                    speed: 1000,
                    pause: 1,
                    pager: "#FeatureNav"
                }
            );
        }
        $(".Feature img").click(
            function () {
                switch (this.id) {
                    case "FeatureKR":
                        document.location = "/long_term_rental/cars/";
                        break;
                    case "FeatureFR":
                        document.location = "/long_term_rental/cars/";
                        break;
                    case "FeatureMR":
                        document.location = "/long_term_rental/cars/";
                        break;
                    case "FeatureND":
                        document.location = "/national-coverage.aspx";
                        break;
                    case "FeatureLTCR":
                        document.location = "/long_term_rental/cars/";
                        break;
                    case "FeatureTSR":
                        document.location = "/long_term_rental/vans/";
                        break;
                    case "FeatureTLR":
                        document.location = "/long_term_rental/vans/";
                        break;
                    case "FeatureTTR":
                        document.location = "/long_term_rental/vans/";
                        break;
                    case "FeatureTJR":
                        document.location = "/long_term_rental/vans/";
                        break;
                    case "FeatureLTVR":
                        document.location = "/long_term_rental/vans/";
                        break;
                    case "FeatureDCR":
                        document.location = "https://www.apexrental.co.uk/daily_rental/daily_car_rental.aspx";
                        break;
                    case "FeatureDVR":
                        document.location = "https://www.apexrental.co.uk/daily_rental/daily_van_rental.aspx";
                        break;
                }
            }
        );
        // Closed
        $(".CallClosed").click(
            function () {
                document.location = '/contact_enquiry.aspx';
            }
        );
        // Open URL
        $("span.OpenURL").click(
            function () {
                var openUrl = $(this).html();
                window.open(openUrl);
            }
        );
        // Form
        $("form.NoDisplay").show();
        // Social
        $("div.Facebook").click(
            function () {
                window.open("http://www.facebook.com/apexrental");
            }
        );
        $("div.Facebook").html("<b>Join us on Facebook</b><br />For discount codes, special offers & competitions.<br />facebook.com/apexrental");
        //$("div.Facebook").html('<iframe src="http://www.facebook.com/plugins/like.php?href=' + document.URL + '&amp;layout=button_count&amp;show_faces=true&amp;width=300&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:175px; height:21px;" allowTransparency="true"></iframe>');
        $("div.Twitter").click(
            function () {
                window.open("http://twitter.com/#!/apexrental");
            }
        );
        $("div.Twitter").html("<b>Follow us on Twitter</b><br />For discount codes, special offers & competitions.<br />twitter.com/apexrental");
        //$("div.Twitter").html('<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>');
    }
);

/* End */

