/*
[pageItem1, pageItem2]
pageItem = [name, type, url, [tags], extract, moreExtract]
*/
var pagesInfo=[

	[
		"Morocco Rural Solar Photovoltaic Electrification Project",
		"project-001.html",
		"In June 2002, Morocco's Office National de l'Electricit&#233; (ONE) entered into a fee-forservice partnership with a renewable energy services company (RESCO) to electrify rural households by using solar PV systems to produce electricity. The RESCO is responsible for the installation and maintenance of solar equipment as well as the collection of users' fees in 24 of Morocco's 62 prefectures and provinces. In the feefor- service model, customers pay an initial connection fee and a monthly service fee. ONE also provides an equipment subsidy to consumers that enables the partnership to offer electrical service at affordable rates, by offsetting the high installation and maintenance costs associated with solar home systems. ",
		"Africa, Morocco, mitigation, renewable energy, solar photovoltaic, bilateral, grant, soft loan, equity, fee-for-service, build-operate-transfer, RESCO",
		"20091009"		
	]
,	
	[
		"Cool Earth Partnership",
		"funding-001.html",
		"Assistance will be provided to developing countries that are already making efforts to reduce greenhouse gas emissions to enable them to achieve economic growth in ways that will contribute to climate stability, on the basis of policy consultations between Japan and those countries. Measures focused both on mitigation and adaptation will be considered eligible for funding.",
		"bilateral, Japan, grants, loans, technical assistance, ODA, adaptation, mitigation, renewable energy, solar electrification, hydroelectric, geothermal, energy efficiency, disaster risk reduction, agriculture",
		"20091009"
	]
,
	[
		"Malaysia Building-Integrated Photovoltaic Project",
		"project-002.html",
		"The principal objective of this project is to reduce the long-term cost of BIPV technology within the Malaysian market, which will subsequently lead to sustainable and widespread building-integrated photovoltaic (BIPV) technology applications that will avoid greenhouse gases (GHG) emissions from the country's electricity sector. The project will establish an enabling environment for a long-term market development and set a target for a follow-up BIPV programme in the 10th Malaysia Plan. The project will achieve its objectives by: developing and implementing strong financing mechanisms and solid institutional and policy frameworks; building capacity and an extensive education campaign to generate awareness and improve local competency; introducing standards and guidelines; developing the BIPV market; and upgrading the local industry towards local manufacturing. The implemented project will induce an increase of BIPV application of about 330% with a cost reduction of 20% by the year 2010.",
		"Malaysia, Asia, mitigation, renewable energy, building integrated solar photovoltaic, fee-for-service, grant, multilateral, in-kind, feed-in-tariff, net-metering",
		"20091009"
	]
,
	[
		"IDB's Sustainable Energy and Climate Change Initiative (SECCI)",
		"funding-012.html",
		"All activities financed must be consistent with the IDB SECCI&#8217;s fundamental objectives: to facilitate an expanded application of renewable energy and energy efficiency technologies in Latin America and the Caribbean, to finance and support greenhouse gas emission reduction projects and biofuel development, and to promote and finance adaptation strategies and actions to reduce vulnerability risks presented by climate change in the countries of LAC.",
		"multilateral, grant, technical assistance, adaptation, mitigation, renewable energy, energy efficiency",
		"20091009"
	]
,
	[
		"The Multilateral Investment Fund (MIF) of the IDB Group ",
		"funding-015.html",
		"The Multilateral Investment Fund (MIF) provides technical support and investments aimed to increase the competitiveness of small and micro enterprises. As the largest supporter of microfinance and smaller scale venture capital in the region, the MIF has increased access to finance and capital for small firms and provided technical support to improve their businesses. The MIF also provides training and finance for small clean energy companies, as well as for programs that improve the energy efficiency of small and medium sized enterprises.",
		"multilateral, grants, investments, private-sector, SMEs, venture capital, microfinance, clean energy, carbon markets, adaptation, forestry, agriculture",
		"20091009"
	]
,
	[
		"GEF Trust Fund",
		"funding-002.html",
		"GEF projects in climate change help developing countries and economies in transition to contribute to the overall objective of the United Nations Framework Convention on Climate Change (UNFCCC). The projects support measures that minimize climate change damage by reducing the risk, or the adverse effects, of climate change. The GEF supports projects that reduce or avoid greenhouse gas emissions in the areas of renewable energy, energy efficiency, and sustainable transport. The GEF supports interventions that increase resilience to the adverse impacts of climate change of vulnerable countries, sectors, and communities.",
		"adaptation, mitigation, multilateral, grant, ODA, energy efficiency, renewable energy, low-GHG energy, transport, technical assistance, capacity building",
		"20091013"
	]
,
	[
		"Least Developed Countries Fund",
		"funding-003.html",
		"The objective of the Least Developed Countries Fund (LDCF) is to address the unique needs of the 48 Least Developed Countries (LDCs), which are especially vulnerable to the adverse impacts of climate change. Activities supported under the fund include preparing and implementing National Adaptation Programs of Action (NAPAs) to identify the immediate needs of LDCs to adapt to climate change.",
		"UNFCCC, adaptation, multilateral, ODA, grant, NAPA",
		"20091013"
	]
,
	[
		"UNDP/Spain MDG Achievement Fund",
		"funding-004.html",
		"The Fund finances collaborative activities that leverage value-added programs of the UN in the sector and country concerned, particularly in addressing multidimensional development challenges. In terms of climate change, the Fund increases access to new financing mechanisms and enhances capacity for climate adaptation. The Fund aims to accelerate progress towards:<br /><br />1. Supporting policies and programs that promise significant and measurable impact on select MDGs;<br />2. Financing the testing and scaling-up of successful pilot programs;<br />3. Catalyzing innovations in development practice; and<br />4. Adopting mechanisms that improve the quality of financing aid ",
		"multilateral, ODA, grant, adaptation, mitigation, capacity building, technology",
		"20091013"
	]
,
	[
		"Special Climate Change Fund",
		"funding-005.html",
		"The overall objective of the Special Climate Change Fund (SCCF) is to implement adaptation interventions to expand and fortify the resilience of specific national development sectors to the expected effects of climate change. The SCCF will fund measures that take a long-term view of climate change adaptation and appropriate preemptive measures. Ideally the SCCF will catalyze additional resources from bilateral and/or other multilateral sources of financing.",
		"UNFCCC, adaptation, multilateral, grant, ODA, agriculture, coastal zone management, disaster risk reduction, human health, infrastructure, land management, natural resource management, water resources management",
		"20091013"
	]
,
	[
		"Forest Carbon Partnership Facility (FCPF)",
		"funding-006.html",
		"The Forest Carbon Partnership Facility (FCPF) has the dual objectives of building capacity of tropical and sub-tropical developing countries in their efforts to reduce emissions from deforestation and forest degradation (REDD), and testing a program of performance-based incentive payments in some pilot countries, on a relatively small scale, in order to set the stage for a much larger system of positive incentives and financing flows in the future. The FCPF thus seeks to create an enabling environment and garner a body of knowledge and experiences that can facilitate development of a much larger global program of incentives for REDD over the medium term.",
		"Government, Public, Grant, Carbon Finance, REDD, FCPF, World Bank, Multilateral",
		"20091014"
	]
,
	[
		"Carbon Market Initiative (CMI)",
		"funding-007.html",
		"The main aim of CMI is to help developing member countries (DMCs) benefit from market-based instruments under the Kyoto Protocol to promote sustainable development, the principle at the base of Agenda 21.",
		"Multilateral, Mitigation, Low-Carbon, Co-financing, Carbon Finance, Asia, Project, Private, Renewable energy",
		"20091014"
	]
,
	[
		"Climate Change Fund (CCF)",
		"funding-008.html",
		"In May 2008, the CCF was established to facilitate greater investments in ADB&#8217;s developing member countries (DMCs) to effectively address the causes and consequences of climate change. Through CCF, ADB provides grants to projects through technical assistance, or investments in the private and public sectors. CCF initially dedicated $25 million towards mitigation activities&#8212;to lower carbon emissions, $10 million for adaptation activities&#8212;to build resilience, and $5 million for pilot activities in reducing emissions from deforestation and land degradation (REDD).",
		"Mutilateral, ADB, Grant, Technical assistance, Co-financing, Adaptation, Mitigation, Energy, Transport, Water, Forestry, Sustainable Land Management, Agriculture, Government, Project, Asia",
		"20091014"
	]
,
	[
		"Clean Energy Financing Partnership Facility (CEFPF)",
		"funding-009.html",
		"CEFPF resources are also intended to finance policy, regulatory, and institutional reforms that encourage clean energy development. ",
		"Multilateral, ADB, Grant, Technical assistance, Co-financing, Mitigation, Renewable Energy, Energy Efficiency, Fuel Switching, Government, Project, Asia, Regional",
		"20091014"
	]
,
	[
		"IDB's Infrastructure Fund (InfraFund)",
		"funding-013.html",
		"All activities must be consistent with the IDB InfraFund&#8217;s fundamental objective of assisting public and private entities in Latin America and the Caribbean with identifying, developing and preparing bankable and sustainable infrastructure projects that have high probability of reaching financial closing. Other key goals are to help mobilize private financing for sustainable infrastructure projects in Latin America and the Caribbean and to help develop and structure sustainable public-private partnerships in the region.",
		"multilateral, IDB, technical assistance, adaptation, mitigation, sustainable land management, water, sustainable infrastructure, energy, energy efficiency, fuel switching, renewable energy, transport, waste management, tourism, low-carbon, climate-resilient, public-private partnerships",
		"20091016"
	]
,
	[
		"Regional Fund of Agricultural Technology (FONTAGRO)",
		"funding-014.html",
		"The Fund is an alliance of 15 Latin American and Caribbean countries, plus Spain, created to support research and innovation in the agricultural sector. The Fund contributes to the reduction of poverty, promotes competitiveness of agri-food chains and encourages the sustainable management of natural resources.",
		"multilateral, IDB, regional, grant, technology, adaptation, mitigation, capacity building, agriculture, co-financing",
		"20091016"
	]
,
	[
		"Urban Transportation Program for the Federal District, Brazil",
		"project-004.html",
		"The goal of this program is to help improve mobility and urban transportation conditions in the Federal District. The purpose is to improve mobility and accessibility for the population of the Federal District, particularly its low-income segments, by further integrating its communities through financing of a modern mass transit (bus) system. This will help to improve the circulation and safety of motorized and nonmotorized forms of transportation, and will strengthen the Government of the Federal District&#8217;s initiatives and institutional and management capacity in the area of transportation. The program will invest in road and urban infrastructure, transfer stations, roadway and pedestrian safety, the construction of ramps at crosswalks, sidewalks, and pedestrian walkways for persons with physical disabilities, the modernization of the traffic light system, bicycle paths or lanes, and the strengthening of institutional and management capacity in the area of transportation.",
		"Latin America, Brazil, Brasilia, sustainable transportation, air quality, co-financing, mitigation",
		"20091016"
	]
,
	[
		"International Climate Initiative",
		"funding-010.html",
		"The bilateral fund International Climate Initiative (ICI) is run by the Ministry for the Environment, Nature Conservation, and Nuclear Safety (BMU) of the Government of Germany. The ICI provides financial support to international projects in climate change mitigation, adaptation and biodiversity projects that have a climate change focus or co-benefit. Significantly, financing through the Initiative seeks to ensure that its investments will catalyze other funding streams, particularly those from the private-sector, of a greater magnitude. It also seeks projects that support a post-2012 focus and to that end will fund multilateral activities in adaptation and sustainable forest management.",
		"Germany, bilateral, ODA, grant, loans, interest rate subsidy, adaptation, mitigation, agriculture, energy efficiency, renewable energy, food security, water resource management, sustainable land management, sustainable forest management, transportation",
		"20091017"
	]
,
	[
		"Clean Technology Fund (CTF) ",
		"funding-011.html",
		"Key features of the CTF design are: Utilizing MDB capabilities to leverage private and public resources for low carbon investments; Promoting environmental and development co-benefits to demonstrate how low carbon technologies can contribute to national development goals and strategies; Providing concessional financing with a grant element tailored to cover the identifiable additional costs of the investment necessary to make the project viable.",
		"MDBs, AfDB, ADB, EBRD,IDB, World Bank, Mitigation, Technology, Industry, Energy, Energy Efficiency, Fuel Switching, Transport, Renewable Energy, ODA, Grants and Loans, Co-Financing, Multilateral",
		"20091017"
	]
,
	[
		"National Sustainable Electrification and Renewable Energy Program, Nicaragua",
		"project-003.html",
		"The objective of the Program is to support the Nicaraguan Government efforts to reduce poverty trough the expansion and improvement of electricity service. The Program will also promote the increasing use of renewable sources for electricity generation in order to produce a change in the energy matrix  and contribute with climate change mitigation.",
		"Latin America, Energy, Renewable Energy, Energy Efficiency, Mitigation, Co-financing, Low-Carbon, Projects, Multilateral, Government",
		"20091017"
	]
,
	[
		"India Chiller Energy Efficiency Project",
		"project-005.html",
		"The India Chiller Energy Efficiency Project (CEEP) seeks to improve energy efficiency of building chillers (a major source of power demand) and accelerate phasing out of ozone depleting substances by providing an incentive to overcome upfront capital cost barrier of replacement and upgrade of older CFC-based chillers by more efficient non-CFC-using ones. Despite potential 40% improvement in energy consumption indeed, most building owners/managers have not embraced early or even timely replacement of outdated chillers given higher upfront capital requirement, perceived technology risks and high opportunity costs.",
		"India, Asia, Mitigation, Energy Efficiency Households, Buildings, Structured Financing, Carbon Finance, Grant, GEF, Montreal Protocol Fund, CDM, Multilateral, Project",
		"20091017"
	]
,
	[
		"UNDP/MDG Carbon Facility",
		"funding-019.html",
		"UNDP has launched the MDG Carbon Facility (the \"Facility\") with the dual purpose of broadening access to carbon finance by enabling a wider range of developing countries to participate and promoting emission reduction projects which contribute to the Millennium Development Goals (MDGs - click www.undp.org/mdg for more information) by yielding additional sustainable development and poverty reduction benefits. The Facility offers prospective emissions reduction projects a comprehensive package of project development services. The Facility operates under the CDM and JI of the Kyoto Protocol, as well as the voluntary carbon markets.",
		"Carbon finance, UNDP, Multilateral, technical assistance, Clean Development Mechanism, Joint Implementation, renewable energy, energy efficiency, infrastructure, transportation, fugitive emissions, waste management, afforestation, reforestation, agriculture, biomass, fuel switching",
		"20091018"
	]
,
	[
		"Weather Risk Management Solutions in Malawi",
		"project-006.html",
		"Malawi is a land-locked country in the Eastern part of Southern Africa. Almost 90% of its population lives in rural areas and is engaged in smallholder rain-fed subsistence agriculture, with maize being the main crop (38% of the country&#8217;s GDP). The weather risk management transaction (against droughts) falls within a comprehensive agricultural risk management framework developed by the country with the assistance of the Africa Agriculture and Rural Development Department (AFTAR) and the Commodity Risk Management Group (CRMG) of the Agricultural and Rural Development Department (ARD) of the World Bank. ",
		"Africa, Disaster Risk Reduction, Risk Management",
		"20091019"
	]
,
	[
		"Costa Rica Catastrophe Deferred Drawdown Option (CAT DDO)",
		"project-007.html",
		"Costa Rica is a small, upper-middle income country exposed to a variety of natural hazards such as floods, hurricanes, landslides, earthquakes and volcanic eruptions due to its geographic location. 78% of Costa Rica&#8217;s population and 80% of its GDP reside in areas at high risk of multiple hazards. To reduce its fiscal vulnerability when responding to such disasters, Costa Rica needed a reliable source of budget financing, so they were the first to request and benefit from the Catastrophe Deferred Drawdown Option (Cat DDO), a new IBRD financial instrument made available to countries that take a proactive stand towards reducing their exposure to disaster risk. Cat DDO funds may be disbursed (partially or in full) upon occurrence of a natural disaster resulting in a declaration of a state of emergency (done by the President in the case of Costa Rica).",
		"Disaster Risk Reduction, Risk Management, Costa Rica, Latin America",
		"20091019"
	]
,
	[
		"Removing Barriers to the Increased Use of Biomass as an Energy Source (Slovenia)",
		"project-008.html",
		"The project is facilitating the increased use of biomass as an energy source in Slovenia, in order to achieve national GHG mitigation targets.",
		"Slovenia, Europe, multilateral, private-sector, grant, equity, revolving fund, mitigation, renewable energy, biomass, infrastructure",
		"20091019"
	]
,
	[
		"Armenia Energy-Efficient Heating Systems in Buildings",
		"project-009.html",
		"The objective of the project is to reduce GHG emissions from the heating sector in Armenia and to ensure that development of the heat and hot water supply sector in Armenia takes a more energy efficient and sustainable direction. The project addresses the existing institutional and capacity barriers to energy efficiency and complements other ongoing initiatives in Armenia through close cooperation with the World Bank managed Urban Heating Project, the Government of Netherlands, and USAID funded activities in the field of energy and environment. One of the key approaches to changing the current heat and hot water supply practices and to leveraging increasing financing for this purpose is to strengthen the role of the local condominiums in organizing and procuring the heat and hot water supply services collectively at the building level. In terms of the fuels and technologies, the objective of the project is to reduce the use of electricity and unsustainably produced wood fuel for heating and hot water preparation and to encourage the more efficient use of natural gas in &#8220;heat only&#8221; applications (via decentralized or centralized approach) and/or waste heat from co-generation, thereby contributing to both reducing GHG emissions and ensuring future energy security.",
		"Armenia, Europe, multilateral, bilateral, IDA, in-kind, grant, credit, mitigation, energy efficiency, infrastructure",
		"20091019"
	]
,
	[
		"Investment Plan for Mexico: Clean Technology Fund",
		"project-010.html",
		"The objective of the Mexico Urban Transport Transformation Program (UTTP) is to transform urban transport in Mexican cities to a lower carbon growth path by improving its quality and sustainability and by upgrading related elements of the urban transport system. Achieving this objective will significantly reduce the transport sector carbon footprint and the emission of related air toxics through the implementation of sustainable transport policies while tackling environmental challenges.  The UTTP will bring together the local urban transport agenda, the national poverty reduction agenda, and the global climate agenda, while responding to the Government of Mexico&#8217;s voluntary pledge to adopt the UNFCCC principle of &#8220;common but differentiated responsibilities&#8221; to reduce its GHG emissions.",
		"Latin America, transport, mitigation, adaptation, energy, capacity building, grant, loan, carbon finance",
		"20091019"
	]
,
	[
		"Programme Solaire (PROSOL) Tunisia",
		"project-011.html",
		"Within the framework of The Mediterranean Renewable Energy Programme (MEDREP), the Tunisian National Agency for Energy Conservation (ANME), the Tunisian State Utility for Gas and Electricity (STEG) and the United Nations Environment Programme - Division of Technology, Industry, and Economics (UNEP/ DTIE) implemented a cooperative financing mechanism to support the Tunisian market for Solar Water Heating (SWH), with additional support from the Ministry for the Environment Land and Sea of Italy through the Mediterranean Renewable Energy Centre (MEDREC). Based on the Tunisian Government’s strategy, PROSOL supports the solar water heating market and provides training for local SWH suppliers. PROSOL sought to overcome the existing barrier of a high initial cost of solar water heaters helping local financial institutions to build loan portfolios in the SWH area by providing an interest rate subsidy that effectively lowers the interest rate for a PROSOL loan.",
		"Africa, Tunisia, interest rate subsidy, loan",
		"20091019"
	]
,
	[
		"Indian Solar Loan Programme",
		"project-012.html",
		"A four-year $7.6 million effort was launched in April 2003 to help accelerate the market for financing solar home systems in southern India. The project is a partnership between UNEP Energy Branch, UNEP Risoe Centre (URC), and two of India's major banking groups - Canara Bank and Syndicate Bank. The effort assisted Canara bank and Syndicate bank in developing lending portfolios specifically targeted at financing solar home systems (SHS). With the support of the UN Foundation and Shell Foundation, the market catalyst model chosen was a finance subsidy (an interest rate buy-down) provided through the two banks and multiple established vendors. The customer therefore chose to purchase a SHS from one of a number of qualified vendors, and to finance the system from a branch of either Syndicate or Canara bank.",
		"Asia, India, subsidy, interest rate buy-down, loan, equity, grant, mitigation, renewable energy, solar photovoltaic",
		"20091019"
	]
,
	[
		"Climate Technology Fund (CTF) Investment Plan for Turkey",
		"project-013.html",
		"The Clean Technology Fund (CTF) Investment Plan is a &#8220;business plan&#8221; agreed among the Government of Turkey, the World Bank (WB), the International Finance Corporation (IFC) and the European Bank for Reconstruction and Development (EBRD) in order to provide support for the low carbon objectives in Turkey&#8217;s 9<sup>th</sup> Development Plan (2007-13); the 1st National Communication on Climate Change (NCCC), and related strategies, legislation and programs. This multi-year business plan identifies Turkey&#8217;s programs that are proposed to be co-financed by the CTF jointly with the WB, IFC and EBRD.",
		"Europe, CTF, mitigation, renewable energy, energy efficiency, multilateral, low carbon, climate resilient, EBRD, IFC, WB, fuel switching, loan, grant, carbon finance, capacity building, co-financing, waste management",
		"20091019"
	]
,
	[
		"World Bank Carbon Funds and Facilities",
		"funding-016.html",
		"Over the past ten years, the World Bank has continuously sought to promote sustainable development through its work in promoting projects that mitigate climate change. The institution has been able to leverage new resources in this area through the use of carbon finance, in particular by strengthening the capacity of developing countries to benefit from carbon asset transactions and playing a catalytic role in building, sustaining and expanding the carbon market.",
		"Multilateral, Carbon Finance, World Bank, BioCF, CDCF, CDCF, DCF, ICF, NCDMF, NECF, PCF, UCF, SCF, CDM, JI, AAU/GIS",
		"20091020"
	]
,
	[
		"Forest Investment Program",
		"funding-017.html",
		"The Forest Investment Program (FIP) is a program under the Strategic Climate Fund which aims to significantly increase investments to reduce deforestation and forest degradation, and promote improved sustainable forest management, leading to emission reductions and the protection of carbon reservoirs. Its main purpose is to support developing countries&#8217; effort to reduce emissions from deforestation and forest degradation (REDD), providing up-front bridge financing for readiness reforms and public and private investments identified through national REDD readiness strategy building efforts. The program aims to help them adapt to the impact of climate change on forests and to contribute to multiple benefits such as biodiversity conservation, protection of the rights of indigenous peoples and local communities, poverty reduction and rural livelihoods enhancements. ",
		"MDBs, AfDB, ADB, EBRD,IDB, World Bank, Mitigation, Forestry, Carbon Capture Storage (CCS), Grants, ODA, Multilateral",
		"20091020"
	]
,
	[
		"UNDP Small Grants Programme",
		"funding-022.html",
		"The principle objectives of the Small Grants Programme are to:<br />&#8226; Develop community-level strategies and implement technologies that could reduce threats to the global environment if they are replicated over time; <br />&#8226; Gather lessons from community-level experience and initiate the sharing of successful community-level strategies and innovations among CBOs and NGOs, host governments, development aid agencies, GEF and others working on a regional or global scale, and;<br />&#8226; Build partnerships and networks of stakeholders to support and strengthen community, NGO and national capacities to address global environmental problems and promote sustainable development.",
		"multilateral, UNDP, grant, mitigation, energy, energy efficiency, renewable energy, sustainable transport",
		"20091026"
	]
,
	[
		"Pilot Program for Climate Resilience (PPCR)",
		"funding-018.html",
		"PPCR is designed to:<br />1) pilot and demonstrate approaches for integration of climate risk and resilience into development policies and planning <br />2) strengthen capacities at the national level to integrate climate resilience into development planning<br />3) scale-up and leverage climate resilient investment, building on other ongoing initiatives<br />4)enable learning-by-doing and sharing of lessons at country, regional and global levels.",
		"Multilateral, MDBs, AfDB, ADB, EBRD,IDB, World Bank, Technical Assistance, Grant, Loan, ODA, Multilateral, Climate Resilient, Population, Human Settlements, Water, Infrastructure, Adaptation, Agriculture, Coastal Zone Management, Sustainable Land Management",
		"20091020"
	]
,
	[
		"UN-REDD Programme (Reduced Emissions from Deforestation and Forest Degradation)",
		"funding-021.html",
		"The UN-REDD Programme has both a country-level and global focus. The global portion of UN-REDD is broadly concerned with technical and scientific support services, as well as developing and imparting knowledge management practices to non-Annex I states. The global programme seeks to achieve the following objectives:",
		"mitigation, multilateral, grant, technical assistance, capacity building, avoided deforestation, forest conservation, sustainable forest management",
		"20091021"
	]
,
	[
		"Caribbean Catastrophe Risk Insurance Facility",
		"funding-020.html",
		"Short-term liquidity will be provided to the Caribbean Community government to start recovery efforts while maintaining essential government services in the aftermath of natural disasters (hurricanes and earthquakes).",
		"World Bank, Multilateral, Disaster Risk Reduction, Risk Management, Other (insurance pool)",
		"20091022"
	]
,
	[
		"ZeroGen Pty Ltd Power Plants with CCS",
		"project-014.html",
		"ZeroGen Pty Ltd is developing two coal power plants with CO<span style='font-size:8px;'>2</span> capture and storage using the Integrated Gasification Combined Cycle (IGCC) concept, Australia. The project is leading global efforts to integrate the technologies of Integrated Gasification Combined Cycle (IGCC) with Carbon Capture and Storage (CCS) to produce low-emission, baseload electricity. While both are established technologies in their own right, IGCC and CCS have never before been integrated at commercial-scale for power generation. ZeroGen's world-first integration of these technologies will produce low-emission electricity by capturing and safely storing carbon dioxide (CO<span style='font-size:8px;'>2</span>).",
		"Australia, Mitsubishi, gastification, electricity, Oceania, Carbon Capture and Storage (CCS), low-carbon, technology, carbon finance, technical assistance, energy efficiency, energy",
		"20091101"
	]	
];

function search(inc, exc, xor, targets) {	// ok
	var pages = [];
	var j; var xorPassed;
	var keywords;
	for (var i=pagesInfo.length-1; i>=0; i--) {
		if ((targets[0] && pagesInfo[i][1].indexOf("project")>=0) || (targets[1]&&pagesInfo[i][1].indexOf("funding")>=0)) {
			keywords = tokenize((pagesInfo[i][3] + "," + pagesInfo[i][0]).toLowerCase(),',');		
			if ((searchAllKeywords(inc, keywords)) && !searchAnyKeywords(exc, keywords)) {
				xorPassed=true;
				for (j=0; j<xor.length; j++) {
					if (xor[j]!=-1) {
						if (!searchAnyKeywords(xor[j],keywords)) {
							xorPassed=false;
							j=xor.length;
						}
					}
				}
				if (xorPassed)	pages.push(i);
			}
		} 
	}
	
	return sortPages(pages);	
}

function sortPages(pages) {
	var a = []; var j; 
	
	if (pages.length>0)	a.push(pages[0]);
	for (var i=1; i<pages.length; i++) {
		for (j=0; j<a.length; j++) {
			if (pagesInfo[pages[i]][4] > pagesInfo[a[j]][4]) {
				a.splice(j,0,pages[i]);
				j=a.length;
			}
		}
		if (a.length <= i) {
			a.push(pages[i]);
		}
	}
	return a;
}

function searchAllKeywords(kw, tags) {		// ok
	// Array(kw), Array(tags), case sensitive
	// if kw is empty, will return true
	var found; var y;
	for (var z=0; z<kw.length; z++) {
		found = false;
		for (y=0; y<tags.length; y++) {
			if (tags[y].match(kw[z])) {
				found=true;
				y=tags.length;
			}
		}
		if (!found)	return false;
	}
	return true;
}

function searchAnyKeywords(kw, tags) {		// ok
	// Array(kw), Array(tags), case sensitive
	// if kw is empty, will return false;
	
	for (var z=0; z<kw.length; z++) {
		for (var y=0; y<tags.length; y++) {
			if (tags[y].match(kw[z])) {
				return true;
			}
		}
	}
	return false;
}

function tokenize(str, delim) {		// ok
	var tokens = new Array();
	if (str) {
		var spoint = 0;
		for (i=0; i<str.length; i++) {
			if (str.charAt(i)==delim) {
				if (!(i>0 && str.charAt(i-1)==delim)) {
					tokens.push(str.substring(spoint,i));
				}
				spoint=i+1;
			}
		}
		if (spoint < str.length) {
			tokens.push(str.substring(spoint,str.length));
		}
		
	}
	return tokens;
}

function processAdvanceSearchForm() {	// ok
	var kw = document.getElementById('keyword').value;
	if (document.getElementById('excludekeyword')) {
		var exc = (tokenize((document.getElementById('excludekeyword').value).toLowerCase(), ' ')).toString();
		exc = tokenize(exc, ',');
		for (var i=0; i<exc.length; i++) {
			kw = kw + " -"+exc[i];
		}
	}
	
	var base = 'results.html';
	
	var target=[false, false];
	if (document.getElementById('searchProject').checked)	target[0]=true;
	if (document.getElementById('searchFunding').checked)	target[1]=true;
	
	var xor = [[-1],[-1],[-1],[-1],[-1],[-1],[-1]];
	if (!document.getElementById('userAny').checked) {
		xor[0] = optionSelectedToArr(document.getElementById('user').options);
	}
	if (!document.getElementById('locationAny').checked) {
		xor[1] = optionSelectedToArr(document.getElementById('location').options);
	}
	if (!document.getElementById('focusAreaAny').checked) {
		xor[2] = optionSelectedToArr(document.getElementById('focusArea').options);
	}
	if (!document.getElementById('sectorAny').checked) {
		xor[3] = optionSelectedToArr(document.getElementById('sector').options);
	}
	if (!document.getElementById('financingMechanismAny').checked) {
		xor[4] = optionSelectedToArr(document.getElementById('financingMechanism').options);
	}
	if (!document.getElementById('fundingSourceAny').checked) {
		xor[5] = optionSelectedToArr(document.getElementById('fundingSource').options);
	}
	if (!document.getElementById('financingNeedsAny').checked) {
		xor[6] = optionSelectedToArr(document.getElementById('financingNeeds').options);
	}
	
	getQuickResults(kw, target, base, xor);
	
	return false;
}

function optionSelectedToArr(options) {	//	push all selected options values to an array
	var a = [];
	for (var i=0; i<options.length; i++) {
		if (options[i].selected) {
			if (options[i].value.substring(0,3) == '-- ')	a.push(options[i].value.substring(3).toLowerCase());
			else a.push(options[i].value.toLowerCase());
		}
	}
	return a;
}

function getPrefXor(prefParam) {		// ok
	// prefParam (OPTIONAL)	- if not provided, will look for user's pref instead
	//	- prefParam ex: a?usr=all&loc=all&........ 
	//		- must contain 'usr', 'loc', 'foc', 'sec', 'mec', 'src', 'ned'
	

	var xor = [[-1],[-1],[-1],[-1],[-1],[-1],[-1]];		// -1 == include all
	
	var pref = "";
	if (getCookie('userid')) {
		var userKey = getCookieTokenIndex('users',hexConvert(getCookie('userid')));
		pref = hexConvert(getCookie(hexConvert(getCookie('userid'))+'*pref'));
	} else if (prefParam)	pref = prefParam;
	
	if (pref!="") {
		if (getParam(pref, 'usr')!='all')	xor[0]=tokenize(getParam(pref,'usr'),',');
		if (getParam(pref, 'loc')!='all')	xor[1]=tokenize(getParam(pref,'loc'),',');
		if (getParam(pref, 'foc')!='all')	xor[2]=tokenize(getParam(pref,'foc'),',');
		if (getParam(pref, 'sec')!='all')	xor[3]=tokenize(getParam(pref,'sec'),',');
		if (getParam(pref, 'mec')!='all')	xor[4]=tokenize(getParam(pref,'mec'),',');
		if (getParam(pref, 'src')!='all')	xor[5]=tokenize(getParam(pref,'src'),',');
		if (getParam(pref, 'ned')!='all')	xor[6]=tokenize(getParam(pref,'ned'),',');		
	}
	
	return xor;
}

function pushAllTo(fromArr, toArr) {
	for (var p=0; p<fromArr.length; p++) {
		toArr.push(fromArr[p].toLowerCase());
	}
	return toArr;
}
function pushStrTo(fromStr, toArr, mList, none) {
	fromStr = hexConvert(fromStr);
	var got = [];
	while (fromStr.indexOf(',')>0) {
		toArr.push((fromStr.substring(0,fromStr.indexOf(','))).toLowerCase());
		fromStr = fromStr.substring(fromStr.indexOf(',')+1);
		got.push(toArr[toArr.length-1]);
	}
	if (mList) {
		for (var i=0; i<mList.length; i++) {
			if (getIndexOf(got,mList[i].toLowerCase()) <0) {
				none.push(mList[i].toLowerCase());
			}
		}
	}
	
	global = none;
	return toArr;
}

function getIndexOf(arr, val) {
	for (var ind=0; ind<arr.length; ind++) {
		if (arr[ind] == val)	return ind;
	}
	return -1;
}

function pushOptionsTo(options, toArr, none, max) {
	var count=0;
	var parent = "";
	var pSelected=false;
	var pChildSelected=false;
	for (var i=0; i<options.length; i++) {
		if ((options[i].value).substring(0,3)!="-- ") {
			parent = options[i].value.toLowerCase();
			pChildSelected=false;
			if (options[i].selected) {
				pSelected=true;
				toArr.push(options[i].value.toLowerCase());
				count++;
			} else {
				pSelected=false;
				none.push(options[i].value.toLowerCase());
			}
		} else {
			if (!pSelected) {
				if (options[i].selected) {
					toArr.push(options[i].value.substring(3).toLowerCase());
					count++;
					if (!pChildSelected) {
						pChildSelected=true;
						for (var k=none.length; k>=0; k--) {
							if (none[k]==parent) {	
								p1 = [];
								if (k>0)	p1 = none.slice(0,k);
								p2 = none.slice(k+1,none.length);
								none = p1.concat(p2);
								k=-1;
							}
						} 
					}
				} else {
					none.push(options[i].value.substring(3).toLowerCase());
				}
			}
		}
		

		if (count>=max)	i=options.length;
	}
	global = none;
	return toArr;
}

function getQuickResults(keyword, target, basePage, optionalXor, noSpaceBreak) {	// ok
	/* keyword == an input string eg. "item1 item2 item3, item4" */
	// optionalXor (OPTIONAL) if not provided, will look for user preference xor
	
	var inc = [];
	var exc = [];
	
	toDebug('getQuickResults2()------------------'); toDebug("keyword -- " + keyword); toDebug("target -- "+ target);
	
	
	/* treats a comma the same as a space */
	var kw = keyword.toLowerCase();;
	if (!noSpaceBreak)	kw = (tokenize(keyword.toLowerCase(), ' ')).toString();
	kw = tokenize(kw, ',');
	
	for (var i=0; i<kw.length; i++) {
		if (kw[i].substring(0,1)=='-')	
			exc.push(kw[i].substring(1));
		else		inc.push(kw[i]);
	}
	
	var xor = 	optionalXor; 
	if (!xor) {
		if (usePersonalSettings())	xor = getPrefXor();
		else xor = [];
	}
	
	toDebug("inc -- " + inc); toDebug("exc -- " + exc); toDebug("xor -- " + xor);
		
	var url = basePage+"?pages=";
	
	var pages = search(inc, exc, xor, target);
	if (pages.length==0)	url = url+'-1';
	else	url = url+pages;
	
	url = url+"&keyword=" + keyword;
	
	window.location=url;
	
	return false;

}


function highlight(str, keywords, color) {	// ok
	if (!color)	color="style=''";
	else	color=' color="#'+color+'"';
	var output=str;
	var highlight = [];
	var temp = [];
	keywords = tokenize(keywords,' ');
	for (var i=0; i<keywords.length; i++) {
		if (keywords[i].substring(0,1)!='-') {
			temp.push(keywords[i]);
		}
	}
	for (var i=0; i<temp.length; i++) {
		var largest=0;
		var c;
		for (var j=i; j<temp.length; j++) {
			if (temp[j].length>largest) {
				c=j;
				largest=temp[j].length;
			}
		}
		highlight.push(temp[c]);
	}
	for (var i=0; i<highlight.length; i++) {
		 var chunkLower = output.toLowerCase();
		 var chunkNormal = output;
		 output="";
		 while (chunkLower.indexOf(highlight[i].toLowerCase())>=0) {
		 	output = output+chunkNormal.substring(0,chunkLower.indexOf(highlight[i].toLowerCase())) + '<b><font'+color+'>'+chunkNormal.substr(chunkLower.indexOf(highlight[i].toLowerCase()),highlight[i].length)+'</font></b>';
		 	chunkNormal = chunkNormal.substring(chunkLower.indexOf(highlight[i].toLowerCase())+highlight[i].length);
		 	chunkLower = chunkLower.substring(chunkLower.indexOf(highlight[i].toLowerCase())+highlight[i].length);
		 }
		 output = output+chunkNormal;
	}
	return output;
}

function getExcerpt(str) {
	var first="";
	if (str.length < 200) {
		return str;
	} else {
		first = str.substring(0,200);
		var second = str.substring(200);
		var a = second.indexOf(',');
		var b = second.indexOf('.');
		if (b<a && b>=0)	a=b;
		b = second.indexOf(':');
		if (b<a && b>=0)	a=b;
		b = second.indexOf(';');
		if (b<a && b>=0)	a=b;
		b = second.indexOf('?');
		if (b<a && b>=0)	a=b;
		b = second.indexOf('<br />');
		if (b<a && b>=0)	a=b-1;
		
		if (a>=0)	first = first + second.substring(0,a+1);
	}
	 
	return first;
}

function outputSearchResults(quick, appendKeyword, type) {	// ok
	var append = "";
	if (appendKeyword)	append = "?keyword="+appendKeyword;
	if (type)	{
		if (append=="")	append = "?type="+type;
		else			append = append+"&type="+type;
	}
	if (getUrlParam("pages")=="-1") {
		document.write("<tr><td>We did not find any matching results</td></tr>");
	} else {
		var pages = tokenize(getUrlParam("pages"),",");
		for (var tok=0; tok<pages.length; tok++) {
			document.write(''+
			'<tr style="background:#f6f6f6;">'+
			'	<td width="10" style="background:#EcEcF3;padding:10px; margin:0px; color:#5063cf; font-size:24px; text-align:center;" valign="top">'+(tok+1)+'</td>'+
			'	<td style="padding:10px; margin:0px; font-size:12px; line-height:140%;" valign="top">'+
			'		<p class="resultItemTitle"><a href="'+pagesInfo[pages[tok]][1]+append+'">'+pagesInfo[pages[tok]][0]+'</a></p>'+
			'		<p id="item'+(tok+1)+'" class="item'+(tok+1)+'" style="overflow:hidden; display:block; padding:0px; margin:0px;">'+
			''+getExcerpt(pagesInfo[pages[tok]][2])+' <span class="showMore"><a href="javascript:expandText(\''+(tok+1)+'\')">[<span class="moreInnerSpan">...</span>]</a></span>'+
			'		</p>'+
			'		<p id="itemS'+(tok+1)+'" class="itemS'+(tok+1)+'" style="overflow:hidden; display:none; padding:0px; margin:0px;">'+
			''+pagesInfo[pages[tok]][2] +
			'&nbsp;<span class="resultItemReadMore">[<span class="moreInnerSpan"><a href="'+pagesInfo[pages[tok]][1]+append+'">More<span class="moreArrowSpan">&#187;</span></a></span>]</span>'+
			'		</p>');
			if (!quick) { document.write('<div class="tags">[ <b>tags:</b> '+highlight(pagesInfo[pages[tok]][3],hexConvert(getUrlParam("keyword")))+' ] </div>');}
			else { document.write('<div class="tags">[ <b>tags:</b> '+pagesInfo[pages[tok]][3]+' ] </div>');}
			document.write(''+
			'	</td>'+
			'	<td style="padding:10px; margin:0px; font-size:12px; line-height:140%;" valign="top"><b>Official</b><br />32 members<br /><img src="images/stars4.gif" width="60" height="12" alt="Four stars" border="0" /><br /><img src="images/spacer.gif" width="90" height="1" border="0" />'+
			'	</td>'+
			'</tr>');
		
		}
	}
}
