
function corner(elem,action){
	a = elem.getElementsByTagName('span');
	for(i=0; i<a.length; i++){
		if(action == 'over'){
			a[i].className = "on";
		} else {
			if(elem.className == "on"){
				a[i].className = "on";
			} else {
				a[i].className = "";
			}
		}
	}
}

function navigation(){
	if(window.nav && window.nav != ""){
		if(document.getElementById("nav-" + nav)){
			nav_item = document.getElementById("nav-" + nav);
			nav_item.className = "on";	
			corner(nav_item,'over');
		}
	}
}

function toggle_all () {
	var feat = document.getElementById('features');
	for (var b=0;b<feat.childNodes.length;b++) {
		if (feat.childNodes[b].nodeName == 'UL') {
			feat.childNodes[b].style.display = 'block';
		}
	}
}
function close_all (){
	var feat = document.getElementById('features');
	for (var b=0;b<feat.childNodes.length;b++) {
		if (feat.childNodes[b].nodeName == 'UL') {
			feat.childNodes[b].style.display = 'none';
		}
	}
}
function toggle (wht){
	var o = document.getElementById(wht);
	if(o.style.display == 'block') {
		o.style.display = "none";
	} else {
		close_all();
		o.style.display = 'block';
	}
}
/*------------------------------------------------------------------------------
  cookie functions
------------------------------------------------------------------------------*/

// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

function getCookie (name) {
        var arg = name + "=";
        var alen = arg.length;
        var clen = document.cookie.length;
        var i = 0;
        while (i < clen) {
                var j = i + alen;
                if (document.cookie.substring(i, j) == arg)
                        return getCookieVal (j);
                i = document.cookie.indexOf(" ", i) + 1;
                        if (i == 0)
                                break;
                }
   return null;
}

function getCookieVal (offset) {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1)
      endstr = document.cookie.length;
   return unescape(document.cookie.substring(offset, endstr));
}