function showHide(id) {
el = document.getElementById(id);
if (el.style.display == 'none')
	{
		el.style.display = '';
	} else {
		el.style.display = 'none';
	}
}


function searchFunds(str1, str2, str3, str4, str5)
{
	
$("#loadingdiv").css("display","block");

var fundsurl="searchfunds.php?country="+str1+"&fund="+str2+"&page="+str3+"&limit="+str4+"&export="+str5+"&sid="+Math.random();

var html = $.ajax({
  url: fundsurl,
  async: false,
  success: function(){
     $("#loadingdiv").css("display","none");
  }
 }).responseText;
if (str5 == 0)
	{
	$("#searchresults").empty();
	$("#searchresults").append(html);
	} else {
	this.location.href = fundsurl;
	} 
}

function searchProjects(str1, str2, str3, str4, str5, str6)
{

$("#loadingdiv").css("display","block");
	
var projurl="searchprojects.php?country="+str1+"&main="+str2+"&sub="+str3+"&page="+str4+"&limit="+str5+"&export="+str6+"&sid="+Math.random();
var html = $.ajax({
  url: projurl,
  async: false,
  success: function(){
     $("#loadingdiv").css("display","none");
  }
 }).responseText;
if (str6 == 0)
	{
	$("#searchresults").empty();
	$("#searchresults").append(html);
	} else {
	this.location.href = projurl;
	}
}

function searchFree(str1, str2, str3, str4)
{

$("#loadingdiv").css("display","block");
	
var projurl="searchfree.php?freetext="+str1+"&page="+str2+"&limit="+str3+"&export="+str4+"&sid="+Math.random();
var html = $.ajax({
  url: projurl,
  async: false,
  success: function(){
     $("#loadingdiv").css("display","none");
  }
 }).responseText;
if (str4 == 0)
	{
	$("#searchresults").empty();
	$("#searchresults").append(html);
	} else {
	this.location.href = projurl;
	}
}