var ZZ=0;
var YY=0;
var PP=0;
var url=window.location.pathname;
var aa= url.substring(url.indexOf("/")+0,url.length);
aa=aa.substring(0,aa.indexOf("/")+10);
iop=aa.substring(0,aa.indexOf("/")+3);
if(aa=="/"){ZZ=1;PP=1;}
if(aa=="/case/"){ZZ=2;PP=1;}
if(aa=="/case/cust"){ZZ=2;PP=1;}
if(aa=="/case/desi"){ZZ=2;PP=1;}
if(aa=="/case/plan"){ZZ=2;PP=1;}
if(aa=="/case/site"){ZZ=2;PP=1;}
if(aa=="/case/medi"){ZZ=2;PP=1;}

if(aa=="/services/"){ZZ=3;PP=1;}
if(aa=="/managemen"){ZZ=4;PP=1;}
if(aa=="/quotation"){ZZ=5;PP=1;}
if(aa=="/company/"){ZZ=6;PP=1;}
if(aa=="/company/i"){ZZ=6;PP=1;}
if(aa=="/company/e"){ZZ=6;PP=1;}
if(aa=="/company/C"){ZZ=6;PP=1;}
if(iop!="/en"){PP=1;}

for(i=1; i <7; i++)        
  {
	if (i==ZZ)
    {document.getElementById("T_"+i).style.backgroundImage = "url(/images/s_1_13.gif)";document.getElementById("T_N"+i).style.color = "#F35A22";}
    else  
    {document.getElementById("T_"+i).style.backgroundImage = "url(/images/blank.gif)";}
  }
  
if(PP==1){document.getElementById("nav_1").style.color = "#F35A22";}

function LanguageSwitch(selectedLaguage)
{
	var currentUrl = window.location.href;
	var en = '/en/';
	var http = 'http://';
	var newUrl = '';
	if((currentUrl.indexOf(en) != -1 || currentUrl.indexOf(en.toUpperCase()) != -1) && selectedLaguage == 1)
	{
		newUrl = currentUrl.replace(en, '/');
		newUrl = newUrl.replace(en.toUpperCase(), '/');
		newUrl = newUrl.replace('#', '');
		window.location.href = newUrl;

	}
	else if((currentUrl.indexOf(en) == -1 && currentUrl.indexOf(en.toUpperCase()) == -1) && selectedLaguage == 2)
	{
		newUrl = currentUrl.substring(currentUrl.indexOf(http)+http.length,currentUrl.length);
		newUrl = newUrl.replace('/', en);
		newUrl = http + newUrl.replace('#', '');
		window.location.href = newUrl;
	}
	
}