var $jQ=jQuery.noConflict();

/*
* Pressing Enter key will work pressing submit button
*/
function detectEnterKey(e,callbackFunction)
{
     var key;     
     if(window.event)
          key = window.event.keyCode; //IE
     else
          key = e.which; //firefox     

     if(key == 13){
	 	//return "EnterPressed";
		if(callbackFunction != null)
			callbackFunction();
		else
			return false;
	 }else
		return key;
}

/*

*/
function locateQuickAddressOnMap(){
	showQuickAddress($jQ('#mapcms_find_quick_address').val());
	$jQ('#widget-mapcms-quick-address-response').html('');
}
/*
This function id dependent on mapcms
It puts marker on the address
*/
function showQuickAddress(theQuickAddress){	
	_l=new henworx.MapCms.Location(theQuickAddress)
	if(_l.latlng.lat()){
	_marker = new GMarker(_l.latlng);
	GEvent.addListener(_marker, "click", function (){
																_marker.openInfoWindowHtml(theQuickAddress);
													})
	
	gMapCms.map.addOverlay(_marker);
	gMapCms.setCenter(_l);
	}
	else{
		$jQ('#widget-mapcms-quick-address-response').html('<p class="error">Address not found</p>');
	}
}