
MC=0
ArrivalMonth=0
AM = 0
AD = 0
DM = 0
DD = 0
ADL = 0
CLD = 0
var LastFrameRatio

function GetFormData(){

  AM = 1 + document.hotelSearchCriteriaForm.arrivalMonth.selectedIndex
  AD = 1 + document.hotelSearchCriteriaForm.arrivalDay.selectedIndex
  DM = 1 + document.hotelSearchCriteriaForm.departureMonth.selectedIndex
  DD = 1 + document.hotelSearchCriteriaForm.departureDay.selectedIndex
  ADL = 1 + document.hotelSearchCriteriaForm.adults.selectedIndex
  CLD = 1 + document.hotelSearchCriteriaForm.children.selectedIndex

}

function removeMapInfo(POI){

  GetFormData()
  
  if (window.innerWidth) {
      FrameWidth = window.innerWidth - 260
      FrameHeight=window.innerHeight-110}
  else {
      FrameWidth = document.documentElement.clientWidth - 250
      FrameHeight=document.documentElement.clientHeight-106}

  if (FrameWidth > 1340) {
      FrameWidth = 1340}
  if (FrameHeight > 950) {
      FrameHeight = 950}

  FrameRatio = (FrameWidth/FrameHeight).toFixed(2)
  LastFrameRatio = FrameRatio

  document.location = "http://www.i-maps.com/hotel-locator/usa/POI/" + POI + ".html?AM=" + AM + "&AD=" + AD + "&DM=" + DM + "&DD=" + DD + "&ADL=" + ADL + "&CLD=" + CLD + "&MC=1&FR=" + FrameRatio

}

var timer
function Resize(POI){

  if (MC>0) {  // don't go here on initial intro page
    clearTimeout(timer)
    timer=setTimeout("GetFormData(); document.location = 'http://www.i-maps.com/hotel-locator/usa/POI/" + POI + ".html?AM=" + AM + "&AD=" + AD + "&DM=" + DM + "&DD=" + DD + "&ADL=" + ADL + "&CLD=" + CLD + "&MC=2&FR=" + FrameRatio + "'",1000)
  }

}

function Reload_Map(POI){
 
	if (navigator.userAgent.indexOf("Mac") == -1) {  // If not Macintosh

		if ( MC>1 ) {   // Don't go here on the initial page or the div swap

			GetFormData()

			if (window.innerWidth) {
					FrameWidth = window.innerWidth - 260
					FrameHeight=window.innerHeight-110}
			else {
					FrameWidth = document.documentElement.clientWidth - 250
					FrameHeight=document.documentElement.clientHeight-106}

			if (FrameWidth > 1340) {
					FrameWidth = 1340}
			if (FrameHeight > 950) {
					FrameHeight = 950}

			FrameRatio = (FrameWidth/FrameHeight).toFixed(2)

			if (FrameRatio!=LastFrameRatio) {  // Go here if the window was moved during the resize event
					LastFrameRatio = FrameRatio
					document.location = "http://www.i-maps.com/hotel-locator/usa/POI/" + POI + ".html?AM=" + AM + "&AD=" + AD + "&DM=" + DM + "&DD=" + DD + "&ADL=" + ADL + "&CLD=" + CLD + "&MC=2&FR=" + FrameRatio
			}
		}
	}
}

function Rates(ID){

  document.hotelSearchCriteriaForm.hotelID.value=ID,
  document.hotelSearchCriteriaForm.submit();

}

function AllRates(){
  
  window.open("http://www.ihsadvantage.com/h/hotelAvail.do?showAvailWithList=true&hotelID=&pfs=3355&spfs=0&city=" + document.hotelSearchCriteriaForm.city.value + "&state=" + document.hotelSearchCriteriaForm.state.value + "&country=US&arrivalMonth=" + document.hotelSearchCriteriaForm.arrivalMonth.value + "&arrivalDay=" + document.hotelSearchCriteriaForm.arrivalDay.value + "&departureMonth=" + document.hotelSearchCriteriaForm.departureMonth.value + "&departureDay=" + document.hotelSearchCriteriaForm.departureDay.value + "&adults=" + document.hotelSearchCriteriaForm.adults.value + "&children=" + document.hotelSearchCriteriaForm.children.value, "_blank")

}
