// 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 == "tc")
	{
		s = new String(document.URL);
		s = s.replace("/en/","/tc/");
	}
	else 
	{
		s = new String(location.href);
		s = s.replace("/en/","/sc/");
	}

	s = s.replace("_e", "_c");

	return s;
}

function changeLangSetting_Main(num)
{	
	imgLoc = "engimages";
	index = "index_e";
//top banner
	mainbar1_link = "http://www.gov.hk/en/residents/";
	brandCIIF_alt = "Community Investment and Inclusion Fund";
	brandHK_alt = "Brand Hong Kong";
	brand_link = "http://www.brandhk.gov.hk/brandhk/eindex.htm";
	mainbar1_w = "236";
	mainbar1_h = "20";
	mainbar1_alt = "Government Information Centre";
	mainbar3_alt = "Traditional Chinese";
	mainbar3_link = getLangTarget("tc");
	mainbar4_alt = "Simplified Chinese";
	mainbar4_link = getLangTarget("sc");
	mainbar6_alt = "Search";
	mainbar8_alt = mainbar6_alt;
	mainbar9_alt = "Site map";
	mainbar10_alt = "Contact us";
				
}

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=\"99\" rowspan=\"2\" valign=\"bottom\" background=\"../"+imgLoc+"/bkgdtexture.gif\" >"); 
  document.write("<div align=\"center\">");
  document.write("<input class=\"search\" type=\"text\" name=\"query\" size=\"12\">");
  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=\"236\" 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=\"236\" height=\"19\" border=\"0\" alt=\""+mainbar1_alt+"\"></a></td>");
  document.write("<td align=\"left\" valign=\"top\" height=\"19\" width=\"51\"><a href="+mainbar3_link+" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar3','','../"+imgLoc+"/mainbar3_f2.gif',1)\" ><img name=\"mainbar3\" src=\"../"+imgLoc+"/mainbar3.gif\" width=\"51\" height=\"20\" border=\"0\" alt="+mainbar3_alt+"></a></td>");
  document.write("<td align=\"left\" valign=\"top\" height=\"19\" width=\"50\"><a href="+mainbar4_link+" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar4','','../"+imgLoc+"/mainbar4_f2.gif',1)\" ><img name=\"mainbar4\" src=\"../"+imgLoc+"/mainbar4.gif\" width=\"50\" height=\"20\" border=\"0\" alt="+mainbar4_alt+"></a></td>");
  document.write("<td height=\"19\"><img name=\"mainbar5\" src=\"../"+imgLoc+"/mainbar5.gif\" width=\"80\" height=\"20\" border=\"0\"></td>");
  document.write("<td height=\"19\" width=\"67\" background=\"../"+imgLoc+"/bkgdtexture.gif\"></td>");
  document.write("<td height=\"19\" width=\"54\" 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=\"54\" height=\"20\" 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=\"20\" border=\"0\" alt="+mainbar8_alt+" align=\"bottom\"></a></td>");
  document.write("<td height=\"19\" width=\"50\" background=\"../"+imgLoc+"/bkgdtexture.gif\"><a href=\"../sitemap/"+index+".html\" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar9','','../"+imgLoc+"/mainbar9_f2.gif',1)\" ><img name=\"mainbar9\" src=\"../"+imgLoc+"/mainbar9.gif\" width=\"65\" height=\"20\" border=\"0\" alt="+mainbar9_alt+"></a></td>");
  document.write("<td height=\"19\" width=\"36\" background=\"../"+imgLoc+"/bkgdtexture.gif\"><a href=\"../contactus/"+index+".html\" onMouseOut=\"MM_swapImgRestore()\"  onMouseOver=\"MM_swapImage('mainbar10','','../"+imgLoc+"/mainbar10_f2.gif',1)\" ><img name=\"mainbar10\" src=\"../"+imgLoc+"/mainbar10.gif\" width=\"36\" height=\"20\" 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=\"1\" height=\"1\"></td>");
  document.write("</tr>");	
  document.write("</table>");
<!-- header_e end -->

}

function loadSideBarImg(itemNo)
{
	sidebar_name = new Array(itemNo+1);
	sidebar_img = new Array(itemNo+1);
	sidebar_onmousefocus_img = new Array(itemNo+1);
	sidebar_onmouseout_img = new Array(itemNo+1);
	sidebar_alt = new Array(itemNo+1);
	sidebar_link = new Array(itemNo+1);

	sidebar_alt[1] = "CIIF Home";
	sidebar_link[1] = "../../index.htm";
	sidebar_alt[2] = "Message from Chairperson";
	sidebar_link[2] = "../msgfromchair/index_e.html";
	sidebar_alt[3] = "About CIIF";
	sidebar_link[3] = "../aboutciif/index_e.html";
	sidebar_alt[4] = "Objectives and Scope";
	sidebar_link[4] = "../objectives/index_e.html";	
	sidebar_alt[5] = "Organisational Structure";
	sidebar_link[5] = "../orgstructure/index_e.html";	
	sidebar_alt[6] = "How to Apply";
	sidebar_link[6] = "../howtoapply/index_e.html";	
	sidebar_alt[7] = "Public Forms and Guidelines";
	sidebar_link[7] = "../publicforms/index_e.html";	
	sidebar_alt[8] = "SC.NET";
	sidebar_link[8] = "../scnet/index_e.html";
	sidebar_alt[9] = "Publicity";
	sidebar_link[9] = "../promoinfo/index_e.html";	
	sidebar_alt[10] = "Information of the Approved Projects";
	sidebar_link[10] = "../appproj/index_e.html";	
	sidebar_alt[11] = "Promotion and Dissemination Activities";
	sidebar_link[11] = "../promotion/index_e.html";
	sidebar_alt[12] = "What's New";
	sidebar_link[12] = "../whatsnew/index_e.html";
	sidebar_alt[13] = "Speeches and Press Releases";
	sidebar_link[13] = "../speech/index_e.html";
	sidebar_alt[14] = "Related LegCo Panel Papers";
	sidebar_link[14] = "../legco/index_e.html";
	sidebar_alt[15] = "Social Capital Resources";
	sidebar_link[15] = "../resourcedir/index_e.html";
	sidebar_alt[16] = "Evaluation Consortium";
	sidebar_link[16] = "../evaluation/index_e.html";
	sidebar_alt[17] = "FAQs";
	sidebar_link[17] = "../faqs/index_e.html";
	sidebar_alt[18] = "Contact Us";		
	sidebar_link[18] = "../contactus/index_e.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/eng/index.html";
	icon_img[1] = "../engimages/icrs_banner_eng.gif";
	icon_alt[1] = "ICRS Project - Television and Entertainment Licensing Authority";
	icon_width[1] = "150";
	icon_height[1] = "65";

	icon_link[2] = "http://www.gov.hk/en/residents/communication/publicit/itfacilities/wifi/index.htm";
	icon_img[2] = "../engimages/GovWiFi_icon.gif";
	icon_alt[2] = "GovWiFi Programme";
	icon_width[2] = "84";
	icon_height[2] = "50";

	icon_link[3] = "http://www.heritage.gov.hk/en/index.htm";
	icon_img[3] = "../engimages/heritage_en.gif";
	icon_alt[3] = "Heritage Conservation Web Site";	
	icon_width[3] = "84";
	icon_height[3] = "50";

	icon_link[4] = "http://www.voterregistration.gov.hk ";
	icon_img[4] = "../engimages/2008voter.gif";
	icon_alt[4] = "Voter Registration";	
	icon_width[4] = "84";
	icon_height[4] = "50";

	icon_link[5] = "http://www.policyaddress.gov.hk/09-10/eng/";
	icon_img[5] = "../../images/policy_address_en.jpg";
	icon_alt[5] = "2009-2010 Policy Address";	
	icon_width[5] = "84";
	icon_height[5] = "50";

	icon_link[6] = "http://www.budget.gov.hk/2010/eng/speech.html";
	icon_img[6] = "../../images/budget10-11_e.gif";
	icon_alt[6] = "The 2010-11 Budget";	
	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 == 11 || i == 13)
			{	
				document.write("<a href=\"index_e.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>");

		<!-- menuitem_e end -->
	
}




//-->