function rolinNav() {
	var obj = byTag(byTag(byId("nav"), "ul")[0], "LI");
	for (var i=0; i<obj.length; i++) {
		(function() {
			var li = obj[i];
			var j = i;
			var a = byTag(li, "A")[0];
			li.style.cursor = "pointer";
			addEvent(li, "mouseover", function() {
				this.style.backgroundColor = "#000";
				a.style.backgroundPosition = "center " + -j * 24  + "px";
			});
			addEvent(li, "mouseout", function() {
				this.style.backgroundColor = "";
				a.style.backgroundPosition = "center " + (-j * 24 - 12) + "px" ;
			});
			addEvent(li, "click", function() {
				location.href = a.href;
			});
		})();
	}
}
domReady(rolinNav);

// 提示窗类
function rolinAlertWindow(str) {
	
	var closeBtn;
	var movieInterval
	var shieldAlpha = 30;
	var dBody = document.getElementsByTagName("BODY")[0];
	var rolinShield = document.createElement("DIV");
	rolinShield.id = "shield";
	var tarH;
	var tarW;
	
	
	var arr = [["position","absolute"],
				["left","0px"],
				["top","0px"],
				["width","100%"],
				["height",dBody.scrollHeight + "px"],
				["zIndex","10000"],
				["filter","alpha(opacity="+shieldAlpha+")"],
				["opacity",shieldAlpha/100],
				["textAlign","center"],
				["background","#000"]];
	
	for (var i=0; i<arr.length; i++) {
		rolinShield.style[arr[i][0]] = arr[i][1];
	}
	dBody.appendChild(rolinShield)
	var alertMain = document.createElement("DIV");
	alertMain.className = "alert_main";
	alertMain.innerHTML = str;
	alertMain.style.visibility = "hidden";
	dBody.appendChild(alertMain);
	alertMain.style.zIndex = 10002;
	
	alertMain.style.left = "50%";
	alertMain.style.top = "50%";
	alertMain.style.marginLeft = -alertMain.offsetWidth/2 + "px";
	alertMain.style.marginTop =  -alertMain.offsetHeight/2 + document.documentElement.scrollTop + "px";
	
	var div = document.createElement("DIV");
	playMovie(alertMain);
	
	closeBtn = alertMain.getElementsByTagName("IMG")[1];
	closeBtn.style.cursor = "pointer";
	closeBtn.onclick = function() {
		alertMain.parentNode.removeChild(alertMain);
		div.parentNode.removeChild(div);
		rolinShield.parentNode.removeChild(rolinShield);
	}
	
	function playMovie() {
		tarH = alertMain.offsetHeight;
		tarT = alertMain.offsetTop;
		div.style.fontSize = "0px"
		div.style.background = "#fff";
		div.style.position = "absolute";
		div.style.top = (alertMain.offsetTop + tarH/2) + "px" ;
		div.style.left = alertMain.offsetLeft + "px";
		div.style.height = "1px";
		div.style.width = alertMain.offsetWidth + "px";
		div.style.zIndex = 10001;
		dBody.appendChild(div);
		movieInterval = setInterval(moving,10);
	}
	var speed = 0.1666;
	var range = 1;
	var mH = 1;
	var mT = parseInt(div.style.top);
	
	function moving() {
		
		mH += (tarH - mH)*speed;
		mT += (tarT - mT)*speed;
		div.style.height = mH + "px";
		div.style.top = mT + "px";
		if (Math.abs(tarH -mH) <= range) {
			clearInterval(movieInterval);
			div.style.height = tarH + "px";
			alertMain.style.visibility = "visible";
		}
	}
	
};

