domReady(function () {
	try{
	var s = byClass("tabNomorl", "LI");
	for (var i=0; i<s.length; i++) {
		addEvent(s[i],"mouseover", function(e){this.className = "tabHover";});
		addEvent(s[i],"mouseout", function(){this.className = "tabNomorl"});
	}}catch(e){}
});
domReady(function initCaseList() {
	try{
	var w = 129,speed=.3666,range=2.5;
	var dir = -1, fx = 0;
	var interval,mInterval;
	
	var btn = byTag(byId("case_list_btn"),"div");
	
	var obj = byId("case_list");

	var itemNum =  byTag(obj, "LI").length;
	
	obj.innerHTML += obj.innerHTML;
	obj.style.width = 2 * w * itemNum + "px";
	addEvent(btn[0], "click", function() {
		dir = 1;
		this.className = "clb_pre_hover"
		btn[1].className = "clb_next_nomorl"
	});
	
	addEvent(btn[1], "click", function() {
		dir = -1;
		this.className = "clb_next_hover"
		btn[0].className = "clb_pre_nomorl"
	});
	addEvent(obj, 'mouseover', function() {
		if (interval) clearInterval(interval);
		interval = null;
	});
	addEvent(obj, 'mouseout', function() {
		if (interval == null) init();
	});
	
	}catch(e){}
	if (itemNum > 5) init();
	function init() {
		interval = setInterval(change,4000);
	}
	function moveObj(x) {
		if (x/w == 1) {
			x = -(itemNum)*w;
			obj.style.left = x + "px";
			x += dir*w;
		} else if(x/w == -(itemNum + 1) ) {
			obj.style.left = "0px";
			x = dir*w;
		} 
		fx = x;
		tarX = x;
		if (mInterval) clearInterval(mInterval);
		mInterval = setInterval(moving,45);
	}
	function change() {
		fx += dir*w;
		moveObj(fx);
	}
	function moving() {
		var x = parseInt(obj.style.left);
		if (isNaN(x)) x = 0;
		obj.style.left = ( x + (tarX-x)*speed) + "px";
		if (Math.abs(tarX - parseInt(obj.style.left)) <= range) {
			clearInterval(mInterval);
			obj.style.left = tarX + "px";
		}
	}
});
