var disabled=false;

function imgOn(Img)
{
    var newSrc=new String(Img);
	if(!disabled) newSrc=newSrc.replace(".gif", "_f2.gif");

	return newSrc;
}

function imgOff(Img)
{
    var newSrc=new String(Img);
	if(!disabled) newSrc=newSrc.replace("_f2.gif", ".gif");

	return newSrc;
}

var srvTC = '../../';
var srvSC = '../../';
var srvEN = '../../';

function isSC()
{
	return (window.location.href.indexOf(srvSC)==0);
}
function isTC()
{
	return (window.location.href.indexOf(srvTC)==0);
}
function isEN()
{
	return (window.location.href.indexOf(srvEN)==0);
}

function func1()
{
	var BIG5='chi';
	var ENG='eng';
 	var filename=window.location.pathname.substr(window.location.pathname.lastIndexOf('/')+1);

	if (isSC())
        	window.location= srvTC+'eng/'+filename;
	else	
		window.location=(window.location.pathname.indexOf('eng')!=-1)?window.location.pathname.replace(ENG,BIG5):window.location.pathname.replace(BIG5,ENG);

	return false;
}

function func2()
{
	var BIG5='chi';
	var SIM='sim';
 	var filename=window.location.pathname.substr(window.location.pathname.lastIndexOf('/')+1);

	if (isEN())
        	window.location= srvEN+'CHI/'+filename;
	else	
		window.location=(window.location.pathname.indexOf('chi')!=-1)?window.location.pathname.replace(BIG5,SIM):window.location.pathname.replace(SIM,BIG5);

	return false;
}

function func3()
{
	var SIM='sim';
	var ENG='eng';
 	var filename=window.location.pathname.substr(window.location.pathname.lastIndexOf('/')+1);

	if (isTC())
        	window.location= srvSC+'eng/'+filename;
	else	
		window.location=(window.location.pathname.indexOf('eng')!=-1)?window.location.pathname.replace(ENG,SIM):window.location.pathname.replace(SIM,ENG);

	return false;
}

