// JavaScript Document
function AlterElementById(ElementId){
	var obj = document.getElementById(ElementId);
	if(obj.style.visibility == "hidden"){
		obj.style.visibility = "visible";
	}
	else{
		obj.style.visibility = "hidden";
	}
}

function ShowElementById(ElementId){
	var obj = document.getElementById(ElementId);
	obj.style.display="block";
}

function HideElementById(ElementId){
	var obj = document.getElementById(ElementId);
	obj.style.display="none";
}

function InsertFlash(src,width,height){
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"" + width + "\" height=\"" + height + "\">");
	document.write("<param name=\"movie\" value=\"" + src + "\" />");
	document.write("<param name=\"quality\" value=\"high\" />");
	document.write("<param name=\"wmode\" value=\"transparent\" />");
	document.write("<embed wmode=\"transparent\" src=\"" + src + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + width + "\" height=\"" + height + "\"></embed>");
	document.write("</object>");
}

// 元素交替背景色
// ContainerId	容器ID
// AlterTag		要交替的元素
// NormalColor	正常背景色
// AlterColor	交替背景色
// HoverColor	鼠标指向的背景色（为空时不改变）
function AlternateBackColor(ContainerId,AlterTag,NormalColor,AlterColor,HoverColor){
	var Container = document.getElementById(ContainerId);
	var AlterElements = Container.getElementsByTagName(AlterTag);
	var CurColor;
	for(var i=0; i<AlterElements.length; i++){
		AlterElements[i].style.background = i%2==0?NormalColor:AlterColor;
		if(HoverColor.length>3){
			AlterElements[i].onmouseover = function(){this.style.background = HoverColor;}
			if(i%2==0){
				AlterElements[i].onmouseout = function(){this.style.background = NormalColor;}
			}else{
				AlterElements[i].onmouseout = function(){this.style.background = AlterColor;}
			}
		}
	}
}