﻿// JScript 文件

function over_style(c,n){
	var num = 8;
	
	for(var i=1; i<=num; i++){
		$("#c_"+c+"_"+i).removeClass();
		$("#c_"+c+"_"+i).addClass("Br_ln");
		if(8 == i){
			$("#c_"+c+"_"+i).css("background","");
			$("#c_"+c+"_"+i).height(33);
		}
	}
	$("#c_"+c+"_"+n).removeClass();
	$("#c_"+c+"_"+n).addClass("Br_ln1");
	if(8 == n){
		$("#c_"+c+"_"+n).css("background","none");
		$("#c_"+c+"_"+n).height(63);
		$("#c_"+c+"_"+n).css("borderBottom","0px");
	}
}

function switch_div(n){
	var m = 3;
	for(var i=1; i<=m; i++){
		if(i != n){
			$("#show_"+i).hide();
			$("#crt_"+i).removeClass();
		}else{
			$("#show_"+i).show();
			$("#crt_"+i).addClass("act");
		}
	}
}

//选项卡
function tabshow(tabid, conid, index, onclassname, outclassname, max) {

    for (var i = 1; i < max + 1; i++) {
        $("#" + tabid + "_" + i).removeClass();
        $("#" + tabid + "_" + i).addClass(outclassname);
        $("#" + conid + "_" + i).hide();
        if (i == index) {
            $("#" + tabid + "_" + index).removeClass();
            $("#" + tabid + "_" + index).addClass(onclassname);
            $("#" + conid + "_" + index).show();
        }
    }
}

//用户信息
function Getuserinfo(name) {
    //alert(name);
    var welmsg = document.getElementById("welcomemsg");
    var exitinfo = document.getElementById("logontxt");

    welmsg.innerHTML = "<span style=\"color:#0078c5\">" + name + "</span>您好，<br />&nbsp;&nbsp;&nbsp;&nbsp;欢迎来到卓诚家居网！";
    exitinfo.innerHTML = "<a href=\"javascript:logonout('welcomemsg','logontxt');\" style=\"color: red\">退出</a>";
}

//获取用户信息
function getCookie(name) {

    var userinfo = "";
    var username = "";
    var welmsg = document.getElementById("welcomemsg");
    var exitinfo = document.getElementById("logontxt");

	//alert(name);
    userinfo = GetCookie(name);
    //alert(userinfo);
    if (userinfo != null) {
        username = userinfo.split('&');
        //alert(username[0]);
        username = username[1].split('=');
        if (username != "") {
            welmsg.innerHTML = "<span style=\"color:#0078c5\">" + DecodeCookie(username[1]) + "</span>&nbsp;您好，<br />&nbsp;&nbsp;&nbsp;&nbsp;欢迎来到卓诚家居网！";
            exitinfo.innerHTML = "<a href=\"javascript:logonout('welcomemsg','logontxt');\" style=\"color: red\">退出</a>";
        }
    }
    else {
        welmsg.innerHTML = "游客您好，<br />&nbsp;&nbsp;&nbsp;&nbsp;欢迎来到卓诚家居网！";
        exitinfo.innerHTML = "<a href=\"http://bbs.wootg.com/logging.php?action=login&submit=yes\" style=\"color: red\">登陆</a>";
    }
}