// JavaScript Document
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
 window.open(theURL,winName,features);
}

function getLangTarget(lang)
{
	if (lang == "en")
	{
		s = new String(document.URL);
		s = s.replace("/tc/","/en/");
		s = s.replace("_c", "_e");
	}
	else 
	{
		s = new String(location.href);
		s = s.replace("/tc/","/sc/");
	}

	return s;
}

function changeLangSetting_Main(num)
{	
	imgLoc = "chiimages";

//top banner
	mainbar1_link = "http://www.gov.hk/tc/residents/";
	brandCIIF_alt = "社區投資共享基金";
	brandHK_alt = "香港品牌形象";
	brand_link = "http://www.brandhk.gov.hk/brandhk/index.htm";
	mainbar1_w = "170";
	mainbar1_h = "19";
	mainbar1_alt = "政府資訊中心";
	mainbar3_alt = "簡體版";
	mainbar3_link = getLangTarget("sc", num);
	mainbar4_alt = "English";
	mainbar4_link = getLangTarget("en", num);
	mainbar6_alt = "搜尋";
	mainbar8_alt = mainbar6_alt;
	mainbar9_alt = "網頁指南";
	mainbar10_alt = "聯絡我們";
	sitemap_link = "/sitemap/index_c.html";
	contactus_link = "../contactus/index_c.html";
				
				
}


function loadTopBanner(num)
{				
	changeLangSetting_Main(num);
<!-- header_e start -->
	document.write("<table width=\"760\" height=\"87\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" background=\"../"+imgLoc+"/bkgdtexture.gif\" >");
	document.write("<tr align=\"left\" valign=\"top\">");
	document.write("<td height=\"66\" colspan=\"6\" class=\"sidebar\" background=\"../"+imgLoc+"/bkgdtexture.gif\"><a href=\"../../index.htm\"><img src=\"../"+imgLoc+"/branding.gif\" alt=\""+brandCIIF_alt+"\" width=\"484\" height=\"65\" border=\"0\"></a></td>");
	document.write("<td height=\"66\" width=\"106\" rowspan=\"2\" valign=\"bottom\" background=\"../"+imgLoc+"/bkgdtexture.gif\" >"); 
	document.write("<div align=\"center\">");
	document.write("<input class=\"search\" type=\"text\" name=\"query\" size=\"10\">");
	document.write("</div>");
	document.write("</td>");
	document.write("<td height=\"66\" background=\"../"+imgLoc+"/bkgdtexture.gif\" width=\"22\">&nbsp;</td>");
	document.write("<td height=\"66\" background=\"../"+imgLoc+"/bkgdtexture.gif\" width=\"97\" colspan=\"2\" valign=\"bottom\" > ");
	document.write("<div align=\"right\"><a href="+brand_link+" target=\"_top\"><img name=\"BrandHK\" src=\"../"+imgLoc+"/brandhk.gif\" width=\"190\" height=\"60\" border=\"0\" alt="+brandHK_alt+"></a></div>");
	document.write("</td>");  
	document.write("</tr>");	
	document.write("<tr align=\"left\" valign=\"top\"> ");
	document.write("<td height=\"19\" width=\"170\" background=\"../"+imgLoc+"/bkgdtexture.gif\"><a href=\""+mainbar1_link+"\" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar1','','../"+imgLoc+"/mainbar1_f2.gif',1)\" ><img name=\"mainbar1\" src=\"../"+imgLoc+"/mainbar1.gif\" width=\"170\" height=\"19\" border=\"0\" alt=\""+mainbar1_alt+"\"></a></td>");
	document.write("<td align=\"left\" valign=\"top\" height=\"19\" width=\"49\"><a href="+mainbar3_link+" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar3','','../"+imgLoc+"/mainbar3_f2.gif',1)\" ><img name=\"mainbar3\" src=\"../"+imgLoc+"/mainbar3.gif\" width=\"49\" height=\"19\" border=\"0\" alt="+mainbar3_alt+"></a></td>");
	document.write("<td align=\"left\" valign=\"top\" height=\"19\" width=\"56\"><a href="+mainbar4_link+" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar4','','../"+imgLoc+"/mainbar4_f2.gif',1)\" ><img name=\"mainbar4\" src=\"../"+imgLoc+"/mainbar4.gif\" width=\"56\" height=\"19\" border=\"0\" alt="+mainbar4_alt+"></a></td>");
	document.write("<td height=\"19\" width=\"185\" background=\"../"+imgLoc+"/bkgdtexture.gif\"><a href=\"#\" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar5','','../"+imgLoc+"/mainbar5_f2.gif',1)\" ><img name=\"mainbar5\" src=\"../chiimages/mainbar5.gif\" width=\"165\" height=\"19\" border=\"0\"></a></td>");
	document.write("<td height=\"19\" width=\"77\" background=\"../"+imgLoc+"/bkgdtexture.gif\"></td>");
	document.write("<td height=\"19\" width=\"36\" background=\"../"+imgLoc+"/bkgdtexture.gif\"><a onmouseover=\"MM_swapImage('mainbar6','','../"+imgLoc+"/mainbar6_f2.gif',1)\" onmouseout=MM_swapImgRestore() href=\"javascript:document.forms[0].submit()\"><img name=\"mainbar6\" src=\"../"+imgLoc+"/mainbar6.gif\" width=\"36\" height=\"19\" border=\"0\" alt="+mainbar6_alt+"></a></td>");
	document.write("<td height=\"19\" width=\"22\" background=\"../"+imgLoc+"/bkgdtexture.gif\"><a onmouseover=\"MM_swapImage('mainbar8','','../"+imgLoc+"/mainbar8_f2.gif',1)\" onmouseout=MM_swapImgRestore() href=\"javascript:document.forms[0].submit()\"><img name=\"mainbar8\" src=\"../"+imgLoc+"/mainbar8.gif\" width=\"22\" height=\"19\" border=\"0\" alt="+mainbar8_alt+" align=\"bottom\"></a></td>");
	document.write("<td height=\"19\" width=\"67\" background=\"../"+imgLoc+"/bkgdtexture.gif\"><a href="+sitemap_link+" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar9','','../"+imgLoc+"/mainbar9_f2.gif',1)\" ><img name=\"mainbar9\" src=\"../"+imgLoc+"/mainbar9.gif\" width=\"67\" height=\"19\" border=\"0\" alt="+mainbar9_alt+"></a></td>");
	document.write("<td height=\"19\" width=\"29\" background=\"../"+imgLoc+"/bkgdtexture.gif\"><a href="+contactus_link+" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar10','','../"+imgLoc+"/mainbar10_f2.gif',1)\" ><img name=\"mainbar10\" src=\"../"+imgLoc+"/mainbar10.gif\" width=\"29\" height=\"19\" border=\"0\" alt="+mainbar10_alt+"></a></td>");
	document.write("</tr>");
	document.write("<tr align=\"left\" valign=\"top\" bgcolor=\"#BB3333\"> ");
	document.write("<td height=\"2\" colspan=\"10\"><img src=\"../"+imgLoc+"/reddot.gif\" width=\"760\" height=\"2\"></td>");
	document.write("</tr>");	
	document.write("</table>");
		  
<!-- header_e end -->

}

function loadSideBarImg(itemNo)
{
	sidebar_name = new Array(itemNo);
	sidebar_img = new Array(itemNo);
	sidebar_onmousefocus_img = new Array(itemNo);
	sidebar_onmouseout_img = new Array(itemNo);
	sidebar_alt = new Array(itemNo);
	sidebar_link = new Array(itemNo);

//side bar				
	sidebar_alt[1] = "基金頁主頁";
	sidebar_link[1] = "../../index.htm" ;	
	sidebar_alt[2] = "主席的話";
	sidebar_link[2] = "../msgfromchair/index_c.html"
	sidebar_alt[3] = "有關社區投資共享基金";
	sidebar_link[3] = "../aboutciif/index_c.html"
	sidebar_alt[4] = "目標及資助範圍";
	sidebar_link[4] = "../objectives/index_c.html"
	sidebar_alt[5] = "組織架構";
	sidebar_link[5] = "../orgstructure/index_c.html"
	sidebar_alt[6] = "申請辦法";
	sidebar_link[6] = "../howtoapply/index_c.html"
	sidebar_alt[7] = "公用表格及指引";
	sidebar_link[7] = "../publicforms/index_c.html"
	sidebar_alt[8] = "社會資本摰友";
	sidebar_link[8] = "../scnet/index_c.html"
	sidebar_alt[9] = "基金宣傳資料";
	sidebar_link[9] = "../promoinfo/index_c.html"
	sidebar_alt[10] = "獲撥款計劃資料";
	sidebar_link[10] = "../appproj/index_c.html"
	sidebar_alt[11] = "推廣及公開活動";
	sidebar_link[11] = "../promotion/index_c.html"
	sidebar_alt[12] = "最新消息";
	sidebar_link[12] = "../whatsnew/index_c.html"
	sidebar_alt[13] = "演詞及新聞稿";
	sidebar_link[13] = "../speech/index_c.html"
	sidebar_alt[14] = "立法會事務及委員會文件";
	sidebar_link[14] = "../legco/index_c.html"
	sidebar_alt[15] = "社會資本參考資料庫";
	sidebar_link[15] = "../resourcedir/index_c.html"
	sidebar_alt[16] = "聯校研究及評估";
	sidebar_link[16] = "../evaluation/index_c.html"
	sidebar_alt[17] = "提問摘錄";
	sidebar_link[17] = "../faqs/index_c.html"
	sidebar_alt[18] = "聯絡我們";				
	sidebar_link[18] = "../contactus/index_c.html"

	for (i = 1; i <= itemNo; i++)
	{
		sidebar_name[i] = "sidebar"+i;
		sidebar_img[i] = "sidebar"+i+".gif";
		sidebar_onmousefocus_img[i] = "sidebar"+i+"_f2.gif";
		sidebar_onmouseout_img[i] = "sidebar"+i+"_o2.gif";
	}
}

function loadSideIcon()
{		
	iconNo = 6;

	icon_link = new Array(iconNo+1);
	icon_img = new Array(iconNo+1);
	icon_alt = new Array(iconNo+1);
	icon_width = new Array(iconNo+1);
	icon_height = new Array(iconNo+1);

	icon_link[1] = "http://www.tela.gov.hk/icrs/index2.html";
	icon_img[1] = "../chiimages/icrs_banner_chi.gif";
	icon_alt[1] = "ICRS計劃-此網站支持保護兒童網上安全";
	icon_width[1] = "150";
	icon_height[1] = "65";

	icon_link[2] = "http://www.gov.hk/tc/residents/communication/publicit/itfacilities/wifi/index.htm";
	icon_img[2] = "../chiimages/GovWiFi_icon.gif";
	icon_alt[2] = "「香港政府WiFi通」計劃";
	icon_width[2] = "84";
	icon_height[2] = "50";

	icon_link[3] = "http://www.heritage.gov.hk/tc/index.htm";
	icon_img[3] = "../chiimages/heritage_tc.gif";
	icon_alt[3] = "文物保育網站";			
	icon_width[3] = "84";
	icon_height[3] = "50";

	icon_link[4] = "http://www.voterregistration.gov.hk ";
	icon_img[4] = "../chiimages/2008voter.gif";
	icon_alt[4] = "選民登記";			
	icon_width[4] = "84";
	icon_height[4] = "50";

	icon_link[5] = "http://www.policyaddress.gov.hk/09-10/chi/";
	icon_img[5] = "../../images/policy_address_tc.jpg";
	icon_alt[5] = "2009-10施政報告";			
	icon_width[5] = "84";
	icon_height[5] = "50";

	icon_link[6] = "http://www.budget.gov.hk/2010/chi/speech.html";
	icon_img[6] = "../../images/budget10-11_c.gif";
	icon_alt[6] = "2010-11財政預算案";			
	icon_width[6] = "84";
	icon_height[6] = "50";
	
	for (i = 1; i <= iconNo; i++)
	{
		document.write("<tr>");
		document.write("<td> <a href="+icon_link[i]+" target=\"_blank\"> <img src="+icon_img[i]+" alt="+icon_alt[i]+" width=" + icon_width[i] + " height=" + icon_height[i] + " border=\"0\"></a>  ");
		document.write("</td>");		
		document.write("</tr>");
	}
}

function loadSideBar(num)
{
		var i = 1;
		var itemSelected = num;
		var col_height;

<!-- menuitem_e start -->

		document.write("<td align=\"left\" valign=\"top\" width=\"153\" height=\"22\">");
		document.write("<table width=\"153\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" height=\"333\"> ");
    
		itemNo = 18;
		loadSideBarImg(itemNo);
		
		for (i = 1; i <= itemNo; i++)
		{
			if (sidebar_alt[i].length > 30)
				col_height = 30;
			else 
				col_height = 20;
				
			document.write("<tr><td align=\"left\" valign=\"top\" width=\"153\" height="+col_height+" bgcolor=\"#FF9933\">");

	    if (itemSelected == i)
	    {
			if (i == 10 || i == 13)
			{	
				document.write("<a href=\"index_c.html\">");
			}

			document.write("<img name="+sidebar_name[i]+" src=\"../"+imgLoc+"/"+sidebar_onmouseout_img[i]+"\" width=\"153\" height="+col_height+" border=\"0\" alt="+sidebar_alt[i]+">");
		}
	    else     	
	    {
		    document.write("<a href="+sidebar_link[i]+" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('"+sidebar_name[i]+"','','../"+imgLoc+"/"+sidebar_onmousefocus_img[i]+"',1)\" >");
		    document.write("<img name="+sidebar_name[i]+" src=\"../"+imgLoc+"/"+sidebar_img[i]+"\" width=\"153\" height="+col_height+" border=\"0\" alt="+sidebar_alt[i]+"></a>");
		}

	    document.write("</td></tr>");
	  }    

    loadSideIcon();
    document.write("</table>");
    document.write("</td>");
    	
}



//-->