function apBCCCheckAll(fmobj)
{
	for (var i=0;i<fmobj.elements.length;i++)
	{
		var e = fmobj.elements[i];
		if ((e.name != 'allbox') && (e.type=='checkbox') && (!e.disabled))
		{
			e.checked = fmobj.allbox.checked;
		}
	}
}

function apBCCCheckCheckAll(fmobj)
{	
	var TotalBoxes = 0;
	var TotalOn = 0;
	for (var i=0;i<fmobj.elements.length;i++)
	{
		var e = fmobj.elements[i];
		if ((e.name != 'allbox') && (e.type=='checkbox'))
		{
			TotalBoxes++;
			if (e.checked)
			{
				TotalOn++;
			}
		}
	}
	if (TotalBoxes==TotalOn)
	{
		fmobj.allbox.checked=true;
	}
	else
	{
		fmobj.allbox.checked=false;
	}
}

function apBCCformCheckU(input)
{

if (document.getElementById(input).fprogram.value == "")
{
	alert ("Please fill out a program name");
	return false;
}
if (document.getElementById(input).fhours.value == "")
{
	alert ("Please enter the operating hours");
	return false;
}
if (document.getElementById(input).forganization.value == "")
{
	alert ("Please fill out the organization name");
	return false;
}
if (document.getElementById(input).fdescription.value == "")
{
	alert ("Please write a description of the program");
	return false;
}
if (document.getElementById(input).fstreetnum.value == "")
{
	alert ("Please enter the street number");
	return false;
}
if (document.getElementById(input).fstreetname.value == "")
{
	alert ("Please write the name of the street");
	return false;
}
if (document.getElementById(input).fstreettype.value == "")
{
	alert ("Please fill out the street type (st/dr/blvd/ave)");
	return false;
}
if (document.getElementById(input).fcity.value == "")
{
	alert ("Please enter a city");
	return false;
}
if (document.getElementById(input).fprovince.value == "")
{
	alert ("Please enter the province");
	return false;
}
if (document.getElementById(input).fpostal.value == "")
{
	alert ("Please enter a postal code");
	return false;
}
if (document.getElementById(input).fphone.value == "")
{
	alert ("Please enter a business phone number");
	return false;
}
if (document.getElementById(input).fkeyword.value == "")
{
	alert ("Please enter one or several keywords for better searchability");
	return false;
}
	var x=document.getElementById(input);
	for (var i=0;i<x.length;i++)
	  {
		var output = x.elements[i].value;
		output = output.replace(/["“”]/g, '&quot;');
		output = output.replace(/['‘’]/g,"&#39;");
		x.elements[i].value = output;
	  }
	document.getElementById(input).submit();
}

function apBCCformCheck(input)
{
	var x=document.getElementById(input);
	for (var i=0;i<x.length;i++)
	  {
		var output = x.elements[i].value;
		output = output.replace(/["“”]/g, '&quot;');
		output = output.replace(/['‘’]/g,"&#39;");
		x.elements[i].value = output;
	  }
	document.getElementById(input).submit();
}

function apBCCshowDisclaimer()
{
	alert("The Black Creek Community Capacity Building Project, CLASP, ANC and the City of Toronto, Participating Members, (refered to collectively in this disclaimer as the \"Providers\") provides the on-line Black Creek Community Connect system (\"System\") on an \"as is\", \"as available\", basis.\n\nThe Providers do not make any express or implied warranties, representations or endorsements with respect to the System, including but not limited to, warranties as to usefulness, completeness, accuracy and reliability and the Providers will not accept any responsibility for data improperly entered by the Providers' staff.\n\nFurther, the Providers do not represent and warrant that the System will be available or meet your requirements, that access will be uninterrupted, that there will be no delays, failures or errors or omissions or loss of transmitted information, that no viruses or other contaminating or destructive properties will be transmitted or that no damage will occur to your computer system.\n\nAs a user of the System, you accept sole responsibility for adequate protection and backup of your data, hardware and software and to take reasonable and appropriate precautions against viruses and other contaminating or destructive properties.");
}