
var BaseDIR=document.location.href;
	
for (;DIRLevel>=0; DIRLevel--)
	{
		BaseDIR=BaseDIR.substring(0,BaseDIR.lastIndexOf("/"));
	}

//BaseDIR="http://www.pepa.com.hk";

function openCopyright()
{
	window.open(BaseDIR+"/mainpage/copyright.html","copyright", "width=500, toolbar=no, location=no, status=no, menubar=no, height=300");
}

function img_on(imgName)
{	
	imgName="menu"+imgName+"c";
	Filename=BaseDIR+"/images/"+imgName+"_on.gif";	
	document[imgName].src=Filename;
}

function img_off(imgName)
{	
	imgName="menu"+imgName+"c";
	Filename=BaseDIR+"/images/"+imgName+".gif";
	document[imgName].src=Filename;

}


function QuickSearch()
{
	if (document.Qsearch.keyword.value!="")
	{
		document.Qsearch.submit();
	}
}


function getThisFilename()
{
	var Filename=document.location.href;
	Filename=Filename.substring(Filename.lastIndexOf("/")+1,Filename.length);
	document.write(Filename);
	
}

function switchLanguage(MultiLanguage)
{
	switch (MultiLanguage)
	{
		case 1:
			window.alert ("Sorry, there is only Chinese version available for this page.");
			break;

		case 2:
			window.alert ("Sorry, there is only English version available for this page.");
			break;
	
		case 3:	
			var NewLocation=document.location.href;
			var DotOffset=NewLocation.lastIndexOf(".")-1;
		
			if (NewLocation.charAt(DotOffset)=="c")
				{
					NewLocation=NewLocation.substring(0, DotOffset) + 'e' + NewLocation.substring(DotOffset+1, NewLocation.length);
				}
			else if (NewLocation.charAt(DotOffset)=="e")
				{
					NewLocation=NewLocation.substring(0, DotOffset) + 'c' + NewLocation.substring(DotOffset+1, NewLocation.length);
				}			
			document.location.href=NewLocation;
			break;
	}
}

