var leftPos = '.5em';
var midPos = '30.5em';
var rightPos = '60.5em';
var browserName=navigator.appName;

if(browserName=="Microsoft Internet Explorer"){
    leftPos = '20px';
    midPos = '320px';
    rightPos = '620px';
}

var rndPic = Math.floor(Math.random()*3)

$(document).ready(function() {

    $('#img1').attr({ src: 'img/bastienne-' + rndPic + '.jpg' });
    $('#img2').attr({ src: 'img/bastien-' + rndPic + '.jpg' });

    $('#nav1').click(function() {
        $('#img1').animate({ left: midPos });
        $('#img2').animate({ left: rightPos });
    });

    $('#nav2').click(function() {
        $('#img1').animate({ left: leftPos });
        $('#img2').animate({ left: rightPos });
    });

    $('#nav3').click(function() {
        $('#img1').animate({ left: leftPos });
        $('#img2').animate({ left: midPos });
    });

});
