﻿function MoveFrames(NewPos) {
    var CurrentPos = parseInt(document.getElementById('Container').style.marginLeft);
    var oInterval;
    if (CurrentPos > NewPos) {
        oInterval = setInterval(
            function () {
                if (CurrentPos > NewPos) {
                    //Adjust the following line if you want.
                    //Make sure it's evenly divisible into the width of your panels.
                    CurrentPos -= 55;  
                    document.getElementById('Container').style.marginLeft = CurrentPos + 'px';
                } else {
                    clearInterval(oInterval);
                }
            }, 1);
    } else {
        oInterval = setInterval(
            function () {
                if (CurrentPos < NewPos) {
                    //Adjust the following line if you want.
                    //Make sure it's evenly divisible into the width of your panels.
                    CurrentPos += 55;  
                    document.getElementById('Container').style.marginLeft = CurrentPos + 'px';
                } else {
                    clearInterval(oInterval);
                }
            }, 1);
    }
}
function doSomething() {
    alert('bob');
}

