/*  location */

var depth1 = "";
var depth2 = "";
var depth3 = "";
var depth4 = "";
var depth5 = "";
var urlpath = "/global/business/semiconductor";

function setDepthVar( firVar, secVar, thrVar, fouVar, fivVar ) {
        depth1 = firVar;
        depth2 = secVar;
        depth3 = thrVar;
		depth4 = fouVar;
		depth5 = fivVar;
}

function locationCheck( depth1, depth2, depth3, depth4 , depth5  ){

        var returnPram = "";
        var oneDepthName = new Array();
        var twoDepthName = new Array();
        var threeDepthName = new Array();
		var fourDepthName = new Array();
		var fiveDepthName = new Array();
        var home = "<a href='"+urlpath+"/'>home</a>";

		// 1 depth
        oneDepthName[1] = "<a href='"+urlpath+"/products/Products.html'>products</a>";
		oneDepthName[2] = "<a href='"+urlpath+"/support/support.html'>support</a>";
		oneDepthName[3] = "<a href='"+urlpath+"/aboutus/ESH/ESH.html'>eco samsung</a>";
		oneDepthName[4] = "<a href='"+urlpath+"/templet'>news</a>";
		oneDepthName[5] = "<a href='"+urlpath+"/aboutus/AboutUs.html'>about us</a>";

		oneDepthName[10] = "product search";

			//etc 1DEPTH
			oneDepthName[500] = "<strong>about us</strong>";
			oneDepthName[1200] = "<strong>privacy</strong>";
			oneDepthName[1300] = "<strong>legal</strong>";
			oneDepthName[1400] = "<strong>sitemap</strong>";

        returnPram = home+" &gt; "+oneDepthName[depth1];

        // 2 dapth
		if(depth1 =="1"){ // product
				twoDepthName[1] = "<a href='"+urlpath+"/products/dram/Products_DRAM.html'>DRAM</a>";
                twoDepthName[2] = "<a href='"+urlpath+"/products/flash/Products_Flash.html'>Flash</a>";
				twoDepthName[3] = "<a href='"+urlpath+"/products/fusionmemory/Products_FusionMemory.html'>Fusion Memory</a>";
				twoDepthName[4] = "<a href='"+urlpath+"/products/sram/Products_HighSpeedSRAM.html'>SRAM</a>";

				returnPram = home+" &gt; "+oneDepthName[depth1]+" &gt; "+twoDepthName[depth2];

		}else if(depth1 =="2"){ // support
                twoDepthName[4] = "<a href='"+urlpath+"/support/qualitymanagement/support_QualityManagement.html'>quality management</a>";

				returnPram = home+" &gt; "+oneDepthName[depth1]+" &gt; "+twoDepthName[depth2];

		}else if(depth1 =="10"){ // product search
                twoDepthName[1] = "<strong>parametric search</strong>";

				returnPram = home+" &gt; "+oneDepthName[depth1]+" &gt; "+twoDepthName[depth2];

		}


       // 3 dapth
	   if((depth1=="1") && (depth2=="1")){
                threeDepthName[11] = "<strong>DRAM application note</strong>";

                returnPram = home+" &gt; "+oneDepthName[depth1]+" &gt; "+twoDepthName[depth2]+" &gt; "+threeDepthName[depth3];

        }else if((depth1=="1") && (depth2=="2")){
                threeDepthName[4] = "<a href='"+urlpath+"/products/flash/Products_MMC.html'>MMC</a>";
				threeDepthName[6] = "<strong>Flash application note</strong></a>";

                returnPram = home+" &gt; "+oneDepthName[depth1]+" &gt; "+twoDepthName[depth2]+" &gt; "+threeDepthName[depth3];

        }else if((depth1=="2") && (depth2=="3")){
                threeDepthName[6] = "<strong>Fusion Memory application note</strong>";

                returnPram = home+" &gt; "+oneDepthName[depth1]+" &gt; "+twoDepthName[depth2]+" &gt; "+threeDepthName[depth3];

        }else if((depth1=="2") && (depth2=="4")){
                threeDepthName[1] = "<strong>quality management (TL9000)</strong>";
				threeDepthName[2] = "<strong>SRAM application note</strong>";

                returnPram = home+" &gt; "+oneDepthName[depth1]+" &gt; "+twoDepthName[depth2]+" &gt; "+threeDepthName[depth3];

        }

		// 4 dapth
		if((depth1=="1") && (depth2=="2") && (depth3=="4")){
                fourDepthName[1] = "<strong>normal MMC</strong>";

                returnPram = home+" &gt; "+oneDepthName[depth1]+" &gt; "+twoDepthName[depth2]+" &gt; "+threeDepthName[depth3]+" &gt; "+fourDepthName[depth4];

		}

		// 5 dapth
		if((depth1=="0") && (depth2=="0") && (depth3=="0") && (depth4=="0")){
                fiveDepthName[0] = "";

                returnPram = home+" &gt; "+oneDepthName[depth1]+" &gt; "+twoDepthName[depth2]+" &gt; "+threeDepthName[depth3]+" &gt; "+fourDepthName[depth4]+" &gt; "+fiveDepthName[depth5];;

        }

        return returnPram ;
}

// VIEW
function pathindicator(){

        var zoneFront ="";
        var zoneBack ="";
        zoneFront="";
        zoneBack="";

        document.write(zoneFront + locationCheck( depth1, depth2, depth3, depth4, depth5 ) + zoneBack);
}


/**faq togle**/
function initfaqToggle(tabContainer) {
	triggers = tabContainer.getElementsByTagName("a");
	for(i = 0; i < triggers.length; i++) {
					var xxx = triggers.item(i).href.split("#");
					if(xxx.length > 1){
						triggers.item(i).targetEl = document.getElementById(triggers.item(i).href.split("#")[1]);
						if (!triggers.item(i).targetEl)
							continue;

						triggers.item(i).targetEl.style.display = "none";
								triggers.item(i).onclick = function () {
									if (tabContainer.current == this) {
										this.targetEl.style.display = "none";
										tabContainer.current = null;
									} else {
										if (tabContainer.current) {
											tabContainer.current.targetEl.style.display = "none";
										}
										this.targetEl.style.display = "block";
										tabContainer.current = this;
									}
									return false;
								}
					}
	}
}

