function $(id) {
	return document.getElementById(id);
}
function $tag(t, p) {
	p = p || document;
	return p.getElementsByTagName(t);
}
function setOpacity(o, n) {
	o = o.style;
	o.filter = 'alpha(opacity=' + n + ')';
	o.KhtmlOpacity = (n / 100);
	o.MozOpacity = (n / 100);
	o.opacity = (n / 100);
}	
function blank(id) {
	o = $(id);
	a = $tag('a', o);
	for(i = 0; i < a.length; i++) {
		a[i].onclick = function() {
			window.open(this.href);
			return false;
		}
	}
}
function swapClass(o, a) {
	c = o.className;
	o.className += a || '_hover';
	o.onmouseout = function() {
		this.className = c;
	}
}
function childCounter(id) {
	o = $(id);
	l = $tag('ul', o)[0].childNodes;
	for(i = 0; i < l.length; i++) {
		t = ' (' + l[i].lastChild.childNodes.length + ')';
		l[i].firstChild.title += t;
		l[i].firstChild.firstChild.nodeValue += t;
	}
}
function shortenByClass(t, c, l, e) {
	try {
		o = $tag(t);
		for(i = 0; i < o.length; i++) {
			if(o[i].className == c) {
				t = o[i].firstChild;
				if(t.length > l) {
					t.nodeValue = t.nodeValue.substring(0, l);
					if(t.nodeValue.substring(t.nodeValue.length - 1, t.nodeValue.length) == ' ')
						t.nodeValue = t.nodeValue.substring(0, t.nodeValue.length - 1);
					if(e)
						t.parentNode.innerHTML += e;
				}
			}
		}
	}
	catch(e) {
	}
}
function zClass(id, t, eClass, b) {
	p = $(id);
	e = $tag(t, p);
	c = 0;
	for(i = 0; i < e.length; i++) {
		if(e[i].className == eClass) {
			if(b == false && c == 0)
				c++;
			else if(c == 0) {
				e[i].className = eClass + '_even';
				c++;
			}
			else {
				e[i].className = eClass + '_odd';
				c = 0;
			}
		}
	}
}	
function gallery(id, t, c, nStart, nEnd) {
	g = $(id);
	e = $tag(t, g);
	for(i = 0; i < e.length; i++) {
		if(e[i].className == c) {
			e[i].onmouseover = function() {
				for(n = 0; n < e.length; n++) {
					if(e[n].className == c && e[n] !== this)
						setOpacity(e[n], nStart);
				}
			}
			e[i].onmouseout = function() {
				for(n = 0; n < e.length; n++) {
					setOpacity(e[n], nEnd);
				}
			}
		}
	}
}
function gallery(containerId, elementTag, elementClass, startOpacity, endOpacity) {
	
	function setOpacity(object, opacity) {
		
		var mOpacity = opacity / 100;
		
		with(object.style) {
			filter = 'alpha(opacity=' + opacity + ')';
			KhtmlOpacity = mOpacity;
			MozOpacity = mOpacity;
			opacity = mOpacity;
		};
		
	};
	
	var container = document.getElementById(containerId),
		elements = container.getElementsByTagName(elementTag);
	
	for(var i = 0, j = elements.length; i < j; i++) {
		
		var element = elements[i];
		
		if(element.className == elementClass) {
		
			element.onmouseover = function() {
				
				for(var i = 0, j = elements.length; i < j; i++) {				
				
					var element = elements[i];
				
					if(element.className == elementClass)
						setOpacity(element, startOpacity);

				};
						
				setOpacity(this, endOpacity);
				
			};
			
			element.onmouseout = function() {
				
				for(var i = 0, j = elements.length; i < j; i++) {
					
					var element = elements[i];
					
					if(element.className == elementClass)
						setOpacity(element, endOpacity);
					
				};
				
			};
		
		};
		
	};
	
};
function gSibs(id, c) {
	e = $(id);
	if(e.previousSibling) {
		o = e.previousSibling;
		if(o.nodeName == 'A' && o.className == c)
			o.id = id + '_prev';
	}
	if(e.nextSibling) {
		o = e.nextSibling;
		if(o.nodeName == 'A' && o.className == c)
			o.id = id + '_next';
	}
}
var attach = {
	links : function(container, tag, c) {
		var el = container.getElementsByTagName(tag);
		for(var i = 0, j = el.length; i < j; i++) {
			if(el[i].className == c && el[i].title.length > 0) {
				el[i].style.cursor = 'pointer';
				el[i].onclick = function() {
					window.open(this.title);
				};
			};
		};
	}
};
var go = {
	anchor : function(a) {
		var l = String(window.location);
		var p = l.indexOf('#');
		window.location.href = (p > 0) ? l.substring(0, p) + '#' + a : l + '#' + a;
	}
};

