// JavaScript Document

function lang1()
   {
     if (window.location.pathname.indexOf("/eng/") != -1)
     {   
		 window.location.replace(location.pathname.replace("/eng/","/cht/"));
     }
     else if (window.location.pathname.indexOf("/cht/") != -1)
     {   
		 window.location.replace(location.pathname.replace("/cht/","/eng/"));     
      }
     else if (window.location.pathname.indexOf("\\eng\\") != -1)
     {  
     	window.location.replace(location.pathname.replace("\\eng\\","\\cht\\"));     
      }
     else if (window.location.pathname.indexOf("\\cht\\") != -1)
     {   
         window.location.replace(location.pathname.replace("\\cht\\","\\eng\\"));     
      }
   }

   function lang2()
   {
     if (location.pathname.indexOf("/eng/") != -1)
     {   location.replace(location.pathname.replace("/eng/","/chs/"));
     }
     else if (location.pathname.indexOf("/chs/") != -1)
     {   location.replace(location.pathname.replace("/chs/","/eng/"));     
      }
     else if (location.pathname.indexOf("\\eng\\") != -1)
     {  
     	location.replace(location.pathname.replace("\\eng\\","\\chs\\"));     
      }
     else if (location.pathname.indexOf("\\chs\\") != -1)
     {   
         location.replace(location.pathname.replace("\\chs\\","\\eng\\"));     
      }
   }

   function lang3()
   {
     if (location.pathname.indexOf("/cht/") != -1)
     {  location.replace(location.pathname.replace("/cht/","/chs/"));
     }
	 
     else if (top.location.pathname.indexOf("/chs/") != -1)
     {   location.replace(location.pathname.replace("/chs/","/cht/"));     
      }
	  
     else if (location.pathname.indexOf("\\cht\\") != -1)
     {  
     	location.replace(location.pathname.replace("\\cht\\","\\chs\\"));     
      }
	  
     else if (location.pathname.indexOf("\\chs\\") != -1)
     {   
         location.replace(location.pathname.replace("\\chs\\","\\cht\\"));     
      }
   }