function $(d){
	return document.getElementById(d);
}
function g(d, v){
	if(v == undefined){
		if((d.style.display != "none") && (d.style.display != "")){
			return d.offsetHeight;
		}
		o = d.style.display;
		d.style.display = "block";
		v = parseInt(d.offsetHeight);
		d.style.display = o;
		return v;
	}else{
		d.style.height = v + "px";
	}
}
function of(d, v){
	g(d, v);
	v = (v / d.h);
	if(v != 1){
		d.style.filter = "alpha(opacity=" + (v * 100) + ")";
	}else{
		d.style.filter = "";
	}
	d.style.opacity = v;
}
function b(d){
	d = $(d);
	z = g(d);
	x = d.h;
	if(z > 0){
		v = Math.round(z / d.s);
		if(v < 1){
			v = (z - 1);
		}else{
			v = (z - v);
		}
		of(d, v);
	}else{
		g(d, 0);
		d.style.display = "none";
		clearInterval(d.t);
	}
}
function e(d){
	d = $(d);
	z = g(d);
	x = d.h;
	d.style.display = "block";
	if(z < x){
		v = Math.round((x - z) / d.s);
		if(v < 1){
			v = (z + 1);
		}else{
			v = (z + v);
		}
		of(d, v);
	}else{
		g(d, x);
		clearInterval(d.t);
	}
}
function Accordian(d, s, f){
	l = $(d).getElementsByTagName("div");
	a = [];
	for(i = 0; i < l.length; i++){
		d = l[i];
		if(d.id.substr(d.id.indexOf("-"), d.id.length) == "-content"){
			a.push(d);
		}
	}
	x = null;
	for(i = 0; i < l.length; i++){
		(function(h){
		  	c = h.id.substr(0,h.id.indexOf("-"));
				if((c + "-header") == h.id){
					c = $(c + "-content");
					c.style.display = "none";
					c.style.overflow = "hidden";
					c.h = g(c);
					if(s == undefined){
						c.s = 7;
					}else{
						c.s = s;
					}
					h.f = f;
					h.c = a;
					if(h.className.match(new RegExp(f + "+"))){
						x = h;
					}
					h.onclick = function(){						
						for(j = 0; j < this.c.length; j++){
							n = this.c[j].id;
							n = n.substr(0, n.indexOf("-"));
							d = $(n + "-header");
							n = $(n + "-content");
							s = d.className.split(new RegExp("\\s+"));
							for(p = 0; p < s.length; p++){
								if(s[p] == ("" + d.f)){
									s.splice(p, 1);
									d.className = s.join(" ");
								break;
							}
						}
						clearInterval(n.t);
						if(d.id == this.id){
							if(n.style.display == "none"){
								g(n, 0);
								n.t = setInterval('e("' + n.id + '")', 9)
								d.className+= (" " + d.f);
							}else{
								n.t = setInterval('b("' + n.id + '")', 9)
							}
						}else{
							if(n.style.display == "block"){
								n.t = setInterval('b("' + n.id + '")', 9)
							}
						}
					}
				}
			}
		})
		(l[i])
	}
	if(x != null){
		x.onclick();
	}
}