function initSubNavigation(a) {
  var ul = document.getElementById('subnavi').getElementsByTagName('ul');
  for(var i=0;i<ul.length;i++) {
    var l = ul[i].parentNode.getElementsByTagName('a')[0]; 
          
    ul[i].style.display = 'none';
    if(l.getAttribute('href').indexOf('/' + a) > -1) writeCookie('subnavi', i);
  }
  
  cookie = readCookie('subnavi');
  ul[cookie].parentNode.style.backgroundImage = 'url(' + baseURL + '/images/minus.png)';
  ul[cookie].style.display = 'block';
}

function writeCookie(name,value) {
	document.cookie = name+"="+value+"; path=/";
}

function readCookie(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 showHelp(obj, help) {
  Tip(help);
  obj.onmouseout = function() { UnTip(); }
}

function toggle(obj, toggleID) {
  document.getElementById(toggleID).style.display = (document.getElementById(toggleID).style.display == 'block') ? 'none' : 'block';
}
