// FUNCTIONS
//<![CDATA[

 // Creates a marker at the given point waiting to be clicked
 function createMarkerWithInfo(point, html, map, currentID) {
   var marker = new GMarker(point);
   GEvent.addListener(marker, "click", function() {
    if (map.getZoom()<11) map.setZoom(11);
    marker.openInfoWindowHtml(html);
   });
   GEvent.addDomListener(document.getElementById(currentID), "click", function() {
    window.scrollTo(0,0);   
    if (map.getZoom()<11) map.setZoom(11);
    marker.openInfoWindowHtml(html);
   });   
   return marker;
 }
 
function showmaps()
 {
    
 // Make a new map
 var map = new GMap2(document.getElementById("map"));
 map.setCenter(MapDefaultCenter, MapDefaultZoom);
 map.setUIToDefault();
 
 drawCounty(map);  // from javascript folder     
 
 // start loop
 for (q in mapArray){

  var point = new GLatLng(mapArray[q][0], mapArray[q][1]);
  var currentID = mapArray[q][2];
  var html=mapArray[q][3];
  map.addOverlay(createMarkerWithInfo(point, html, map, currentID));  

  };
  // end loop
 }    // end function showmaps
//]]>

function getLocation(thisformid){
	var hotelForm=document.forms[thisformid];
	var locstr=hotelForm.city.value;
	var locarr=locstr.split(",");
	var city=locarr[0];
	var state=locarr[1];
	var ihsstring="http://www.ihsadvantage.com/h/hotels/"+city+"/"+state+"/usa?pfs=2960&arrivalMonth="+hotelForm.arrivalMonth.value+"&arrivalDay="+hotelForm.arrivalDay.value+"&departureMonth="+hotelForm.departureMonth.value+"&departureDay="+hotelForm.departureDay.value+"&orderBy=4&showAvailWithList=true";
	location.href=ihsstring;		
}	

function goJump(){
	var locstr=document.getElementById('hotelJump').value;
	locstr="#"+locstr;
	location.href=locstr;		
}	
