﻿function resizeScrollbar(pageName) {

    var screenHeight = null;
    screenHeight = window.screen.height;

    var newScrollerHeight = null;
    var newWhiteBottomHeight = null;
    var newScrollerContainerHeight = null;

    if ((navigator.platform == 'MacIntel') || (navigator.platform == 'MacPPC')) {
        // Set for mac

        // Adjust for 1024 x 768
        if (screenHeight < 800) {
            1024
            newScrollerHeight = 88;
            newWhiteBottomHeight = 400;
            newScrollerContainerHeight = 260;
        }

        //Adjust for 1280 x 800
        if ((screenHeight > 768) && (screenHeight < 900)) {
            newScrollerHeight = 120;
            newWhiteBottomHeight = 680;
            newScrollerContainerHeight = 550;
        }

        //Adjust for 1440 x 900
        if ((screenHeight > 800) && (screenHeight < 1024)) {
            newScrollerHeight = 320;
            newWhiteBottomHeight = 680;
            newScrollerContainerHeight = 540;
        }

        //Adjust for 1280 x 1024
        if ((screenHeight > 900) && (screenHeight < 1050)) {
            newScrollerHeight = 344;
            newWhiteBottomHeight = 680;
            newScrollerContainerHeight = 550;
        }

        //Adjust for 1680 x 1050
        if ((screenHeight > 1024) && (screenHeight < 1080)) {
            newScrollerHeight = 370;
            newWhiteBottomHeight = 680;
            newScrollerContainerHeight = 550;
        }

        //Adjust for 1920 x 1080
        if (screenHeight > 1050) {
            newScrollerHeight = 400;
            newWhiteBottomHeight = 700;
            newScrollerContainerHeight = 560;
        }
    }
    else {

        // Set for PCs

        // Adjust for 1024 x 768
        if (screenHeight < 800) {
            newScrollerHeight = 88;
            newWhiteBottomHeight = 400;
            newScrollerContainerHeight = 260;
        }

        //Adjust for 1280 x 800
        if ((screenHeight > 768) && (screenHeight < 900)) {
            newScrollerHeight = 120;
            newWhiteBottomHeight = 680;
            newScrollerContainerHeight = 550;
        }

        //Adjust for 1440 x 900
        if ((screenHeight > 800) && (screenHeight < 1024)) {
            newScrollerHeight = 320;
            newWhiteBottomHeight = 680;
            newScrollerContainerHeight = 540;
        }

        //Adjust for 1280 x 1024
        if ((screenHeight > 900) && (screenHeight < 1050)) {
            newScrollerHeight = 344;
            newWhiteBottomHeight = 680;
            newScrollerContainerHeight = 550;
        }

        //Adjust for 1680 x 1050
        if ((screenHeight > 1024) && (screenHeight < 1080)) {
            newScrollerHeight = 370;
            newWhiteBottomHeight = 680;
            newScrollerContainerHeight = 550;
        }

        //Adjust for 1920 x 1080
        if (screenHeight > 1050) {
            newScrollerHeight = 400;
            newWhiteBottomHeight = 700;
            newScrollerContainerHeight = 560;
        }
    }

    switch (pageName) {
        case 'Temp_ImagePage':
            {
                document.getElementById("ScrollbarTrack").style.height = newScrollerHeight + "px";
                //document.getElementById("whiteBottom").style.top = newWhiteBottomHeight + "px";
                document.getElementById("Scroller-1").style.height = newScrollerContainerHeight + "px";
                break
            }

        case 'Temp_Press':
            {
                document.getElementById("ScrollbarTrack").style.height = newScrollerHeight + "px";
                //document.getElementById("whiteBottom").style.top = newWhiteBottomHeight + "px";
                document.getElementById("ScrollerPress1").style.height = newScrollerContainerHeight + "px";
                document.getElementById("ScrollerPress2").style.height = newScrollerContainerHeight + "px";
                document.getElementById("ScrollerPress3").style.height = newScrollerContainerHeight + "px";
                document.getElementById("ScrollerPress4").style.height = newScrollerContainerHeight + "px";
                document.getElementById("ScrollerPress5").style.height = newScrollerContainerHeight + "px";
                break
            }

        case 'Temp_AboutUs':
            {
                document.getElementById("ScrollbarTrack").style.height = newScrollerHeight + "px";
                //document.getElementById("whiteBottom").style.top = newWhiteBottomHeight + "px";
                document.getElementById("ScrollerAboutUs1").style.height = newScrollerContainerHeight + "px";
                document.getElementById("ScrollerAboutUs2").style.height = newScrollerContainerHeight + "px";
                document.getElementById("ScrollerAboutUs3").style.height = newScrollerContainerHeight + "px";
                document.getElementById("ScrollerAboutUs4").style.height = newScrollerContainerHeight + "px";
                document.getElementById("ScrollerAboutUs5").style.height = newScrollerContainerHeight + "px";
                break
            }

        case 'Dealers':
            {
                document.getElementById("ScrollbarTrack").style.height = newScrollerHeight + "px";
                //document.getElementById("whiteBottom").style.top = newWhiteBottomHeight + "px";
                document.getElementById("ScrollerDealers").style.height = newScrollerContainerHeight + "px";
                break
            }

        case 'ProductDetails':
            {
                document.getElementById("ScrollbarTrack").style.height = newScrollerHeight + "px";
                //document.getElementById("whiteBottom").style.top = newWhiteBottomHeight + "px";
                document.getElementById("ScrollerTab1").style.height = newScrollerContainerHeight + "px";
                document.getElementById("ScrollerTab2").style.height = newScrollerContainerHeight + "px";
                document.getElementById("ScrollerTab3").style.height = newScrollerContainerHeight + "px";
                document.getElementById("ScrollerTab4").style.height = newScrollerContainerHeight + "px";
                break
            }

    }




}