/*********************************************************
*·ÎÄÉÀÌ¼Ç °ü¸® ½ÃÀÛ  POWERCOMM
*********************************************************/
//////  LOCATION CHECK   ////////
var depth1 = "";
var depth2 = "";
var depth3 = "";
var imgpath = "/images/common/";
var urlpath = "/";
var engurlpath = "/eng/";
//var depth4 = "";

function setDepthVar( firVar, secVar, thrVar ) {
        depth1 = firVar;
        depth2 = secVar;
        depth3 = thrVar;
        //depth4 = fourVar;
}

function locationCheck( depth1, depth2, depth3 ){
       
        var returnPram = ""
        var oneDepthName = new Array();
        var twoDepthName = new Array();
        var threeDepthName = new Array();
        var home = "<a href='"+urlpath+"'>È¨</a>";

        oneDepthName['1'] = "<a href='"+urlpath+"about/default.aspx'>È¸»ç¼Ò°³</a>";
        oneDepthName['2'] = "<a href='"+urlpath+"business/default.aspx'>»ç¾÷¿µ¿ª</a>";
        oneDepthName['3'] = "<a href='"+urlpath+"challenge/default.aspx'>µµÀüÇÏ´Â Ã»´ã</a>";
        oneDepthName['4'] = "<a href='"+urlpath+"career/default.aspx'>ÀÎÀçÃ¤¿ë</a>";
        oneDepthName['5'] = "<a href='"+urlpath+"invest/default.aspx'>ÅõÀÚÁ¤º¸</a>";
        oneDepthName['6'] = "Ã£¾Æ¿À½Ã´Â ±æ";
        oneDepthName['7'] = "»çÀÌÆ®¸Ê";

        returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span></div>";

        if(depth1 =="1"){
                twoDepthName[1] = "<a href='"+urlpath+"about/intro.aspx'>±â¾÷Á¤º¸</a>"; 
                twoDepthName[2] = "´ëÇ¥ÀÌ»ç"; 
                twoDepthName[3] = "¹Ì¼Ç ¹× ºñÀü"; 
                twoDepthName[4] = "<a href='"+urlpath+"about/newslist.aspx'>»çÀÌ¹öÈ«º¸½Ç</a>"; 
                twoDepthName[5] = "CI"; 
                twoDepthName[6] = "Ã£¾Æ¿À½Ã´Â ±æ"; 

                returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span><span class='location'>"+twoDepthName[depth2]+"</span></div>";

        }else if(depth1 =="2"){
                twoDepthName[1] = "ÇÐ¿ø»ç¾÷"; 
                twoDepthName[2] = "ESL ÄÁÅÙÃ÷»ç¾÷"; 
                twoDepthName[3] = "±Û·Î¹ú·¯´× »ç¾÷"; 
                twoDepthName[4] = "°­»ç»ç¾÷"; 
               // twoDepthName[5] = "´º¹Ìµð¾î ÄÁÅÙÃ÷»ç¾÷"; 
                //twoDepthName[6] = "°­»ç»ç¾÷"; 
                //twoDepthName[7] = "°­»ç »ç¾÷"; 

                returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span><span class='location'>"+twoDepthName[depth2]+"</span></div>";

         }else if(depth1 =="3"){
                twoDepthName[1] = "<a href='"+urlpath+"challenge/asia_esl.aspx'>µ¿¾Æ½Ã¾ÆÀû ESL ¹æ¹ý·Ð</a>"; 
                twoDepthName[2] = "¿¬±¸°³¹ß ´É·Â";
                twoDepthName[3] = "±Û·Î¹ú ³×Æ®¿öÅ©";

                returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span><span class='location'>"+twoDepthName[depth2]+"</span></div>";

        }else if(depth1 =="4"){
                twoDepthName[1] = "ÀÎÀç»ó"; 
                twoDepthName[2] = "ÀÎ»çÁ¦µµ"; 
                twoDepthName[3] = "º¹¸®ÈÄ»ý";
                twoDepthName[4] = "Ã¤¿ë¾È³»";
                twoDepthName[5] = "Ã¤¿ë¼Ò½Ä";
                twoDepthName[6] = "Ã¤¿ëQ&A"; 
                
                
                returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span><span class='location'>"+twoDepthName[depth2]+"</span></div>";
        }else if(depth1 =="5"){
                twoDepthName[1] = "ÁÖ°¡Á¤º¸";
                twoDepthName[2] = "°æ¿µÁ¤º¸";
                twoDepthName[3] = "°ø½ÃÁ¤º¸"; 
                twoDepthName[4] = "Àç¹«Á¤º¸";
                twoDepthName[5] = "IR ÀÚ·á½Ç";
                twoDepthName[6] = "È¸»ç°ø°í/°øÁö"; 
                twoDepthName[7] = "FAQ"; 
                twoDepthName[8] = "ÅõÀÚÁ¤º¸ ¹®ÀÇ"; 

                returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span><span class='location'>"+twoDepthName[depth2]+"</span></div>";

        }
        // È¸»ç¼Ò°³ > ±â¾÷Á¤º¸ //
        if((depth1=="1") && (depth2=="1")){
                threeDepthName[1] = "È¸»ç°³¿ä"; 
                threeDepthName[2] = "¿¬Çõ"; 
                threeDepthName[3] = "Á¶Á÷±¸¼º";
                threeDepthName[4] = "°è¿­»çÇöÈ²";

                returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span><span class='location'>"+twoDepthName[depth2]+"</span><span class='location'>"+threeDepthName[depth3]+"</span></div>";

        // È¸»ç¼Ò°³ > »çÀÌ¹öÈ«º¸½Ç //
        }else if((depth1=="1") && (depth2=="4")){
                threeDepthName[1] = "Ã»´ã ´º½º"; 
                threeDepthName[2] = "Ã»´ã Ä®·³"; 

                returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span><span class='location'>"+twoDepthName[depth2]+"</span><span class='location'>"+threeDepthName[depth3]+"</span></div>";

       // µµÀüÇÏ´Â CDI > ¾Æ½Ã¾ÆÀû ESL //
        }else if((depth1=="3") && (depth2=="1")){
                threeDepthName[0] = ""; 
                threeDepthName[1] = "ºê·£µåÆÄ¿ö"; 
                threeDepthName[2] = "°­»ç Ã¤¿ë ¹× ÈÆ·Ã½Ã½ºÅÛ";

                returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span><span class='location'>"+twoDepthName[depth2]+"</span><span class='location'>"+threeDepthName[depth3]+"</span></div>";
        }
        return returnPram ;
}


function locationEngCheck( depth1, depth2, depth3 ){

        var returnPram = ""
        var oneDepthName = new Array();
        var twoDepthName = new Array();
        var threeDepthName = new Array();
        var home = "<a href='"+engurlpath+"'>Home</a>";

        oneDepthName['1'] = "<a href='"+engurlpath+"about/default.aspx'>About CHUNGDAHM</a>";
        oneDepthName['2'] = "<a href='"+engurlpath+"business/default.aspx'>Business Areas</a>";
        oneDepthName['3'] = "<a href='"+engurlpath+"challenge/default.aspx'>Challenges of CHUNGDAHM</a>";
        oneDepthName['4'] = "<a href='"+engurlpath+"career/default.aspx'>Careers</a>";
        oneDepthName['5'] = "<a href='"+engurlpath+"invest/default.aspx'>Investor Relations</a>";
        oneDepthName['6'] = "";
        oneDepthName['7'] = "SiteMap";

        returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span></div>";

        if(depth1 =="1"){
                twoDepthName[1] = "CHUNGDAHM at a Glance"; 
                twoDepthName[2] = "CEO's Greetings"; 
                twoDepthName[3] = "Mission & Vision"; 
                twoDepthName[4] = "PR Center"; 
                twoDepthName[5] = "Corporate Identity";
                twoDepthName[6] = "Contact Us"; 

                returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span><span class='location'>"+twoDepthName[depth2]+"</span></div>";

        }else if(depth1 =="2"){
                twoDepthName[1] = "ESL Learning Center"; 
                twoDepthName[2] = "u-Learning"; 
                twoDepthName[3] = "China Business"; 
                twoDepthName[4] = "New Media Content"; 
                twoDepthName[5] = "Global Learning"; 
                twoDepthName[6] = "ESL Lifestyle"; 
                twoDepthName[7] = "Instructor Recruiting & Training"; 

                returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span><span class='location'>"+twoDepthName[depth2]+"</span></div>";

         }else if(depth1 =="3"){
                twoDepthName[1] = "East Asian ESL Methodology"; 
                twoDepthName[2] = "R & D";
                twoDepthName[3] = "Global Network";

                returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span><span class='location'>"+twoDepthName[depth2]+"</span></div>";

        }else if(depth1 =="4"){
                twoDepthName[1] = "Ideal CHUNGDAHM Person"; 
                twoDepthName[2] = "Application Guide"; 
                twoDepthName[3] = "Online Application"; 

                returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span><span class='location'>"+twoDepthName[depth2]+"</span></div>";
        }else if(depth1 =="5"){
                 twoDepthName[1] = "Stock Information"; 
				twoDepthName[2] = "Corporate Information"; 
                twoDepthName[3] = "Financial Information"; 
                twoDepthName[4] = "IR Library"; 
				twoDepthName[5] = "FAQ"; 
                twoDepthName[6] = "Q&A "; 

                returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span><span class='location'>"+twoDepthName[depth2]+"</span></div>";
        }
        // È¸»ç¼Ò°³ > ±â¾÷Á¤º¸ //
        if((depth1=="1") && (depth2=="1")){
                threeDepthName[1] = "Overview"; 
                threeDepthName[2] = "History"; 
                threeDepthName[3] = "Organization";
                threeDepthName[4] = "Subsidiaries";

                returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span><span class='location'>"+twoDepthName[depth2]+"</span><span class='location'>"+threeDepthName[depth3]+"</span></div>";

        // È¸»ç¼Ò°³ > »çÀÌ¹öÈ«º¸½Ç //
        }else if((depth1=="1") && (depth2=="4")){
                threeDepthName[1] = "CHUNGDAHM News"; 
                threeDepthName[2] = "CHUNGDAHM Column"; 

                returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span><span class='location'>"+twoDepthName[depth2]+"</span><span class='location'>"+threeDepthName[depth3]+"</span></div>";

       // µµÀüÇÏ´Â CDI > ¾Æ½Ã¾ÆÀû ESL //
        }else if((depth1=="3") && (depth2=="1")){
                threeDepthName[0] = ""; 
                threeDepthName[1] = "Brand Recognition"; 
                threeDepthName[2] = "Recruiting & Training System";


          if((depth1 == "3") && (depth2 == "1") && (depth3 == "1") || (depth1 == "3") && (depth2 == "1") && (depth3 == "2")){
                returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span><span class='location'><a href='/eng/challenge/asia_esl.aspx'>"+twoDepthName[depth2]+"</a></span><br><span class='location'>"+threeDepthName[depth3]+"</span></div>";
          }
          else
          {
                returnPram = "<div class='location'>"+home+"<span class='location'>"+oneDepthName[depth1]+"</span><span class='location'>"+twoDepthName[depth2]+"</span><br><span class='location'>"+threeDepthName[depth3]+"</span></div>";
          }
        }
        return returnPram ;
}
///////  VIEW ///////
function currentPage(){

        var zoneFront ="";
        var zoneBack ="";
        zoneFront="";
        zoneBack="";
        
        document.write(zoneFront + locationCheck( depth1, depth2, depth3 ) + zoneBack);
}

function locationPage(depth){

        depth1 = eval(depth.substr(0,2));
        depth2 = eval(depth.substr(2,2));
        depth3 = eval(depth.substr(4,2));
        
        var zoneFront ="";
        var zoneBack ="";
        zoneFront="";
        zoneBack="";
        
        document.write(zoneFront + locationCheck( depth1, depth2, depth3 ) + zoneBack);
}

function locationEngPage(depth){

        depth1 = eval(depth.substr(0,2));
        depth2 = eval(depth.substr(2,2));
        depth3 = eval(depth.substr(4,2));
        
        var zoneFront ="";
        var zoneBack ="";
        zoneFront="";
        zoneBack="";
        
        document.write(zoneFront + locationEngCheck( depth1, depth2, depth3 ) + zoneBack);
}
/*********************************************************
*  ·ÎÄÉÀÌ¼Ç °ü¸® ³¡
*********************************************************/
