var isiPad = navigator.userAgent.match(/iPad/i) != null;

function OrientationTest(){
    var background = null;
    var nivoSlice = $('.nivo-slice');
    if (nivoSlice.length > 0)
    {
        nivoSlice = $('.nivo-slice')[0];
        background = nivoSlice.style.backgroundImage;        
    }
    if(window.orientation == 0 || window.orientation == 180){
        $("#home1").hide(); $("#home2").hide(); $("#home3").hide();
        $("#home1").attr("src",'../img/ilu-home-001-small.jpg');
        $("#home2").attr("src",'../img/ilu-home-002-small.jpg');
        $("#home3").attr("src",'../img/ilu-home-003-small.jpg');
        $(nivoSlice).css('backgroundImage', background.replace(".jpg","-small.jpg"));
        $("#home1").show(); $("#home2").show(); $("#home3").show();
    } else {
        $("#home1").hide(); $("#home2").hide(); $("#home3").hide();
        $("#home1").attr("src",'../img/ilu-home-001.jpg');
        $("#home2").attr("src",'../img/ilu-home-002.jpg');
        $("#home3").attr("src",'../img/ilu-home-003.jpg');
        $("#home1").show(); $("#home2").show(); $("#home3").show();
        $(nivoSlice).css('backgroundImage', background.replace("-small.jpg",".jpg"));
    }
}

$(document).ready(function() {
    window.onorientationchange = function() {
        OrientationTest();
    };
});



