
function Trundle(plist, leftArrow, rightArrow, isGo, accNum) {
    var asInterval, acc, fetrue;
    acc = accNum * -1;
    fetrue = false;
    var plist = document.getElementById(plist);
    function goScroll() {
        if (!fetrue) {
            if (plist.scrollLeft == 0) {
                acc = acc * -1;
            }
            if (plist.scrollLeft == plist.scrollWidth - plist.offsetWidth) {
                acc = acc * -1;
            }
        }
        plist.scrollLeft += acc;
    }
    function autoScroll() {
        asInterval = setInterval(function() { goScroll() }, 50);
    }
    function stopScroll(obj) {
        clearInterval(asInterval);
        obj.onmouseout = function() {
            autoScroll();
        }
    }
    function manualScroll(obj, nacc) {
        //        acc = nacc;
        //        fetrue = true;
        obj.onmousedown = function() {
            acc = nacc * 4;
            fetrue = true;
        }
        obj.onmouseup = function() {
            acc = nacc;
        }
        obj.onmouseout = function() {
            fetrue = false;
        }
    }
    if (leftArrow.length > 0) {
        var leftSide = document.getElementById(leftArrow);
        leftSide.onmouseover = function() { manualScroll(leftSide, accNum) }
    }
    if (leftArrow.length > 0) {
        var rightSide = document.getElementById(rightArrow);
        rightSide.onmouseover = function() { manualScroll(rightSide, accNum * -1) }
    }

    plist.onmouseover = function() { stopScroll(plist); }

    if (isGo) autoScroll();

}







function activeVerifyCode(vcPath) {
    $(".verifyCode").focus(function() {
        var pos = $(this).position();
        $("<img />")
			.addClass("verifyCodeImage")
			.attr("src", vcPath + "?t=" + Math.round(Math.random() * 1000))
			.css({
			    "position": "absolute",
			    "left": pos.left + $(this).outerWidth() + 5 + "px",
			    "top": pos.top + "px"
			})
			.insertAfter(this);
    }).blur(function() {
        $(".verifyCodeImage").remove();
    })
}

