<!--

// google maps
function initialize() {
	
	var location_center = new google.maps.LatLng(-17.705258,29.5578);
	var location_1 = new google.maps.LatLng(-17.747481, 31.121918);
	var location_2 = new google.maps.LatLng(-17.715372, 31.075151);
	var location_3 = new google.maps.LatLng(-17.801813, 31.167011);
	var location_4 = new google.maps.LatLng(-17.751364, 31.024350);
	var location_5 = new google.maps.LatLng(-17.609011, 27.366943);
	var location_6 = new google.maps.LatLng(-17.468573, 28.052216);
	var location_7 = new google.maps.LatLng(-17.726451, 27.501526);
	var location_8 = new google.maps.LatLng(-17.803611, 27.266693);
	var location_9 = new google.maps.LatLng(-17.802304, 27.407455);
	
	var contentstring_1 = '<div class="contentblack">' +
	    '<b>Greystone Park Christian Fellowship / Michael Project office</b>' +
		'<br><br>' +
	    '<li><a href="about-the-michael-project.php">Read more about The Michael Project</a><br>' +
		'<li><a href="about-greystone-park-christian-fellowship.php">Read more about Greystone Park Christian Fellowship</a>' +
		'<br><br>' +
	    '</div>';
		
	var contentstring_2 = '<div class="contentblack">' +
	    '<b>Wingate Pre-School</b>' +
		'<br><br>' +
	    '<nobr><li>Wingate is a peri-rural community close to Harare.<br></nobr>' +
		'<nobr><li>We have been working with the under-priviledged children here since 1999.<br></nobr>' +
		'<li><a href="projects-children-at-risk-detail.php?id=3">Read more about the Wingate Community project</a>' +
		'<br><br>' +
	    '</div>';
		
	var contentstring_3 = '<div class="contentblack">' +
	    '<b>Chikurubi Day Care Centre</b>' +
		'<br><br>' +
	    '<nobr><li>The Chiukurubi Day Care Centre is located in the grounds of the Female Prison to cater for the children of the inmates.<br></nobr>' +
		'<li><a href="projects-children-at-risk-detail.php?id=4">Read more about the Chikurubi Female Prison project</a>' +
		'<br><br>' +
	    '</div>';
		
	var contentstring_4 = '<div class="contentblack">' +
	    '<b>Shalom Children’s Home</b>' +
		'<br><br>' +
	    '<nobr><li>Shalom has been set up to look after abused and abandoned children.<br></nobr>' +
		'<nobr><li>Located in a beautiful house in suburban Harare, these children have a home and a family.<br></nobr>' +
		'<li><a href="projects-children-at-risk-detail.php?id=5">Read more about Shalom Children\'s Home</a>' +
		'<br><br>' +
	    '</div>';
		
	var contentstring_5 = '<div class="contentblack">' +
	    '<b>Binga Communities - Binga Town</b>' +
		'<br><br>' +
	    '<nobr><li>Binga Town, one of five locations in the Binga area, near Lake Kariba, is home to the Tonga people.<br></nobr>' +
		'<nobr><li>Working with local churches, we have been reaching out to children in this area since 2003.<br></nobr>' +
		'<li><a href="projects-children-at-risk-detail.php?id=6">Read more about the Binga Communities project</a>' +
		'<br><br>' +
	    '</div>';
	
	var contentstring_6 = '<div class="contentblack">' +
	    '<b>Binga Communities - Siabuwa</b>' +
		'<br><br>' +
	    '<nobr><li>Siabuwa, one of five locations in the Binga area, near Lake Kariba, is home to the Tonga people.<br></nobr>' +
		'<nobr><li>Working with local churches, we have been reaching out to children in this area since 2003.<br></nobr>' +
		'<li><a href="projects-children-at-risk-detail.php?id=6">Read more about the Binga Communities project</a>' +
		'<br><br>' +
	    '</div>';
	
	var contentstring_7 = '<div class="contentblack">' +
	    '<b>Binga Communities - Nsenga</b>' +
		'<br><br>' +
	    '<nobr><li>Nsenga, one of five locations in the Binga area, near Lake Kariba, is home to the Tonga people.<br></nobr>' +
		'<nobr><li>Working with local churches, we have been reaching out to children in this area since 2003.<br></nobr>' +
		'<li><a href="projects-children-at-risk-detail.php?id=6">Read more about the Binga Communities project</a>' +
		'<br><br>' +
	    '</div>';
	
	var contentstring_8 = '<div class="contentblack">' +
	    '<b>Binga Communities - Simatelele</b>' +
		'<br><br>' +
	    '<nobr><li>Simatelele, one of five locations in the Binga area, near Lake Kariba, is home to the Tonga people.<br></nobr>' +
		'<nobr><li>Working with local churches, we have been reaching out to children in this area since 2003.<br></nobr>' +
		'<li><a href="projects-children-at-risk-detail.php?id=6">Read more about the Binga Communities project</a>' +
		'<br><br>' +
	    '</div>';
	
	var contentstring_9 = '<div class="contentblack">' +
	    '<b>Binga Communities - Manjolo</b>' +
		'<br><br>' +
	    '<nobr><li>Manjolo, one of five locations in the Binga area, near Lake Kariba, is home to the Tonga people.<br></nobr>' +
		'<nobr><li>Working with local churches, we have been reaching out to children in this area since 2003.<br></nobr>' +
		'<li><a href="projects-children-at-risk-detail.php?id=6">Read more about the Binga Communities project</a>' +
		'<br><br>' +
	    '</div>';
	
	var myOptions = {
	  	zoom: 7,
	  	center: location_center,
	  	mapTypeId: google.maps.MapTypeId.ROADMAP
	};
	
	var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
	
	var infowindow_1 = new google.maps.InfoWindow({
	    content: contentstring_1
	});
	
	var infowindow_2 = new google.maps.InfoWindow({
	    content: contentstring_2
	});
	
	var infowindow_3 = new google.maps.InfoWindow({
	    content: contentstring_3
	});
	
	var infowindow_4 = new google.maps.InfoWindow({
	    content: contentstring_4
	});
	
	var infowindow_5 = new google.maps.InfoWindow({
	    content: contentstring_5
	});
	
	var infowindow_6 = new google.maps.InfoWindow({
	    content: contentstring_6
	});
	
	var infowindow_7 = new google.maps.InfoWindow({
	    content: contentstring_7
	});
	
	var infowindow_8 = new google.maps.InfoWindow({
	    content: contentstring_8
	});
	
	var infowindow_9 = new google.maps.InfoWindow({
	    content: contentstring_9
	});
	
	var marker_1 = new google.maps.Marker({
	    position: location_1, 
	    map: map, 
	    title:"Greystone Park Christian Fellowship / Michael Project office (click me)"
	});
	
	var marker_2 = new google.maps.Marker({
	    position: location_2, 
	    map: map, 
	    title:"Wingate Pre-School (click me)"
	});
	
	var marker_3 = new google.maps.Marker({
	    position: location_3, 
	    map: map, 
	    title:"Chikurubi Day Care Centre (click me)"
	});
	
	var marker_4 = new google.maps.Marker({
	    position: location_4, 
	    map: map, 
	    title:"Shalom Children’s Home (click me)"
	});
	
	var marker_5 = new google.maps.Marker({
	    position: location_5, 
	    map: map, 
	    title:"Binga Communities - Binga Town (click me)"
	});
	
	var marker_6 = new google.maps.Marker({
	    position: location_6, 
	    map: map, 
	    title:"Binga Communities - Siabuwa (click me)"
	});
	
	var marker_7 = new google.maps.Marker({
	    position: location_7, 
	    map: map, 
	    title:"Binga Communities - Nsenga (click me)"
	});
	
	var marker_8 = new google.maps.Marker({
	    position: location_8, 
	    map: map, 
	    title:"Binga Communities - Simatelele (click me)"
	});
	
	var marker_9 = new google.maps.Marker({
	    position: location_9, 
	    map: map, 
	    title:"Binga Communities - Manjolo (click me)"
	});
	
	google.maps.event.addListener(marker_1, 'click', function() {
  		infowindow_1.open(map,marker_1);
	});
	
	google.maps.event.addListener(marker_2, 'click', function() {
  		infowindow_2.open(map,marker_2);
	});
	
	google.maps.event.addListener(marker_3, 'click', function() {
  		infowindow_3.open(map,marker_3);
	});
	
	google.maps.event.addListener(marker_4, 'click', function() {
  		infowindow_4.open(map,marker_4);
	});
	
	google.maps.event.addListener(marker_5, 'click', function() {
  		infowindow_5.open(map,marker_5);
	});
	
	google.maps.event.addListener(marker_6, 'click', function() {
  		infowindow_6.open(map,marker_6);
	});
	
	google.maps.event.addListener(marker_7, 'click', function() {
  		infowindow_7.open(map,marker_7);
	});
	
	google.maps.event.addListener(marker_8, 'click', function() {
  		infowindow_8.open(map,marker_8);
	});
	
	google.maps.event.addListener(marker_9, 'click', function() {
  		infowindow_9.open(map,marker_9);
	});

}

function popUpWindow(url,popup_name,toolbar_,location_,directories_,status_,menubar_,scrollbars_,resizable_,width_,height_,page_name) {
	sealWin=window.open(url,popup_name,'toolbar=' + toolbar_ + ',location=' + location_ + ',directories=' + directories_ + ',status=' + status_ + ',menubar=' + menubar_ + ',scrollbars=' + scrollbars_ + ',resizable=' + resizable_ + ',width=' + width_ + ',height=' + height_ + '');
	self.name = page_name;
}

// here is the sample code to call the function:
// popUpWindow('index.php','give_your_popUp_a_name','0','0','0','0','0','0','0','359','225','give_your_page_where_you_are_putting_this_code_a_name')
// for the following: toolbar_,location_,directories_,status_,menubar_,scrollbars_,resizable_, the options are '0' or '1'

function changeCurrencySelection(what) {
	if (what == "Other") {
		document.getElementById(what).checked = true;
	} else {
		document.getElementById('currency_other').value = "";
	}
}

function checkDonation() {
	var str1, str2, str3, str4, str5
	var errFlag = false;
	var errCount = 0;
	var errMsg = "";
	var errExp = new RegExp(" ", "g");
	
	str1 = document.donation.name.value;
	str2 = document.donation.email.value;
	str3 = document.donation.address_1.value;
	str4 = document.donation.city.value;
	str5 = document.donation.country.value;
	
	str1 = str1.replace(errExp, "")
	str2 = str2.replace(errExp, "")
	str3 = str3.replace(errExp, "")
	str4 = str4.replace(errExp, "")
	str5 = str5.replace(errExp, "")
		
	if (str1.length == 0){
		errCount += 1;
		errFlag = true;
		errMsg += "- your name\n";
		document.donation.name.focus();
	}
	
	if (str2.length == 0){
		errCount += 1;
		errFlag = true;
		errMsg += "- email address\n";
		document.donation.email.focus();
	}
	
	if (str3.length == 0){
		errCount += 1;
		errFlag = true;
		errMsg += "- your address\n";
		document.donation.address_1.focus();
	}
	
	if (str4.length == 0){
		errCount += 1;
		errFlag = true;
		errMsg += "- city / town\n";
		document.donation.city.focus();
	}
	
	if (str5.length == 0){
		errCount += 1;
		errFlag = true;
		errMsg += "- country\n";
		document.donation.country.focus();
	}
	
	if (errFlag == true) {
		if (errCount > 1){
			errMsg = "The following fields are required:\n" + errMsg;
		}
		else {	
			errMsg = "The following field is required:\n" + errMsg;
		}
		alert(errMsg);
		return false
	} 
	else {
		return validateEmail('donation');
	}
}

function checkContact() {
	var str1, str2, str3
	var errFlag = false;
	var errCount = 0;
	var errMsg = "";
	var errExp = new RegExp(" ", "g");
	
	str1 = document.contact.name.value;
	str2 = document.contact.email.value;
	str3 = document.contact.message.value;
	
	str1 = str1.replace(errExp, "")
	str2 = str2.replace(errExp, "")
	str3 = str3.replace(errExp, "")
		
	if (str1.length == 0){
		errCount += 1;
		errFlag = true;
		errMsg += "- your name\n";
		document.contact.name.focus();
	}
	
	if (str2.length == 0){
		errCount += 1;
		errFlag = true;
		errMsg += "- your email address\n";
		document.contact.email.focus();
	}
	
	if (str3.length == 0){
		errCount += 1;
		errFlag = true;
		errMsg += "- your message\n";
		document.contact.message.focus();
	}
	
	if (errFlag == true) {
		if (errCount > 1){
			errMsg = "The following fields are required:\n" + errMsg;
		}
		else {	
			errMsg = "The following field is required:\n" + errMsg;
		}
		alert(errMsg);
		return false
	} 
	else {
		return validateEmail('contact');
	}
}

function validateEmail(what) {
	var str1
	var errFlag = false;
	var errCount = 0;
	var errMsg = "";
	var errExp = new RegExp(" ", "g")
	
	str1 = document.getElementById(what).email.value;
		
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str1)){
		//do nothing
	} else {
		errFlag = true;
		errMsg += "- email address\n";
		document.getElementById(what).email.focus();
	}
	
	if (errFlag == true) {
		errMsg = "The following field is not valid:\n" + errMsg;
		alert(errMsg);
		return false
	} else {
		return true
	}
}

// -->
