﻿

var numofclicks = 0;
function changeMarginLeft(changeToMargin) {
    var Mvalue = document.getElementById('lightboxitemholder').offsetLeft;
    //alert(Mvalue);
    numofclicks = changeToMargin;
 
    var IndexTimes601 = changeToMargin * 603;
    document.getElementById('lightboxitemholder').style.marginLeft = -IndexTimes601 + "px";
}

jQuery(document).ready(function () {
    $(".openRoomExplorer").colorbox({ width: "676px", height: "470px", inline: true, href: "#roomExplorer" });
    $(".example8").click(function () {

        //$("#lightboxitemholder").animate({ marginLeft: changeTo + "px" }, 500);
        //var preLeft = $(".lightboxitemholder").offset().left;
       // var StartMarginWith = preLeft - 601;
        //$("#lightboxitemholder").animate({ marginLeft: StartMarginWith + "px" }, 500);
        $.fn.colorbox({ width: "639px", inline: true, href: "#inline_example1" });
       // alert(preLeft);
    });
    $("#firstProductInList").click(function () {
        $(".productsContainer").animate({ marginLeft: "-600px" }, 500);
    });


    //work out which product it is decide what margin it should have. The minus this from highest margin-left
    $("#movePanelforward").click(function () {
        var oldLeft = parseInt($(".productsContainer").css('margin-left'));
        $(".productsContainer").animate({ marginLeft: "-575px" }, 500);


    });
    $("#movePanelback").click(function () {
        $(".productsContainer").animate({ marginLeft: "575px" }, 500);
    });
});
