﻿/* page参数是所在页面或所在位置
* 1是首页滚动图片
* 2是首页足部文字图片
* 3是首页腿部文字图片
* 4是首页腰部文字图片
* 5是首页肩颈部文字图片
* 6是首页足部文字图片
* 7是足部列表页图片
* 8是腿部列表页图片
* 9是腰部列表页图片
* 10是肩颈部列表页图片
* 11是脸部列表页图片
* 12是睡眠健康列表页图片
* 13是办公室健康列表页图片
* 14是保健系列列表页图片
* 15是保暖系列列表页图片
* 16是保湿系列列表页图片
* 17是矫正系列列表页图片
* 18是美腿系列列表页图片
* 19是护肤系列列表页图片
* 20是防臭系列列表页图片
* 21是辅助系列列表页图片
* 22是产品详细页销售排行
* 23是首页各部位图片与销售排行
*/
//显示首页滚动图片
function ShowgundongImg(url) {
    jQuery.getJSON(url + "ashx/GetImg.ashx", { t: "c", v: "", p: "c", w: "" }, function(data) {
        $.each(data, function(i) {
            var html = "";
            if (data[i].href != "null" && data[i].href.length > 0) {
                html = "<li><a href=\"" + data[i].href + "\" target=\"_blank\"><img style=\"cursor:pointer\" src=\"/upload/img/" + data[i].img + "\" alt=\""+data[i].title+"\" /></a></li>";
            } else {
            html = "<li><img style=\"cursor:pointer\" src=\"/upload/img/" + data[i].img + "\" alt=\"" + data[i].title + "\"/></li>";
            }
            $("#ul_gundongimg").append(html);
        });
        //滚动列表显示
        TB.widget.SimpleSlide.decoration('SlidePlayer', { eventType: 'mouse', effect: 'scroll' });
    });
}
//显示部位
function ShowbuweiImg(url) {
    jQuery.getJSON(url + "ashx/GetBWandTopImg.ashx", { t: "c", v: "", p: "c", w: "" }, function(data) {
        $.each(data, function(i) {
            if (data[i].type == "2") {
                $("#zubu" + data[i].place).attr("src", url + "upload/img/" + data[i].img);
                if (data[i].href != "null") {
                    $("#zubu" + data[i].place).bind("click", function() {
                        window.open(data[i].href, "_black", "");
                    }); 
                }
            }
            if (data[i].type == "3") {
                $("#tuibu" + data[i].place).attr("src", url + "upload/img/" + data[i].img);
                if (data[i].href != "null") {
                    $("#tuibu" + data[i].place).bind("click", function() {
                        window.open(data[i].href, "_black", "");
                    }); 
                }

            }
            if (data[i].type == "4") {
                $("#yaobu" + data[i].place).attr("src", url + "upload/img/" + data[i].img);
                if (data[i].href != "null") {
                    $("#yaobu" + data[i].place).bind("click", function() {
                        window.open(data[i].href, "_black", "");
                    }); 
                }
            }
            if (data[i].type == "5") {
                $("#jianjingbu" + data[i].place).attr("src", url + "upload/img/" + data[i].img);
                if (data[i].href != "null") {
                    $("#jianjingbu" + data[i].place).bind("click", function() {
                        window.open(data[i].href, "_black", "");
                    }); 
                }
            }
            if (data[i].type == "6") {
                $("#lianbu" + data[i].place).attr("src", url + "upload/img/" + data[i].img);
                if (data[i].href != "null") {
                    $("#lianbu" + data[i].place).bind("click", function() {
                        window.open(data[i].href, "_black", "");
                    }); 
                }
            }
        });
    });
}


function showtopImg(url) {
    jQuery.getJSON(url + "ashx/GetTopImg.ashx", { t: "c", v: "", p: "c", w: "" }, function(data) {
        $.each(data, function(i) {
        $("#top" + (i + 1)).attr("src", url + "upload/img/" + data[i].img);
            if (data[i].href != "null") {
                $("#top" + (i + 1)).bind("click", function() {
                    window.open(data[i].href, "_black", "");
                }); 
            }
        });
    });
}

function showProImg(type) {
    jQuery.getJSON("../ashx/GetProListImg.ashx?type=" + type, { t: "c", v: "", p: "c", w: "" }, function(data) {
        $.each(data, function(i) {
            $("#proListimg").attr("src", "../upload/img/" + data[i].img);
            if (data[i].href != "null") {
                $("#proListimg").bind("click", function() {
                    window.open(data[i].href, "_black", "");
                }); 
            }
        });
    });
 }

function openwindow(url) {
        window.open(url, "_black", "");
    }
