  function initialize_homepage() {
    var myLatlng = new google.maps.LatLng(45.641407856435364, -73.51844787597656);
    var myOptions = {
      zoom: 10,
      center: myLatlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }

    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

    promenades = mark_it(map, 45.571050, -73.626209, 'Les promenades St-Michel', 'condo-les-promenades-st-michel.php');
    patriote = mark_it(map, 45.573123, -73.535867, 'Le Patriote', 'condo-le-patriote.php');
    logge = mark_it(map, 45.530569, -73.609215, 'Le Logge', 'condo-le-logge.php');
    villamiens = mark_it(map, 45.592229, -73.629841, 'Les Condos Villamiens', 'condo-les-condos-villamiens.php');
    germont = mark_it(map, 45.608188, -73.634341, 'Le Germont Nord', 'condo-le-germont-nord.php');
    herons = mark_it(map, 45.715499,-73.5001, 'Les grands hérons', 'condo-les-grands-herons.php');

  }

function initialize_minimap(lat, lng, it_title, it_url, canva) {
    var myLatlng = new google.maps.LatLng(lat, lng);
    var myOptions = {
      zoom: 11,
      center: myLatlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }


	if(canva == 'mini') { 
		map = new google.maps.Map(document.getElementById(canva + "map_canvas"), myOptions);
		mark_it(map, lat, lng, it_title, it_url);
	}
	else {
		map_caroussel = new google.maps.Map(document.getElementById(canva + "map_canvas"), myOptions);
		map_caroussel.setZoom(12);
		mark_it(map_caroussel, lat, lng, it_title, it_url);
	}
}

  function mark_it(current_map, lat, lng, it_title, it_url) {
	ll = new google.maps.LatLng(lat, lng); 
    var marker = new google.maps.Marker({
        position: ll,
        map: current_map, 
		icon: image,
        title: it_title,
        url: it_url,
    });


	if(it_url.length > 3) { 
		google.maps.event.addListener(marker, 'click', function() {
			window.location = it_url;		
		});
	}

	return marker;
  }

email_syntax=function(email) {
    var errorChars = ' :;`"+!#$%^&*(){}[]|/';

    for (x=0; x<errorChars.length; x++) {
        if (email.indexOf(errorChars.substring(x,x+1)) != -1) { return false; }
    }

    if (email.indexOf('@') == -1) { return false; }
    if (email.indexOf('.') == -1) { return false; }
    else { return true; }

}



function validate_empty(notempty) { 
//notempty * field id that has to have a value
//for example
//var notempty = new Array('zip', 'address', 'city', 'province', 'date', 
						 //'building', 'rooms', 'first_name', 'last_name');
var lbl;
var cterr=0;
var validate_email=0;


	err='';

	for (idx in notempty) { 
		field = notempty[idx];
		if(!$("#"+field).val()) { 
			lbl = $('label[for="' + field + '"]');

			err += lbl.text()+'<br>';

			$('#'+field).attr('class', 'error'); 
			cterr++;
        }else { 
			$('#'+field).removeClass('error'); 
		}
	}


	if(cterr > 0) { 
		if(cterr > 1) { 
			emptyHeader= emptyHeaderPlural;
		} else { 
			emptyHeader= emptyHeaderSingle;
		}

		$('#diverror').html(emptyHeader + err);
		$('#outererror').show();

		return false;
	}

	return true;
}

function validate_contact(form, which) { 
	//they are both the same right  now ;)
	var notempty = new Array('first_name', 'last_name', 'email', 'project');

	//	first fix empty fields 
	if(!validate_empty(notempty)) { return false; } 

	if(!email_syntax($('#email').val())) {

		$('#diverror').html(invalidEmail);
		$('#outererror').show();
		$('#email').attr('class', 'error'); 
		$('#email').focus();

		return false;
	}

	return true;
}



