function showhide(num) {
	for (i=0;i<=13;i++) {
		if (num==i) {
			hidebar=eval(document.getElementById("sidebar"+i).style);
			hidetitle=eval(document.getElementById("sidetitle"+i).style);

			if (hiddenset[i]=="1") {
				hidetitle.backgroundPosition='0px 0px';
				hidebar.display="block";
				hidetitle.fontSize='9pt';
				hidetitle.paddingLeft='5px';
				hiddenset[i]="0";
			}
			else {
				hidebar.display="none";
				hidetitle.backgroundPosition='-170px 0px';
				hidetitle.fontSize='8pt';
				hidetitle.paddingLeft='35px';
				hiddenset[i]="1";
			}
		}
	}
	hidden = hiddenset.join(",");
	saveCookie("orangeo_hiddenset", hidden, 30);
}

function initHide() {
	for (i=0;i<=13;i++) {
		hidebar=eval(document.getElementById("sidebar"+i).style);
		hidetitle=eval(document.getElementById("sidetitle"+i).style);

		if (hiddenset[i]=="1") {
				hidebar.display="none";
				hidetitle.backgroundPosition='-170px 0px';
				hidetitle.fontSize='8pt';
				hidetitle.paddingLeft='35px';
		}
		else {
				hidetitle.backgroundPosition='0px 0px';
				hidebar.display="block";
				hidetitle.fontSize='9pt';
				hidetitle.paddingLeft='5px';
		}
	}
	return null;
}

function loadCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

function saveCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

window.onload = function(e) {
	var hiddenset = new Array(14);
	var hidden = loadCookie("orangeo_hiddenset");
	if (hidden == "" || hidden == null) {
		hidden = "0,0,0,0,0,0,0,0,0,0,0,0,0,0";
	}
	hiddenset = hidden.split(",");
	initHide();
}

window.onunload = function(e) {
  saveCookie("orangeo_hiddenset", hidden, 30);
}

// if browser can't allow window.onload //

var hiddenset = new Array(14);
var hidden = loadCookie("orangeo_hiddenset");
if (hidden == "" || hidden == null) {
	hidden = "0,0,0,0,0,0,0,0,0,0,0,0,0,0";
}
hiddenset = hidden.split(",");
initHide();
