var sticker;
var sticker_top=0;
addEvent(window, "scroll", function() {
	if (window.XMLHttpRequest && sticker_top>0) {
		if (document.documentElement.scrollTop>sticker_top-2 || document.body.scrollTop>sticker_top-2) {
			if (sticker.style.position!="fixed") {
				sticker.style.position="fixed"; 
				sticker.style.top="2px";
			}
		}
		else {
			if (sticker.style.position!="absolute") {
				sticker.style.position="absolute"; 
				sticker.style.top="auto";
			}
		}
	}
});
addEvent(window, "load", function() {
	sticker=$("primary");
	if (sticker) sticker_top=sticker.offsetTop;
	var Scroller=function(frameElm, contentElm, tempo, w, h) {
		// default parameters
		var thisObj=this;
		var thisScroll="";
		this.nXlocation=0;
		this.nYlocation=0;
		this.nFrameHeight=h;
		this.nFrameWidth=w;
		this.nTempo=tempo;
		this.scrollerStat=true;
		this.objFrame=contentElm;
		// frame parameter
		f=frameElm;
		f.style.height=h+"px";
		f.style.width=w+"px";
		this.MoveScroller=function() {
			this.nXlocation--;
			this.objFrame.style.top=this.nXlocation+"px";
		}
		this.CheckScroller=function() {
			if ((0-this.nXlocation)>this.objFrame.offsetHeight) this.nXlocation=this.nFrameHeight;
		}
		this.RunScroll=function() {
			if (this.scrollerStat) {
				this.MoveScroller();
				this.CheckScroller();
			}
		}
		this.StartScroll=function() {
			thisScroll=setInterval(function() {thisObj.RunScroll();},thisObj.nTempo);
		}
		this.StopScroll=function() {
			clearInterval(thisScroll);
		}
		addEvent(f, "mouseover", function() {
			thisObj.StopScroll();
		});
		addEvent(f, "mouseout", function() {
			thisObj.StartScroll();
		});
	}
	function tryScroller(id) {
		try {
			var s1=new Scroller($(id).getElementsByTagName("div")[1], $(id).getElementsByTagName("div")[1].getElementsByTagName("ul")[0], 44, 216, 150);
			s1.StartScroll();
		} catch (err) {}
	}
	tryScroller("fhojgpepf08ardgw");
	tryScroller("inlt1qvt7seaecnx");
	function hideMoreShowHidden(elms, countMany, removeElm) {
		for (var i=countMany; i<elms.length; i++) {
			elms[i].className="";
		}
		removeElm.parentNode.removeChild(removeElm);
	}
	function collapseMany(elms, countMany, elmType) {
		if (elms.length>countMany) {
			var elmType2Create=(elmType=="li")?"p":"span";
			for (var i=countMany; i<elms.length; i++) elms[i].className="more";
			var more=document.createElement(elmType2Create);
			more.className="more_"+elmType;
			var elmClickOn=(elmType=="li")?document.createElement("p"):more;
			elmClickOn.appendChild(document.createTextNode("More..."));
			elms[0].parentNode.insertBefore(more, elms[countMany]);
			if (elmType=="li") more.appendChild(elmClickOn);
			addEvent(elmClickOn, "click", function() {hideMoreShowHidden(elms, countMany, more);});
		}
	}
	if ($("zjnkvxwwjn0piz8xyar")) {
		collapseMany($("zjnkvxwwjn0piz8xyar").getElementsByTagName("span"), 20, "span");
	}
	if ($("yyzfwfri9ozptva2")) {
		collapseMany($("yyzfwfri9ozptva2").getElementsByTagName("span"), 20, "span");
	}
	if ($("udmmfrgxju2p3_xrvgrt")) {
		collapseMany($("udmmfrgxju2p3_xrvgrt").getElementsByTagName("span"), 20, "span");
	}
});
function $(id) {
	return document.getElementById(id);
}
function addEvent(obj, type, fn) {
	if (obj.attachEvent) {
		obj["e"+type+fn]=fn;
		obj[type+fn]=function() {obj["e"+type+fn](window.event);}
		obj.attachEvent("on"+type, obj[type+fn]);
	}
	else obj.addEventListener(type, fn, false);
}
