// JavaScript Document
function loadIndexCssByCookie(){
	var colorName = alibabaCookie.get("color");
	if(colorName!=null&&colorName!=""){
		loadIndexCss(colorName);
	}else{
		loadIndexCss("orange");
	}
}
function changeImgSrc(name,newImgUrl){
	var imgObj = document.getElementById(name);
	imgObj.src = newImgUrl;
}
function openSelectDiv(name){
	var colorSelectObj = document.getElementById(name);
	colorSelectObj.style.display = "block";
	document.getElementById("top_img_select").src="http://image.bxgtd.com/theme/top_nav_select_arrow_down.gif";
}
function closeSelectDiv(name){
	var colorSelectObj = document.getElementById(name);
	colorSelectObj.style.display = "none";
	document.getElementById("top_img_select").src="http://image.bxgtd.com/theme/top_nav_select_arrow_down.gif";
}
function ColorImg(srcUrl1,srcUrl2,obj,colorName){
	this.src1 = srcUrl1;//uncheckImgUrl
	this.src2 = srcUrl2;//checkImgUrl
	this.obj = obj;//imgObject
	this.colorName = colorName;
}
function ColorBox(){
	this.childs = new Array();
}
	ColorBox.prototype.init = function(colorName){
		for(var i=0;i<this.childs.length;i++){
			if(this.childs[i].colorName==colorName){
				this.childs[i].obj.src = this.childs[i].src2;
			}
		}
	}
	ColorBox.prototype.add = function(srcUrl1,srcUrl2,obj,colorName){
		this.childs[this.childs.length] = new ColorImg(srcUrl1,srcUrl2,obj,colorName);
	}
	ColorBox.prototype.check = function(obj){
		aliclick(this,'?tracelog=ui_chinaindex_070418_colorbox');
		for(var i=0;i<this.childs.length;i++){
			if(this.childs[i].obj!=obj){
				this.childs[i].obj.src = this.childs[i].src1;
			}else{
				this.childs[i].obj.src = this.childs[i].src2;
				alibabaCookie.set("color",this.childs[i].colorName);
			}
		}
	}