// Tab Content
function initTabMenu(tabContainerID) {

	var tabContainer = document.getElementById(tabContainerID);
	var tabAnchor = tabContainer.getElementsByTagName("a");
	var i = 0;

	for(i=0; i<tabAnchor.length; i++) {
		if (tabAnchor.item(i).className == "cate")
			thismenu = tabAnchor.item(i);
		else
			continue;

		thismenu.container = tabContainer;
		thismenu.targetEl = document.getElementById(tabAnchor.item(i).href.split("#")[1]);
		
		thismenu.targetEl.style.display = "none";
		thismenu.imgEl = thismenu.getElementsByTagName("img").item(0);
		if (thismenu.imgEl) {
			thismenu.onmouseover = function () {
				//this.onmouseover();
			}
		}
		thismenu.onmouseover = tabMenuClick;
		
		if (!thismenu.container.first)
			thismenu.container.first = thismenu;
	}
	tabContainer.first.onmouseover();
}
function tabMenuClick() {
	currentmenu = this.container.current;
	if (currentmenu != this) {
		if (currentmenu) {
			currentmenu.targetEl.style.display = "none";
			if (currentmenu.imgEl) {
				currentmenu.imgEl.src = currentmenu.imgEl.src.replace("_over.gif", ".gif");
			} else {
				currentmenu.className = currentmenu.className.replace(" on", "");
			}
		}

		this.targetEl.style.display = "block";
		if (this.imgEl) {
			this.imgEl.src = this.imgEl.src.replace(".gif", "_over.gif");
		} else {
			this.className += " on";
		}
		this.container.current = this;
	}
	return false;
}

function goCate(cateCode, gg){
	if(gg == 'B'){
		var url ='/servlet/common/InvilServlet?module=bigCateProd&action=list&big_code='+cateCode;
	}else if(gg == 'S'){
		var url ='/servlet/common/InvilServlet?module=smalCateProd&action=list&cate_code='+cateCode;
	}		
document.location.href = url;
}


function go_QualityDetail(prod_code){
	url = '/servlet/common/InvilServlet?module=productdetail&action=view'
		+'&productCode='+prod_code
		+'&shop_code=1010'
	document.location.href = url;
}

function showLayerBest1(no){
		if(no == 1){
			document.getElementById("innerTable1_1").style.display = 'block';
			document.getElementById("innerTable1_2").style.display = 'none';
		}
		if(no == 2){
			document.getElementById("innerTable1_1").style.display = 'none';
			document.getElementById("innerTable1_2").style.display = 'block';
		}
}

function showLayerBest2(no){
		if(no == 1){
			document.getElementById("innerTable2_1").style.display = 'block';
			document.getElementById("innerTable2_2").style.display = 'none';
		}
		if(no == 2){
			document.getElementById("innerTable2_1").style.display = 'none';
			document.getElementById("innerTable2_2").style.display = 'block';
		}
}

function showLayerBest3(no){
		if(no == 1){
			document.getElementById("innerTable3_1").style.display = 'block';
			document.getElementById("innerTable3_2").style.display = 'none';
		}
		if(no == 2){
			document.getElementById("innerTable3_1").style.display = 'none';
			document.getElementById("innerTable3_2").style.display = 'block';
		}
}



 function TClickLayerbest(n){
    for(var i = 1; i <= 3 ; i++) {
      obj = document.getElementById('Ttabbest'+i);
      a = document.getElementById('Tbest'+i);
      if ( n == i ) {
        temp = n;
        obj.style.display = "block";
        a.className = "best_select";
      } else {
        obj.style.display = "none";
        a.className = "best_no_select";
      }
    }
  }

 function TClickLayereco(n){
    for(var i = 1; i <= 3 ; i++) {
      obj = document.getElementById('Ttabeco'+i);
      a = document.getElementById('Teco'+i);
      if ( n == i ) {
        temp = n;
        obj.style.display = "block";
        a.className = "eco_select";
      } else {
        obj.style.display = "none";
        a.className = "eco_no_select";
      }
    }
  }


