function insert_text(obj, text){
	jQuery('#'+obj).val(text);
}
function show_popup_on_map(markerId){
	if(hidePopupForMarker()){
		showPopupForMarker(markerId)
	}

}

function markerSelected(markerId)
{
	//alert("marker " + markerId + " selected");
}

function markerUnselected(markerId)
{
	//jQuery("#tr_catalog"+markerId).removeClass("tr_selected");
	//alert("marker " + markerId + " unselected");
}

function onMapClick(lon, lat)
{
	if(map.getZoom()>=4){
		jQuery('#right_content').html('<img src="/lib/i/loadingAnimation.gif">');
		
		jQuery.get('get_point_by_click.html',{
				x1: lon, 
				y1: lat, 
				uid: Math.random()},
				function(data){
					eval(data);
					if(hidePopupForMarker()){
						setZoom(4);
						if(showPoints(pointsArr)){
							
							showPopupForMarker(markerId);
							jQuery.get('get_info_by_pos.html', {
								x1: lon, 
								y1: lat, 
								uid: Math.random()}, 
								function(data){
									
									jQuery('#right_content').html(data);
								}
							);
						}	
					}
					
			});
	}
}

function onViewChanged(x1, y1, x2, y2, zoom)
{
    //alert(x2);
}

