//if (document.referrer.indexOf("tw.search.yahoo.com")>0){
//	setTimeout("open('/');",3000);
//	location = "/";
//}
customerContent = {
	object   : document.getElementById("customercontent"),
	button   : document.getElementById("customerbutton"),
	length   : 12,
	group    : null,
	curr     : 0,
	over     : false,
	emptyval : null,
	objectL  : null,
	init     : function(){
		this.object.onmouseover = function(){customerContent.over = true;};
		this.object.onmouseout  = function(){customerContent.over = false;};
		this.emptyval           = this.empty();
		this.objectL = this.object.children.length;
		var mackup = new Array("<div>&nbsp;</div>","<div class=\"cb2\">&nbsp;</div>");
		this.button.innerHTML = "";
		//¤À²Õ
		if (this.object.children.length % this.length == 0) {
			this.group = new Array(this.object.children.length / this.length);
		}else{
			this.group = new Array(parseInt(this.object.children.length / this.length)+1);
		}
		//this.button.innerHTML = "¦@" + this.object.children.length + "®a";
		for (var i = 0 ; i < this.group.length ; i++){
			this.group[i] = new Array(this.length);
			
			for (var j = 0 ; j < this.length ; j++){
				if ((i * this.length + j) < this.object.children.length){
					this.group[i][j] = this.object.children[(i * this.length + j)].outerHTML;
				}else{
					this.group[i][j] = mackup[(i * this.length + j)%2];
				}
			}
			this.createB(i);
		}
		this.lightenB(this.curr);
	},
	play     : function(i){
		this.curr = i;
		this.object.innerHTML = this.emptyval;
		setTimeout("customerContent.object.innerHTML = customerContent.groupVal(customerContent.curr);",200);
		this.lightenB(i);
	},
	createB  : function(i){
		this.button.innerHTML += "<label onclick=\"customerContent.play(" + i + ")\">" + (i+1) + "</label>";
	},
	lightenB : function(i){
		for (var n = 0 ; n < this.button.children.length ; n++){
			if (n == i){
				this.button.children[n].className = "ligth";
			}else{
				this.button.children[n].className = "";
			}
		}
	},
	runplay  : function(){
		if (this.over == false){
			if (this.curr == null){
				this.curr = 0;
			}else{
				if (this.curr < this.group.length-1){
					this.curr ++;
				}else{
					this.curr = 0;
				}
			}
			this.play(this.curr);
		}
	},
	groupVal : function(i){
		var val = "";
		for (var n = 0 ; n < this.length ; n++){
			val += this.group[i][n];
		}
		return val;
	},
	empty   : function(){
		var mackup = new Array("<div>&nbsp;</div>","<div class=\"cb2\">&nbsp;</div>");
		var val = "";
		for (var n = 0 ; n < this.length ; n++){
			val += mackup[n%2]; 
		}
		return val;
	}
}
customerContent.init();
setInterval("customerContent.runplay()",5000);