﻿function overtable(this_s) {
    this_s.style.border = '1px solid #ff7f87';
}
function outtable(this_s) {
    this_s.style.background = ''; this_s.style.border = '1px solid #dadada';
}

function showadv() {
    if (document.aspnetForm.advshow.checked == true) {
        document.getElementById("adv").style.display = "";
        document.getElementById("advance").innerText = "关闭高级用户设置选项";
    } else {
        document.getElementById("adv").style.display = "none";
        document.getElementById("advance").innerText = "显示高级用户设置选项";
    }
}

function readcookie(name) {
    var start1 = mycookie.indexOf(name + "=");
    if (start1 == -1)
        alert("cookies not found");
    else {
        start = mycookie.indexOf("=", start1) + 1;
        var end = mycookie.indexOf(";", start);
        if (end == -1) {
            end = mycookie.length;
        }
        var value = unescape(mycookie.substring(start, end));
        if (value == null)
        { alert("No cookies found!"); }
        else
        { alert("cookie变量:" + name + " 的值是 :" + value); }
    }
}

function jft(str) {
    if (str == 0) { document.cookie = "lang=0;"; }
    if (str == 1) { document.cookie = "lang=1;"; }
    if (str == 2) { document.cookie = "lang=2;"; }
 }


function conURL(str, url, tar) {
    question = confirm(str)
    if (question != "0") {
        if (tar == "_self") {
            window.location.href = url;
        }
        else {
            window.open(url);
        }
    }
}

function go2URL(url, tar) {
    if (tar == "_self") {
        window.location.href = url;
    }
    else {
        window.open(url);
    }
}

function SearchA() {

    var sw = escape(document.all.item("tbSearchW").value);
    var so = document.all.item("tbSearchW").value;
    if (so == "关键字") {

        document.all.item("tbSearchW").value = "";
    }

    //window.open("cart.aspx?action=car&uid=" + bb + "&uam=" + aa, "_self")

}
function SearchB() {

    var sw = escape(document.all.item("tbSearchW").value);
    var so = document.all.item("tbSearchW").value;
    if (so == "") {

        document.all.item("tbSearchW").value = "关键字";
    }

    //window.open("cart.aspx?action=car&uid=" + bb + "&uam=" + aa, "_self")

}
function Search() {

    var sw = escape(document.all.item("tbSearchW").value);
    var sk = document.all.item("tbSearchK").value;

    window.location.href = "search.aspx?sk=" + sk + "&sw=" + sw;

        //window.open("cart.aspx?action=car&uid=" + bb + "&uam=" + aa, "_self")

}



function checkInput() {
    //只允许数字
    //if (!((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 96 && event.keyCode <= 105)))

    var key
    key = window.event.keyCode
    if ((key > 95 && key < 106) || (key > 47 && key < 59) || key == 8 || key == 37 || key == 39 || key == 46)
    { }
    else {
        alert("请您输入0-9之间的数字！");
        return false;
    }
}



function buy(str) {
    question = confirm("确定要购买该商品?")
    if (question != "0") {
        var bb = str.substring(3, str.length);
        var cc = 'sp' + str;
        var aa = document.all.item(cc).value;
        window.location.href = "addcart.aspx?act=car&did=" + bb + "&num=" + aa;

        //window.open("cart.aspx?action=car&uid=" + bb + "&uam=" + aa, "_self")
    }
}


//取小数点
function formatFloat(src, pos) {
    return Math.round(src * Math.pow(10, pos)) / Math.pow(10, pos);
}

function copyToClipBoard(url) {
    var clipBoardContent = "";
    clipBoardContent += url;
    

    window.clipboardData.setData("Text", clipBoardContent);
    alert("地址复制成功，请粘贴到你需要的地方。");
}


/////////////////////////////////////////

