

function changeCalendar(year, month){
  $("#blog-cal-js").load(baseURL+"calendar.html?dy="+year+"&dm="+month);
}

function viewHtmlProfile(){
    $("#full-profile").show();
    $("#summary-profile").hide();
}

function viewSummaryProfile(){
    $("#summary-profile").show();
    $("#full-profile").hide();
}
function getCookie(key,  tmp1, tmp2, xx1, xx2, xx3) {
    tmp1 = " " + document.cookie + ";";
    xx1 = xx2 = 0;
    len = tmp1.length;
    while (xx1 < len) {
        xx2 = tmp1.indexOf(";", xx1);
        tmp2 = tmp1.substring(xx1 + 1, xx2);
        xx3 = tmp2.indexOf("=");
        if (tmp2.substring(0, xx3) == key) {
            return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1)));
        }
        xx1 = xx2 + 1;
    }
    return("");
}
function setCookie(key, val, tmp) {
    tmp = key + "=" + escape(val) + "; ";
    tmp += "expires=Tue, 31-Dec-2030 23:59:59; ";
    tmp += "path=/; ";
    document.cookie = tmp;
}
function clearCookie(key) {
    document.cookie = key + "=" + "xx; expires=Tue, 1-Jan-1980 00:00:00;";
}

function switchDispProfile(){
    if(dispProfile){
        dispProfile = false;
    }else{
        dispProfile = true;
    }
    switchProfile();
}

function switchProfile(){
    var node = document.getElementById("profile");
    var node2 = document.getElementById("centerContents");
    var linkNode = document.getElementById("switchProfileLink");
    if(dispProfile){
        node.className = "contents-profile";
        if(node2.className.lastIndexOf("-2") > 0){
            node2.className = node2.className.substring(0,node2.className.length-2);
        }
        linkNode.innerHTML = 'サークルプロフィールを閉じる';
        setCookie("dispCProfile", "true");
    }else{
        node.className = "hidden";
        if(node2.className.lastIndexOf("-2") == -1){
            node2.className = node2.className + "-2";
        }
        linkNode.innerHTML = 'サークルプロフィールを表示する';
        setCookie("dispCProfile","false");
    }
}