	function class_delete(id){
		if (confirm("Are you sure you want to delete this ad?")){
			window.location ="classifieds.html?action=class_delete&class_id=" + id
		}	
	}
	
	function textCounter(field, countfield, maxlimit) {
		if (field.value.length > maxlimit) // if too long...trim it!
			field.value = field.value.substring(0, maxlimit);
			// otherwise, update 'characters left' counter
		else 
			countfield.value = maxlimit - field.value.length;
	}

	function event_delete(id){
		if (confirm("Are you sure you want to delete this event?")){
			window.location ="events.html?action=event_delete&event_id=" + id
		}
	}
	
	function show_map (bus_latt,bus_long,map_id){
		var map_id = new GMap2(document.getElementById(map_id));
		map_id.addControl(new GSmallMapControl());
		map_id.setCenter(new GLatLng(bus_latt,bus_long), 13);
		var point = new GLatLng(bus_latt,bus_long);
  		map_id.addOverlay(new GMarker(point));
	}
	
	
	function go_directions(){
		var s_addr = document.getElementById('saddr').value;
		var d_addr = document.getElementById('daddr').value;
		var go_addr = "http://maps.google.com/maps?saddr="+s_addr+"&daddr="+d_addr;
		window.open(go_addr, "");
		return false;
	}
	
	function send_mail(n){
		b = unescape(n);
		var a = '';
		for (i=0;i<b.length;i++){
			a += String.fromCharCode(b.charCodeAt(i)-1);
		}
		window.location = "mailto:"+ unescape(a) +"?subject=Sent from Kawartha Lakes Online.";
	}

