function setCookie(name, value, expires, path, domain, secure) {
    var today = new Date();
    today.setTime( today.getTime() );
    var expires_date = new Date( today.getTime() + (expires) );
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires_date.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}
function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}
function deleteCookie(name, path, domain) {
    if (getCookie(name)) {
        document.cookie = name + "=" +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}
function displayOrNot()
{
    //根据展示状态，展示或者隐藏广告
	var displayTag = document.getElementById('adContent').style.display;
	var foldSpan = document.getElementById('foldSpan');
	if(displayTag == 'none')
		isShow = false;
	else
		isShow = true;
	if(isShow){
		adContent.style.display='none';
		ori = foldSpan.innerHTML;
		foldSpan.innerHTML = "展开"+ori.substr(2);
	}else {
		adContent.style.display='';
		ori = foldSpan.innerHTML;
		foldSpan.innerHTML = "收起"+ori.substr(2);
	}
}
function switchcol() {
    var switchcolimg = document.getElementById("switchcolimg");
    var outer = document.getElementById("leftcolumn");
    var pbPrefix = 'leftColumn_';
    if (outer.className == "outer") {
    	outer.className = 'outer col2';
        switchcolimg.src = "/images/switch3col.gif";
		switchcolimg.title = "打开侧栏";
        setCookie("columnnum", "2", 1000 * 60 * 60 * 24 * 365 * 10, "/", "teamku.com", null);
    } else {
    	outer.className = 'outer';
        switchcolimg.src = "/images/switch2col.gif";
		switchcolimg.title = "关闭侧栏";
        deleteCookie("columnnum", "/", "teamku.com");
    }
}

/*
window.onload = function ()
{
    var copen = getCookie('columnnum');
    if(!copen) switchcol();
}
*/ 
