﻿function CheckForDivOverflow() {

    // if the user platform is iOS, check if there is a div overflow
    if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
        

	var contentmain = document.getElementById("contentmain");
        var scroller = document.getElementById("scroller");

        if ((scroller != null) && (contentmain != null)) {
            if (scroller.clientHeight < scroller.scrollHeight) {

                // Display scroll indicator for iOS

                var newdiv1 = document.createElement("scrollup");
                newdiv1.setAttribute('id', 'scrollindicatorup');
                contentmain.appendChild(newdiv1);

                var newdiv2 = document.createElement("scrolldown");
                newdiv2.setAttribute('id', 'scrollindicatordown');
                contentmain.appendChild(newdiv2);
            }
        }
    }
}
 

