/*function menu_over(img_id) {
	document.getElementById(img_id).src="images/"+ img_id +"_over.gif";
}
function menu_out(img_id) {
	document.getElementById(img_id).src="images/"+ img_id +".gif";
}*/

/*左侧菜单效果实现*/
document.onmouseover = doDocumentOnMouseOver ;
document.onmouseout = doDocumentOnMouseOut ;

function doDocumentOnMouseOver() {
	var eSrc = window.event.srcElement ;
	if (eSrc.className == "item") {
	  window.event.srcElement.className = "highlight";
	}
}

function doDocumentOnMouseOut() {
	var eSrc = window.event.srcElement ;
	if (eSrc.className == "highlight") {
	  window.event.srcElement.className = "item";
	}
}


var bV=parseInt(navigator.appVersion);
NS4=(document.layers) ? true : false;
IE4=((document.all)&&(bV>=4))?true:false;
ver4 = (NS4 || IE4) ? true : false;

function expandIt(){return}
function expandAll(){return}


isExpanded = false;

function getIndex(el) {
	ind = null;
	for (i=0; i<document.layers.length; i++) {
			whichEl = document.layers[i];
			if (whichEl.id == el) {
					ind = i;
					break;
			}
	}
	return ind;
}

function arrange() {
	nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height;
	for (i=firstInd+1; i<document.layers.length; i++) {
			whichEl = document.layers[i];
			if (whichEl.visibility != "hide") {
					whichEl.pageY = nextY;
					nextY += whichEl.document.height;
			}
	}
}

function initIt(){
	if (NS4) {
			for (i=0; i<document.layers.length; i++) {
					whichEl = document.layers[i];
					if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
			}
			arrange();
	}
	else {
			tempColl = document.all.tags("DIV");
			for (i=0; i<tempColl.length; i++) {
					if (tempColl(i).className == "child") tempColl(i).style.display = "none";
			}
	}
}

function expandIt(el) {
	if (!ver4) return;
	if (IE4) {expandIE(el)} else {expandNS(el)}
}

function expandIE(el) {
	whichEl = eval(el + "Child");
	whichIm = eval(el+"Img");

	if (whichEl.style.display == "none") {
			whichEl.style.display = "block";
			whichIm.src = "images/Icon-.gif";
	}
	else {
			whichEl.style.display = "none";
			whichIm.src = "images/Icon+.gif";
	}
    window.event.cancelBubble = true ;
}

function expandNS(el) {
	whichEl = eval("document." + el + "Child");
	whichIm = eval("document." + el + "Parent.document.images['imEx']");
	if (whichEl.visibility == "hide") {
			whichEl.visibility = "show";
			whichIm.src = "images/Icon-.gif";
	}
	else {
			whichEl.visibility = "hide";
			whichIm.src = "images/Icon+.gif";
	}
	arrange();
}

function showAll() {
	for (i=firstInd; i<document.layers.length; i++) {
			whichEl = document.layers[i];
			whichEl.visibility = "show";
	}
}

function expandAll(isBot) {
	newSrc = (isExpanded) ? "images/Icon+.gif" : "images/Icon-.gif";

	if (NS4) {
			for (i=firstInd; i<document.layers.length; i++) {
					whichEl = document.layers[i];
					if (whichEl.id.indexOf("Parent") != -1) {
							whichEl.document.images["imEx"].src = newSrc;
					}
					if (whichEl.id.indexOf("Child") != -1) {
							whichEl.visibility = (isExpanded) ? "hide" : "show";
					}
			}

			arrange();
			if (isBot && isExpanded) scrollTo(0,document.layers[firstInd].pageY);
	}
	else {
			divColl = document.all.tags("DIV");
			for (i=0; i<divColl.length; i++) {
					if (divColl(i).className == "child") {
							divColl(i).style.display = (isExpanded) ? "none" : "block";
					}
			}
			imColl = document.images.item("imEx");
			for (i=0; i<imColl.length; i++) {
					imColl(i).src = newSrc;
			}
	}

	isExpanded = !isExpanded;
}
/*Rolling*/
	bannerAD=new Array();
	//var bannerADlink=new Array();
	var adNum=0;
	bannerAD[0]="pic/old_pic01.gif";
	bannerAD[1]="pic/old_pic02.gif";
	bannerAD[2]="pic/old_pic03.gif";
	bannerAD[3]="pic/old_pic04.gif";

	var preloadedimages=new Array();
	for (i=1;i<bannerAD.length;i++){
	  preloadedimages[i]=new Image();
	  preloadedimages[i].src=bannerAD[i];
	}

	function setTransition(){
	   if (document.all){
		  bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
		  bannerADrotator.filters.revealTrans.apply();
	   }
	}

	function playTransition(){
	   if (document.all)
		  bannerADrotator.filters.revealTrans.play()
	}

	function nextAd(){
	   if(adNum<bannerAD.length-1)adNum++ ;
		  else adNum=0;
	   setTransition();
	   document.images.bannerADrotator.src=bannerAD[adNum];
	   playTransition();
	   theTimer=setTimeout("nextAd()", 8000);
	}
	function sel_src(srcNum){
	   //setTransition();
	   document.images.bannerADrotator.src=bannerAD[srcNum];	
	}
	/*function jump2url(){ 
		jumpUrl=bannerADlink[adNum]; 
		jumpTarget='_blank'; 
		if (jumpUrl != ''){ 
			if (jumpTarget != '')window.open(jumpUrl,jumpTarget); 
			else location.href=jumpUrl; 
		} 
	}*/
/*.p*/
function correctPNG()
{
for(var i=0; i<document.images.length; i++)
{
    var img = document.images[i]
    var imgName = img.src.toUpperCase()
    if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
    {
     var imgID = (img.id) ? "id='" + img.id + "' " : ""
     var imgClass = (img.className) ? "class='" + img.className + "' " : ""
     var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
     var imgStyle = "display:inline-block;" + img.style.cssText 
     if (img.align == "left") imgStyle = "float:left;" + imgStyle
     if (img.align == "right") imgStyle = "float:right;" + imgStyle
     if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle  
     var strNewHTML = "<span " + imgID + imgClass + imgTitle
     + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
    + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
     + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
     img.outerHTML = strNewHTML
     i = i-1
    }
}
}
window.attachEvent("onload", correctPNG);

