/* Minification failed. Returning unminified contents.
(2,20): run-time error CSS1031: Expected selector, found '='
(2,20): run-time error CSS1025: Expected comma or open brace, found '='
(4,10): run-time error CSS1031: Expected selector, found 'GetProductDetails('
(4,10): run-time error CSS1025: Expected comma or open brace, found 'GetProductDetails('
(63,10): run-time error CSS1031: Expected selector, found 'goto_context('
(63,10): run-time error CSS1025: Expected comma or open brace, found 'goto_context('
(68,10): run-time error CSS1031: Expected selector, found 'Get3DPhotoByProductAndColorCode('
(68,10): run-time error CSS1025: Expected comma or open brace, found 'Get3DPhotoByProductAndColorCode('
(100,10): run-time error CSS1031: Expected selector, found 'Set_3D_Photo_From_Load('
(100,10): run-time error CSS1025: Expected comma or open brace, found 'Set_3D_Photo_From_Load('
(109,8): run-time error CSS1030: Expected identifier, found 'addEventListener('
(109,8): run-time error CSS1031: Expected selector, found 'addEventListener('
(109,8): run-time error CSS1025: Expected comma or open brace, found 'addEventListener('
(121,2): run-time error CSS1019: Unexpected token, found ')'
(122,10): run-time error CSS1031: Expected selector, found 'show_hide_small_bar_product('
(122,10): run-time error CSS1025: Expected comma or open brace, found 'show_hide_small_bar_product('
(128,10): run-time error CSS1031: Expected selector, found '='
(128,10): run-time error CSS1025: Expected comma or open brace, found '='
(129,15): run-time error CSS1031: Expected selector, found '='
(129,15): run-time error CSS1025: Expected comma or open brace, found '='
(130,16): run-time error CSS1031: Expected selector, found '='
(130,16): run-time error CSS1025: Expected comma or open brace, found '='
(132,10): run-time error CSS1031: Expected selector, found 'top_banner_move('
(132,10): run-time error CSS1025: Expected comma or open brace, found 'top_banner_move('
(169,10): run-time error CSS1031: Expected selector, found 'top_banner_previus('
(169,10): run-time error CSS1025: Expected comma or open brace, found 'top_banner_previus('
(209,10): run-time error CSS1031: Expected selector, found '='
(209,10): run-time error CSS1025: Expected comma or open brace, found '='
(210,15): run-time error CSS1031: Expected selector, found '='
(210,15): run-time error CSS1025: Expected comma or open brace, found '='
(211,16): run-time error CSS1031: Expected selector, found '='
(211,16): run-time error CSS1025: Expected comma or open brace, found '='
(213,10): run-time error CSS1031: Expected selector, found 'mid_banner_move('
(213,10): run-time error CSS1025: Expected comma or open brace, found 'mid_banner_move('
(246,10): run-time error CSS1031: Expected selector, found 'mid_banner_previus('
(246,10): run-time error CSS1025: Expected comma or open brace, found 'mid_banner_previus('
(285,22): run-time error CSS1031: Expected selector, found '='
(285,22): run-time error CSS1025: Expected comma or open brace, found '='
(287,2): run-time error CSS1019: Unexpected token, found ','
(287,4): run-time error CSS1019: Unexpected token, found '7000'
(287,8): run-time error CSS1019: Unexpected token, found ')'
(289,22): run-time error CSS1031: Expected selector, found '='
(289,22): run-time error CSS1025: Expected comma or open brace, found '='
(291,2): run-time error CSS1019: Unexpected token, found ','
(291,4): run-time error CSS1019: Unexpected token, found '7000'
(291,8): run-time error CSS1019: Unexpected token, found ')'
(293,10): run-time error CSS1031: Expected selector, found 'previus_top_button('
(293,10): run-time error CSS1025: Expected comma or open brace, found 'previus_top_button('
(298,10): run-time error CSS1031: Expected selector, found 'next_top_button('
(298,10): run-time error CSS1025: Expected comma or open brace, found 'next_top_button('
(305,10): run-time error CSS1031: Expected selector, found 'previus_mid_button('
(305,10): run-time error CSS1025: Expected comma or open brace, found 'previus_mid_button('
(310,10): run-time error CSS1031: Expected selector, found 'next_mid_button('
(310,10): run-time error CSS1025: Expected comma or open brace, found 'next_mid_button('
(316,1): run-time error CSS1019: Unexpected token, found '$'
(316,2): run-time error CSS1019: Unexpected token, found '('
(316,9): run-time error CSS1031: Expected selector, found ')'
(316,9): run-time error CSS1025: Expected comma or open brace, found ')'
(329,2): run-time error CSS1019: Unexpected token, found ')'
(332,15): run-time error CSS1031: Expected selector, found '='
(332,15): run-time error CSS1025: Expected comma or open brace, found '='
(333,10): run-time error CSS1031: Expected selector, found '='
(333,10): run-time error CSS1025: Expected comma or open brace, found '='
(334,15): run-time error CSS1031: Expected selector, found '='
(334,15): run-time error CSS1025: Expected comma or open brace, found '='
(335,9): run-time error CSS1031: Expected selector, found '='
(335,9): run-time error CSS1025: Expected comma or open brace, found '='
(337,21): run-time error CSS1031: Expected selector, found '='
(337,21): run-time error CSS1025: Expected comma or open brace, found '='
(404,10): run-time error CSS1030: Expected identifier, found 'getElementById('
(404,10): run-time error CSS1031: Expected selector, found 'getElementById('
(404,10): run-time error CSS1025: Expected comma or open brace, found 'getElementById('
(406,2): run-time error CSS1019: Unexpected token, found ')'
(408,10): run-time error CSS1030: Expected identifier, found 'getElementById('
(408,10): run-time error CSS1031: Expected selector, found 'getElementById('
(408,10): run-time error CSS1025: Expected comma or open brace, found 'getElementById('
(410,2): run-time error CSS1019: Unexpected token, found ')'
(413,10): run-time error CSS1031: Expected selector, found 'autoloop('
(413,10): run-time error CSS1025: Expected comma or open brace, found 'autoloop('
(460,12): run-time error CSS1031: Expected selector, found ';'
(460,12): run-time error CSS1025: Expected comma or open brace, found ';'
(462,1): run-time error CSS1019: Unexpected token, found '$'
(462,2): run-time error CSS1019: Unexpected token, found '('
(462,3): run-time error CSS1019: Unexpected token, found '"#imgmain_3d"'
(462,16): run-time error CSS1019: Unexpected token, found ')'
(462,18): run-time error CSS1030: Expected identifier, found 'mouseover('
(462,18): run-time error CSS1019: Unexpected token, found 'mouseover('
(462,37): run-time error CSS1031: Expected selector, found '('
(462,37): run-time error CSS1025: Expected comma or open brace, found '('
(464,2): run-time error CSS1019: Unexpected token, found ')'
(465,1): run-time error CSS1019: Unexpected token, found '$'
(465,2): run-time error CSS1019: Unexpected token, found '('
(465,3): run-time error CSS1019: Unexpected token, found '"#imgmain_3d"'
(465,16): run-time error CSS1019: Unexpected token, found ')'
(465,18): run-time error CSS1030: Expected identifier, found 'mouseout('
(465,18): run-time error CSS1019: Unexpected token, found 'mouseout('
(465,36): run-time error CSS1031: Expected selector, found '('
(465,36): run-time error CSS1025: Expected comma or open brace, found '('
(467,2): run-time error CSS1019: Unexpected token, found ')'
(469,13): run-time error CSS1031: Expected selector, found '='
(469,13): run-time error CSS1025: Expected comma or open brace, found '='
(470,18): run-time error CSS1031: Expected selector, found ';'
(470,18): run-time error CSS1025: Expected comma or open brace, found ';'
(471,12): run-time error CSS1031: Expected selector, found '='
(471,12): run-time error CSS1025: Expected comma or open brace, found '='
(472,12): run-time error CSS1031: Expected selector, found '='
(472,12): run-time error CSS1025: Expected comma or open brace, found '='
(474,10): run-time error CSS1031: Expected selector, found 'set_move_id('
(474,10): run-time error CSS1025: Expected comma or open brace, found 'set_move_id('
(487,10): run-time error CSS1030: Expected identifier, found 'addEventListener('
(487,10): run-time error CSS1031: Expected selector, found 'addEventListener('
(487,10): run-time error CSS1025: Expected comma or open brace, found 'addEventListener('
(489,2): run-time error CSS1019: Unexpected token, found ','
(489,8): run-time error CSS1031: Expected selector, found ')'
(489,8): run-time error CSS1025: Expected comma or open brace, found ')'
(491,10): run-time error CSS1030: Expected identifier, found 'addEventListener('
(491,10): run-time error CSS1031: Expected selector, found 'addEventListener('
(491,10): run-time error CSS1025: Expected comma or open brace, found 'addEventListener('
(503,2): run-time error CSS1019: Unexpected token, found ','
(503,8): run-time error CSS1031: Expected selector, found ')'
(503,8): run-time error CSS1025: Expected comma or open brace, found ')'
 */

var previus_feature="";

function GetProductDetails(carFeatureCode, CarPackage) {
    document.getElementById("left_context").innerHTML = document.getElementById("left_context").innerHTML.replace("active", "");
    $("#btn_" + carFeatureCode).addClass("active");
    document.getElementById("CarFeatureCode").value = carFeatureCode;
    var productCode = document.getElementById("Code").value;

    var innerwidth = window.innerWidth;

    $.ajax({
        type: "POST",
        url: "/CarProduct/GetProductDetails",
        data: JSON.stringify({ productCode: productCode, carFeatureCode: carFeatureCode }),
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            var CarSpecifications = data.CarSpecifications;
            var CarProductDetails = data.CarProductDetails;

            if (innerwidth <= 767) {
                if (previus_feature != "") {
                    document.getElementById("details_" + previus_feature).innerHTML = "";
                    document.getElementById("btn_" + previus_feature).innerHTML = document.getElementById("btn_" + previus_feature).innerHTML.replace("fa-minus", "fa-plus");
                }
            }

            $("#trProductDetailsBody").empty();
            $.each(CarSpecifications, function (key, value) {
                var SpecificationName = "<td><div class='title'>" + value.Name + "</div></td>";
                var textContext = "";
                for (var i = 0; i < CarPackage.length; i++) {
                    $.each(CarProductDetails, function (key, valued) {
                        if (value.Code == valued.CarSpecificationCode && CarPackage[i].Code == valued.PackageCode) {
                            textContext += "<td>" + valued.Details + "</td>";
                        }
                    });
                }
                var trData = "<tr>" + SpecificationName + textContext + "</tr>";
                $("#trProductDetailsBody").append(trData);
            });

            if (innerwidth <= 767) {
                if (carFeatureCode == previus_feature) {
                    document.getElementById("details_" + previus_feature).innerHTML = "";
                    document.getElementById("btn_" + carFeatureCode).innerHTML = document.getElementById("btn_" + carFeatureCode).innerHTML.replace("fa-minus", "fa-plus");
                    previus_feature = "";
                }
                else {
                    document.getElementById("details_" + carFeatureCode).innerHTML = document.getElementById("feature_right").outerHTML;
                    document.getElementById("btn_" + carFeatureCode).innerHTML = document.getElementById("btn_" + carFeatureCode).innerHTML.replace("fa-plus", "fa-minus");
                    previus_feature = carFeatureCode;
                }
            }
        },
        error: function (response) {
            alert_error("Failed !");
        }
    });
}

function goto_context(id) {
    $('html,body').animate({ scrollTop: $("#"+id).offset().top - 100 }, 'slow');
    $("#small_top_bar_product").hide(300);
}

function Get3DPhotoByProductAndColorCode(ColorCode, ProductCode) {
    document.getElementById("3d_layer").style.visibility = "visible";
    document.getElementById("imgmain_3d").style.pointerEvents = "none";
    clearInterval(_timer);
    $.ajax({
        type: "POST",
        url: "/CarProduct/Get3DPhotoByProductAndColorCode",
        data: JSON.stringify({ ProductCode: ProductCode, ColorCode: ColorCode }),
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (data) {
            $("#3d_image_context").empty();
            var p3dc = 1;
            var innerHtml="";
            $.each(data, function (key, value) {
                if (p3dc == 1)
                {
                    document.getElementById("imgmain_3d").src=value.PhotoPath;
                    document.getElementById("color_name").innerText=value.Color.Name;
                }
                innerHtml+="<img src='"+value.PhotoPath+"' class='img-3d hidden' id='img_3d_"+p3dc+"' />";
                p3dc++;
            });
            $("#3d_image_context").append(innerHtml);
        }
    }).done(function () {
        _timer = setInterval(function () { autoloop(); }, 300);
        document.getElementById("3d_layer").style.visibility = "hidden";
        document.getElementById("imgmain_3d").style.pointerEvents = "unset";
    });
}

function Set_3D_Photo_From_Load(ColorCode, CarProductPhoto3D) {
    $.each(CarProductPhoto3D, function (key, value) {
        if (ColorCode != value.ColorCode && value.Color.Status == "Active") {
            var img_3D = "<img src='" + value.PhotoPath + "' class='hidden' />";
            $("#3d_image_context").append(img_3D);
        }
    });
}

window.addEventListener('scroll', function() {
    var doc = document.documentElement;
    var top = (window.pageYOffset || doc.scrollTop)  - (doc.clientTop || 0);
    if(top>100){
        document.getElementById("product_top_bar").style.display="inherit";
        document.getElementById("menu_top_bar").style.display="none";
    }
    else {
        document.getElementById("product_top_bar").style.display="none";
        document.getElementById("small_top_bar_product").style.display="none";
        document.getElementById("menu_top_bar").style.display="inherit";
    }
});
function show_hide_small_bar_product(){
    $("#small_top_bar_product").toggle(300);
}



var phsc = 0;
var prehphoto = 0;
var totalhslid = document.getElementsByClassName("top-banner").length;

function top_banner_move() {
    if (totalhslid > 1) {
        prehphoto = phsc;
        phsc++;

        if (phsc >= totalhslid) {
            phsc = 0;
            document.getElementById("hpc_" + prehphoto).classList.remove("active2");
            document.getElementById("hpc_" + phsc).classList.remove("inactive2");
            document.getElementById("hpc_" + prehphoto).classList.remove("active");
            document.getElementById("hpc_" + prehphoto).classList.add("inactive");
            document.getElementById("hpc_" + phsc).classList.remove("inactive");
            document.getElementById("hpc_" + phsc).classList.add("active");

            document.getElementById("hpd_" + phsc).classList.remove("text-inactive");
            document.getElementById("hpd_" + phsc).classList.add("text-active");
            document.getElementById("hpd_" + prehphoto).classList.remove("text-active");
            document.getElementById("hpd_" + prehphoto).classList.add("text-inactive");
        }
        else {
            document.getElementById("hpc_" + prehphoto).classList.remove("hidden");
            document.getElementById("hpc_" + phsc).classList.remove("hidden");
            document.getElementById("hpc_" + prehphoto).classList.remove("active2");
            document.getElementById("hpc_" + phsc).classList.remove("inactive2");
            document.getElementById("hpc_" + prehphoto).classList.remove("active");
            document.getElementById("hpc_" + prehphoto).classList.add("inactive");
            document.getElementById("hpc_" + phsc).classList.remove("inactive");
            document.getElementById("hpc_" + phsc).classList.add("active");

            document.getElementById("hpd_" + phsc).classList.remove("text-inactive");
            document.getElementById("hpd_" + phsc).classList.add("text-active");
            document.getElementById("hpd_" + prehphoto).classList.remove("text-active");
            document.getElementById("hpd_" + prehphoto).classList.add("text-inactive");
        }
    }
}

function top_banner_previus() {
    if (totalhslid > 1) {
        prehphoto = phsc;
        phsc = phsc - 1;

        if (phsc < 0) {
            phsc = totalhslid - 1;
        }
        if (phsc >= totalhslid) {
            phsc = 0;
            document.getElementById("hpc_" + prehphoto).classList.remove("active");
            document.getElementById("hpc_" + phsc).classList.remove("inactive");
            document.getElementById("hpc_" + prehphoto).classList.remove("active2");
            document.getElementById("hpc_" + prehphoto).classList.add("inactive2");
            document.getElementById("hpc_" + phsc).classList.remove("inactive2");
            document.getElementById("hpc_" + phsc).classList.add("active2");

            document.getElementById("hpd_" + phsc).classList.remove("text-inactive");
            document.getElementById("hpd_" + phsc).classList.add("text-active");
            document.getElementById("hpd_" + prehphoto).classList.remove("text-active");
            document.getElementById("hpd_" + prehphoto).classList.add("text-inactive");
        }
        else {
            document.getElementById("hpc_" + prehphoto).classList.remove("hidden");
            document.getElementById("hpc_" + phsc).classList.remove("hidden");
            document.getElementById("hpc_" + prehphoto).classList.remove("active");
            document.getElementById("hpc_" + phsc).classList.remove("inactive");
            document.getElementById("hpc_" + prehphoto).classList.remove("active2");
            document.getElementById("hpc_" + prehphoto).classList.add("inactive2");
            document.getElementById("hpc_" + phsc).classList.remove("inactive2");
            document.getElementById("hpc_" + phsc).classList.add("active2");

            document.getElementById("hpd_" + phsc).classList.remove("text-inactive");
            document.getElementById("hpd_" + phsc).classList.add("text-active");
            document.getElementById("hpd_" + prehphoto).classList.remove("text-active");
            document.getElementById("hpd_" + prehphoto).classList.add("text-inactive");
        }
    }
}

var pmsc = 0;
var premphoto = 0;
var totalmslid = document.getElementsByClassName("image").length;

function mid_banner_move() {
    if (totalmslid > 1) {
        premphoto = pmsc;
        pmsc++;

        if (pmsc >= totalmslid) {
            pmsc = 0;
            document.getElementById("mpc_" + premphoto).classList.remove("active");
            document.getElementById("mpc_" + premphoto).classList.add("inactive");
            document.getElementById("mpc_" + pmsc).classList.remove("inactive");
            document.getElementById("mpc_" + pmsc).classList.add("active");

            document.getElementById("mpd_" + pmsc).classList.remove("textinactive");
            document.getElementById("mpd_" + pmsc).classList.add("textactive");
            document.getElementById("mpd_" + premphoto).classList.remove("textactive");
            document.getElementById("mpd_" + premphoto).classList.add("textinactive");
        }
        else {
            document.getElementById("mpc_" + premphoto).classList.remove("hidden");
            document.getElementById("mpc_" + pmsc).classList.remove("hidden");
            document.getElementById("mpc_" + premphoto).classList.remove("active");
            document.getElementById("mpc_" + premphoto).classList.add("inactive");
            document.getElementById("mpc_" + pmsc).classList.remove("inactive");
            document.getElementById("mpc_" + pmsc).classList.add("active");

            document.getElementById("mpd_" + pmsc).classList.remove("textinactive");
            document.getElementById("mpd_" + pmsc).classList.add("textactive");
            document.getElementById("mpd_" + premphoto).classList.remove("textactive");
            document.getElementById("mpd_" + premphoto).classList.add("textinactive");
        }
    }
}

function mid_banner_previus() {
    if (totalmslid > 1) {

        premphoto = pmsc;
        pmsc = pmsc - 1;

        if (pmsc < 0) {
            pmsc = totalmslid - 1;
        }

        if (pmsc >= totalmslid) {
            pmsc = 0;
            document.getElementById("mpc_" + premphoto).classList.remove("active");
            document.getElementById("mpc_" + premphoto).classList.add("inactive");
            document.getElementById("mpc_" + pmsc).classList.remove("inactive");
            document.getElementById("mpc_" + pmsc).classList.add("active");

            document.getElementById("mpd_" + pmsc).classList.remove("textinactive");
            document.getElementById("mpd_" + pmsc).classList.add("textactive");
            document.getElementById("mpd_" + premphoto).classList.remove("textactive");
            document.getElementById("mpd_" + premphoto).classList.add("textinactive");
        }
        else {
            document.getElementById("mpc_" + premphoto).classList.remove("hidden");
            document.getElementById("mpc_" + pmsc).classList.remove("hidden");
            document.getElementById("mpc_" + premphoto).classList.remove("active");
            document.getElementById("mpc_" + premphoto).classList.add("inactive");
            document.getElementById("mpc_" + pmsc).classList.remove("inactive");
            document.getElementById("mpc_" + pmsc).classList.add("active");

            document.getElementById("mpd_" + pmsc).classList.remove("textinactive");
            document.getElementById("mpd_" + pmsc).classList.add("textactive");
            document.getElementById("mpd_" + premphoto).classList.remove("textactive");
            document.getElementById("mpd_" + premphoto).classList.add("textinactive");
        }
    }
}


var timer_top_banner = setInterval(function () {
    top_banner_move();
}, 7000);

var timer_mid_banner = setInterval(function () {
    mid_banner_move();
}, 7000);

function previus_top_button() {
    top_banner_previus();
    clearInterval(timer_top_banner);
    timer_top_banner = false;
}
function next_top_button() {
    top_banner_move();
    clearInterval(timer_top_banner);
    timer_top_banner = false;
}


function previus_mid_button() {
    mid_banner_previus();
    clearInterval(timer_mid_banner);
    timer_mid_banner = false;
}
function next_mid_button() {
    mid_banner_move();
    clearInterval(timer_mid_banner);
    timer_mid_banner = false;
}

$(window).scroll(function () {
    if (!timer_top_banner) {
        clearInterval(timer_top_banner);
        timer_top_banner = setInterval(function () {
            top_banner_move();
        }, 7000);
    }
    if (!timer_mid_banner) {
        clearInterval(timer_mid_banner);
        timer_mid_banner = setInterval(function () {
            mid_banner_move();
        }, 7000);
    }
});


var direction = "";
var oldx = 0;
var img_index = 0;
var gap = 0;

var mousemovemethod = function (e) {
    total3dimage = document.getElementsByClassName("img-3d").length - 1;
    if (total3dimage <= 1) {
        return false;
    }
    if (total3dimage >= 1 && total3dimage <= 5) {
        gap = 40;
    }
    else if (total3dimage > 5 && total3dimage <= 10) {
        gap = 35;
    }
    else if (total3dimage > 10 && total3dimage <= 15) {
        gap = 30;
    }
    else if (total3dimage > 15 && total3dimage <= 20) {
        gap = 25;
    }
    else if (total3dimage > 20 && total3dimage <= 25) {
        gap = 20;
    }
    else if (total3dimage > 25 && total3dimage <= 30) {
        gap = 20;
    }
    else if (total3dimage > 30 && total3dimage <= 35) {
        gap = 20;
    }
    else if (total3dimage > 35 && total3dimage <= 40) {
        gap = 20;
    }
    else if (total3dimage > 40) {
        gap = 10;
    }
    if (total3dimage <= 0) {
        return false;
    }


    if (oldx == 0) {
        oldx = e.pageX;
    }
    if (e.pageX > (oldx + gap)) {
        img_index = img_index - 1;

        if (img_index < 1) {
            img_index = total3dimage;
        }
        if (img_index > total3dimage) {
            img_index = 1;
        }

        document.getElementById("imgmain_3d").src = document.getElementById("img_3d_" + img_index).src;
        oldx = e.pageX;
    }
    else if (e.pageX < (oldx - gap)) {
        img_index = img_index + 1;

        if (img_index < 1) {
            img_index = total3dimage;
        }
        if (img_index > total3dimage) {
            img_index = 1;
        }

        document.getElementById("imgmain_3d").src = document.getElementById("img_3d_" + img_index).src;
        oldx = e.pageX;
    }
}
document.getElementById("imgmain_3d").addEventListener("mousedown", function () {
    document.getElementById("imgmain_3d").addEventListener('mousemove', mousemovemethod);
});

document.getElementById("imgmain_3d").addEventListener("mouseup", function () {
    document.getElementById("imgmain_3d").removeEventListener("mousemove", mousemovemethod);
});


function autoloop() {
    total3dimage = document.getElementsByClassName("img-3d").length - 1;
    if (total3dimage <= 1) {
        return false;
    }
    if (total3dimage >= 1 && total3dimage <= 5) {
        gap = 40;
    }
    else if (total3dimage > 5 && total3dimage <= 10) {
        gap = 35;
    }
    else if (total3dimage > 10 && total3dimage <= 15) {
        gap = 30;
    }
    else if (total3dimage > 15 && total3dimage <= 20) {
        gap = 25;
    }
    else if (total3dimage > 20 && total3dimage <= 25) {
        gap = 20;
    }
    else if (total3dimage > 25 && total3dimage <= 30) {
        gap = 20;
    }
    else if (total3dimage > 30 && total3dimage <= 35) {
        gap = 20;
    }
    else if (total3dimage > 35 && total3dimage <= 40) {
        gap = 20;
    }
    else if (total3dimage > 40) {
        gap = 10;
    }
    if (total3dimage <= 0) {
        return false;
    }

    img_index = img_index + 1;

    if (img_index < 1) {
        img_index = total3dimage;
    }
    if (img_index > total3dimage) {
        img_index = 1;
    }
    document.getElementById("imgmain_3d").src = document.getElementById("img_3d_" + img_index).src;
}

var _timer ;//= setInterval(function () { autoloop(); }, 300);

$("#imgmain_3d").mouseover(function () {
    clearInterval(_timer);
});
$("#imgmain_3d").mouseout(function () {
    _timer = setInterval(function () { autoloop(); }, 300);
});

var move_id = "mpdtxt_0";
var mousePosition;
var offset = [0, 0];
var isDown = false;

function set_move_id(id) {
    move_id = id;

    document.getElementById(move_id).addEventListener('mousedown', function (e) {
        isDown = true;
        offset = [
            document.getElementById(move_id).offsetLeft - e.clientX,
            document.getElementById(move_id).offsetTop - e.clientY
        ];
    }, true);
}


document.addEventListener('mouseup', function () {
    isDown = false;
}, true);

document.addEventListener('mousemove', function (event) {
    event.preventDefault();
    if (isDown) {
        mousePosition = {

            x: event.clientX,
            y: event.clientY

        };
        document.getElementById(move_id).style.left = (mousePosition.x + offset[0]) + 'px';
        document.getElementById(move_id).style.top = (mousePosition.y + offset[1]) + 'px';
    }
}, true);
