// Language directory
var chi_path= "/tc_chi/"
var eng_path= "/english/"
var sim_path= "/sc_chi/"


/*
Check if the simplified Chinese version, the update the alt tag value by calling the button.js
*/
if (location.href.toString().search('/sc_chi/') != -1) {
	atgb = true;
} else {
	atgb = false;
}

function chglang(lang){

	org_path=window.location.href;
	des_path="";

	if (isSim()) {
		if (lang == 'tc') {
			des_path = org_path.replace(sim_path,chi_path);
		}	
		if (lang == 'en') {
			des_path = org_path.replace(sim_path,eng_path);
		}	
	}

	if (isChi()) {
		if (lang == 'sc') {
			des_path = org_path.replace(chi_path,sim_path);
		}	
		if (lang == 'en') {
			des_path = org_path.replace(chi_path,eng_path);
		}	
	}

	if (isEng()) {
		if (lang == 'tc') {
			des_path = org_path.replace(eng_path,chi_path);
		}	
		if (lang == 'sc') {
			des_path = org_path.replace(eng_path,sim_path);
		}	
	}

	window.location.href = des_path;
}

function isEng() {
	return (location.href.toString().indexOf(eng_path) != -1) ? true : false;
}

function isChi() {
	return (location.href.toString().indexOf(chi_path) != -1) ? true : false;
}

function isSim() {
	return (location.href.toString().indexOf(sim_path) != -1) ? true : false;
}


function leftmenu(){

document.writeln("              <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> ");
document.writeln("                <tr>  ");
document.writeln("                  <td valign=\"top\"><a href=\"../../english/press/press.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('sidebtn01','','../../english/images/general/side_over_01.gif',1)\"><img name=\"sidebtn01\" border=\"0\" src=\"../../english/images/general/side_01.gif\" alt=\"Press Releases and Speeches\"></a></td> ");
document.writeln("                </tr> ");
document.writeln("                <tr>  ");
document.writeln("                  <td valign=\"top\"><a href=\"http://www.info.gov.hk/eac/en/legco/2004_notices.htm\" target=\"_blank\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('sidebtn11','','../../english/images/general/side_over_11.gif',1)\"><img name=\"sidebtn11\" border=\"0\" src=\"../../english/images/general/side_11.gif\" alt=\"Notices\"></a></td> ");
document.writeln("                </tr> ");
document.writeln("                <tr>  ");
document.writeln("                  <td valign=\"top\"><a href=\"../../english/facts/facts.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('sidebtn02','','../../english/images/general/side_over_02.gif',1)\"><img name=\"sidebtn02\" border=\"0\" src=\"../../english/images/general/side_02.gif\" alt=\"Facts about Election\"></a></td> ");
document.writeln("                </tr> ");
document.writeln("                <tr>  ");
document.writeln("                  <td valign=\"top\"><a href=\"../../english/ebm/ebm.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('sidebtn03','','../../english/images/general/side_over_03.gif',1)\"><img name=\"sidebtn03\" border=\"0\" src=\"../../english/images/general/side_03.gif\" alt=\"Electoral Boundary Maps\"></a></td> ");
document.writeln("                </tr> ");
document.writeln("                <tr>  ");
document.writeln("                  <td valign=\"top\"><a href=\"../../english/gui/gui.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('sidebtn04','','../../english/images/general/side_over_04.gif',1)\"><img name=\"sidebtn04\" border=\"0\" src=\"../../english/images/general/side_04.gif\" alt=\"Guidelines on Election-Related Activities\"></a></td> ");
document.writeln("                </tr> ");
document.writeln("                <tr>  ");
document.writeln("                  <td valign=\"top\"><a href=\"../../english/pub/pub.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('sidebtn05','','../../english/images/general/side_over_05.gif',1)\"><img name=\"sidebtn05\" border=\"0\" src=\"../../english/images/general/side_05.gif\" alt=\"Publicity Materials\"></a></td> ");
document.writeln("                </tr> ");
document.writeln("                <tr>  ");
document.writeln("                  <td valign=\"top\"><a href=\"../../english/forms/forms.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('sidebtn06','','../../english/images/general/side_over_06.gif',1)\"><img name=\"sidebtn06\" border=\"0\" src=\"../../english/images/general/side_06.gif\" alt=\"Forms\"></a></td> ");
document.writeln("                </tr> ");
document.writeln("                <tr>  ");
document.writeln("                  <td valign=\"top\"><a href=\"../../english/nom/nom.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('sidebtn07','','../../english/images/general/side_over_07.gif',1)\"><img name=\"sidebtn07\" border=\"0\" src=\"../../english/images/general/side_07.gif\" alt=\"Nomination of Candidates\"></a></td> ");
document.writeln("                </tr> ");
document.writeln("                <tr>  ");
document.writeln("                  <td valign=\"top\"><a href=\"../../english/links/links.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('sidebtn08','','../../english/images/general/side_over_08.gif',1)\"><img name=\"sidebtn08\" border=\"0\" src=\"../../english/images/general/side_08.gif\" alt=\"Links\"></a></td> ");
document.writeln("                </tr> ");
document.writeln("                <tr>  ");
document.writeln("                  <td valign=\"top\"><img src=\"../../english/images/general/side_09.gif\"></td> ");
document.writeln("                </tr> ");

document.writeln("                    <tr>  ");
document.writeln("                      <td valign=\"top\"><img src=\"../../english/images/general/side_box_9_11_01.gif\"></td> ");
document.writeln("                    </tr> ");
document.writeln("                    <tr>  ");
document.writeln("                      <td valign=\"top\"><a href=\"../../english/turnout/tt_gc_overall.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('sidebox02','','../../english/images/general/side_box_9_11_over_02.gif',1)\"><img name=\"sidebox02\" border=\"0\" src=\"../../english/images/general/side_box_9_11_02.gif\" alt=\"Turnout Rate\"></a></td> ");
document.writeln("                    </tr> ");
document.writeln("                    <tr>  ");
document.writeln("                      <td valign=\"top\"><a href=\"../../english/results/rs_gc.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('sidebox03','','../../english/images/general/side_box_9_11_over_03.gif',1)\"><img name=\"sidebox03\" border=\"0\" src=\"../../english/images/general/side_box_9_11_03.gif\" alt=\"Election Results\"></a></td> ");
document.writeln("                    </tr> ");
document.writeln("                    <tr>  ");
document.writeln("                        <td valign=\"top\"><a href=\"../../english/platforms/platforms.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('sidebox04','','../../english/images/general/side_box_9_11_over_04.gif',1)\"><img name=\"sidebox04\" border=\"0\" src=\"../../english/images/general/side_box_9_11_04.gif\" alt=\"Introduction to Candidates\"></a></td> ");
document.writeln("                    </tr> ");
document.writeln("                    <tr> ");
document.writeln("                        <td valign=\"top\"><a href=\"../../english/counting/counting.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('sidebox05','','../../english/images/general/side_box_9_11_over_05.gif',1)\"><img name=\"sidebox05\" border=\"0\" src=\"../../english/images/general/side_box_9_11_05.gif\" alt=\"Polling and Counting Stations\"></a></td> ");
document.writeln("                    </tr> ");
document.writeln("                    <tr> ");
document.writeln("                        <td valign=\"top\"><a href=\"../../english/counting/exit.html\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('sidebox06','','../../english/images/general/side_box_9_11_over_06.gif',1)\"><img name=\"sidebox06\" border=\"0\" src=\"../../english/images/general/side_box_9_11_06.gif\" alt=\"Exit Poll\"></a></td> ");
document.writeln("                    </tr> ");

document.writeln("              </table> ");

}

