// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults


var map; // this fixes IE conflict between dom id's and js global var names IE=CRAZAY



function openMapPopInfo(marker) {

if (mapopen == true) {
  GEvent.trigger(marker, "click");
} else {
 openMap();
 GEvent.trigger(marker, "click");
}
		
return false;
		
}

// dupe w/o panTo

		function openMap() {
		
      mapopen = true;

			$j('#map').children('#google').unbind('click');		
			$j('#map').animate({ height: "400px" }, 300).addClass('enlarged');
			$j('#google').animate({ height: "400px" }, 300);

			$j('#map a.enlarge').hide();
				
			$j('div.fade').animate({ opacity: "0", height: "400px" }, 500, function() {
			
				$j(this).hide();

				setTimeout(function() {

					map.checkResize();
          var topLeft = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(10,10));
          var topLeftLower = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(10,40));
					map.addControl(mapControls, topLeftLower);
					map.addControl(mapType, topLeft);
					map.enableScrollWheelZoom();
	
					$j('#map a.close').show();

				}, 400);
							
			});

			return false;
		
		}



function checkEnter(e){ //e is event object passed from function invocation
var characterCode //literal character code will be stored in this variable

if(e && e.which){ //if which property of event object is supported (NN4)
e = e
characterCode = e.which //character code is contained in NN4's which property
}
else{
e = event
characterCode = e.keyCode //character code is contained in IE's keyCode property
}

if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
$('searchform_actual').submit(); //submit the form
return false
}
else{
return true
}

} 

