// JavaScript Document

//mainNav
function qiehuan(num){
	for(var id = 0;id<=8   ;id++)
	{
		if(id==num)
		{
			document.getElementById("subNav"+id).style.display="block";
			document.getElementById("nav"+id).className="nav_on";
		}
		else
		{
			document.getElementById("subNav"+id).style.display="none";
			document.getElementById("nav"+id).className="";
		}
	}
};


function buttonStateHandler(button, enabled) {
if (button == "prev-arrow") 
$('prev-arrow').src = enabled ? "images/left.gif" : "images/left_gray.gif"
else 
$('next-arrow').src = enabled ? "images/right.gif" : "images/right_gray.gif"
}

function animHandler(carouselID, status, direction) {
var region = $(carouselID).down(".carousel-clip-region")
if (status == "before") {
Effect.Fade(region, {to: 0.3, queue: { position:'end', scope: "carousel" }, duration: 0.2})
}
if (status == "after") {
Effect.Fade(region, {to: 1, queue: { position:'end', scope: "carousel" }, duration: 0.2})
}
};
	


if (document.getElementById("bigImg")) {
	window.onload = function() {
		
				
		var bigImg = document.getElementById("bigImg");
		var bigImgName = document.getElementById("bigImgName");
		var imgList = document.getElementById("smallImg").getElementsByTagName('img');

		for(var n = 0; n < imgList.length; n++){
			imgList[n].onclick = function(){
				bigImg.src = this.getAttribute("rel");
				bigImgName.innerHTML = this.getAttribute("title");
			};
		}
	}
}

