function php_urlencode(str) { 
	str = escape(str);
	return str.replace(/[*+\/@]|%20/g,
		function (s) { 
			switch (s) {
				case "*": s = "%2A"; break;
				case "+": s = "%2B"; break;
				case "/": s = "%2F"; break;
				case "@": s = "%40"; break;
				case "%20": s = "+"; break;
			}
		return s;
		}
	);
}

function myclick(marker) {
	//alert(marker);
	google.maps.event.trigger(markers[marker], "click");	
      }
      
function createMarker(tableText,latlng,map,i,markers,image,markerText)
    {
    	markers[i] = new google.maps.Marker({position: latlng, map: map, icon: image});
    	google.maps.event.addListener(markers[i], "click", function() {
    		if (infowindow) infowindow.close();
    		infowindow = new google.maps.InfoWindow({content: markerText});
    		infowindow.open(map,markers[i]);
    	});
    	
    	$('#crime-list').append("<tr class='incident' onclick='myclick(" + i + ");'>" + tableText + "</tr>");
    	$('#incident_table').trigger('update');
    	return markers[i];
    }
    
function reloadFrames()
{
  $('iframe').each( function() { 
    this.src = this.src + '?r=' + Math.round(Math.random()*1000000);
    

  });
  mistats_resend();
}


