/*
V.2008012105
A.Zed Gu
D.Hidden Layout
Copyright (c) 2008, Eachnet All rights reserved.
*/
var hl = {
	o: function(p,t,r,s,d) {
		var o = $t(t,p);
		for (var i = 0; i < o.length; i++) {
			this.a(o[i],false);
		}
		if (r) {
			this.rint(p,t,s,d);
		} else if (s) {
			this.sj(o);
		}
	},
	s: function(p,t,r,s,d) {
		var o = $t(t,p);
		for (var i = 0; i < o.length; i++) {
			this.a(o[i],false,o);
		}
		if (r) {
			this.rint(p,t,s,d);
		} else if (s) {
			this.sj(o);
		}
	},
	c: function(p,t,r,s) {
		this.id = p;
		var o = $t(t,p);
		for (var i = 0; i < o.length; i++) {
			this.a(o[i],true,o);
		}
		if (r) {
			this.rint(p,t,s);
		} else if (s) {
			this.sj(o);
		}
	},
	a: function(p,c,s){
		var t = p.parentNode;
		var a = [];
		for (var i = 0; i < t.childNodes.length; i++) {
			if (t.childNodes[i].nodeType == 1) {
				a.push(t.childNodes[i]);
			}
		}
		if (c) {
			if (a.length > 1 && s) {
				p.onclick = function() {
					for (var i = 0; i < s.length; i++) {
						s[i].parentNode.className = "";
					}
					t.className = "c";
				}
			}
		} else {
			if (a.length > 1) {
				if (s) {
					p.onmouseover = function() {
						for (var i = 0; i < s.length; i++) {
							s[i].parentNode.className = "";
						}
						t.className = "c";
					}
				} else {
					p.onmouseover = a[1].onmouseover = function() {
						t.className = "c";
					}
					p.onmouseout = a[1].onmouseout = function() {
						t.className = "";
					}
				}
			}
		}
	},
	oo: {},
	rint: function(p,t,s,d) {
		var oo = $t(t,p);
		this.oo[p] = {};
		this.oo[p]['c'] = 0;
		this.oo[p]['o'] = oo;
		this.oo[p]['t'] = null;
		if (s) {
			this.oo[p]['c'] = parseInt(Math.random()*oo.length);
		} else {
			for (var i = 0; i < oo.length; i++) {
				if (oo[i].className == "c") {
					this.oo[p]['c'] = i;
				}
			}
		}
		this.r(p,t,d);
	},
	r: function(p,t,d) {
		for (var i = 0; i < this.oo[p]['o'].length; i++) {
			this.oo[p]['o'][i].parentNode.className = "";
		}
		this.oo[p]['o'][this.oo[p]['c']].parentNode.className = "c";
		d = (d == null) ? 5:d;
		this.oo[p]['t'] = window.setTimeout('hl.r("'+p+'","'+t+'")',500*d);
		this.oo[p]['c']++;
		if (this.oo[p]['c'] == this.oo[p]['o'].length) {
			this.oo[p]['c'] = 0;
		}
	},
	sj: function(o) {
		for (var i = 0; i < o.length; i++) {
			o[i].parentNode.className = "";
		}
		o[parseInt(Math.random()*o.length)].parentNode.className = "c";
	}	
};
