<!--BEGIN Pop-up Images Script------------------------------------------->

// Copyright 1999 - 2002 by Ray Stott, Pop-up Images Script ver 2.0
// OK to use if this copyright is included
// Script is available at http://www.crays.com/jsc

var pic = null
var popImg = null  // use this when referring to pop-up image
var picTitle = null
var imgCount = 0
var imgWinName = "popImg"

function openPopImg(picName, windowTitle, windowWidth, windowHeight){
  closePopImg()
  picTitle = windowTitle
  imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
  popImg = window.open(picName, imgWinName,
           "toolbar=no,scrollbars=no,resizable=no,width=" 
           + (parseInt(windowWidth)+20)  + ",height=" 
           + (parseInt(windowHeight)+15)) 
  }
function closePopImg(){    // close pop-up window if it is open 
  if (navigator.appName != "Microsoft Internet Explorer" 
      || parseInt(navigator.appVersion) >=4) //do not close if early IE
    if(popImg != null) if(!popImg.closed) popImg.close() 
  }
function setStatus(msg){
  status = msg
  return true
  }


// for Netscape 3+ and IE 4+
var priorPic = new Array()
var noPic = 0
var foundit = false

function openPopImg(picName,  windowTitle, windowWidth, windowHeight){
  var i = 0
  if(pic == picName && winOpen()){
    popImg.focus()
    }
  else{
    foundit = false
    for(i=0; i<=noPic; i++){
      if (priorPic[i] == picName)
        foundit = true 
      }
    pic = picName
    closePopImg()
    picTitle = windowTitle
    imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
    if(!foundit){
      priorPic[noPic++] = pic
      }
    popImg = openPopImgWin(imgWinName, windowWidth, windowHeight)
    }
  }
function openPopImgWin(imgWinName, windowWidth, windowHeight){
  var winFeatures = "toolbar=no,scrollbars=no,resizable=no,width=" 
    + windowWidth + ",height=" + windowHeight
  return window.open("pimg.htm", imgWinName, winFeatures)
  }
function winOpen(){
  if(popImg != null){ 
    if(popImg.closed != true) return true; else return false
    }  
  else
    return false
  }


// Use this function to control placement of pop-up window
// in Netscape 4+ and Internet Explorer 4+
function openPopImgWin(imgWinName, windowWidth, windowHeight){
  var leftX = 20  // distance of window's left side from left of screen
  var topY = 20   // distance of window's top side from top of screen
  var winFeatures = "toolbar=no,scrollbars=no,resizable=no,width=" 
    + windowWidth + ",height=" + windowHeight
  if (leftX>0){
    winFeatures += ",screenX=" + leftX + ",left=" + leftX	
                + ",screenY=" + topY + ",top=" + topY
    }
  return window.open("pimg.htm", imgWinName, winFeatures)
  }


function checkData()
{
	var today = new Date()

	var obj = document.searchform
	var d = obj.FromDateDay[obj.FromDateDay.selectedIndex].value
	var m = obj.FromDateMonth[obj.FromDateMonth.selectedIndex].value
	var y = obj.FromDate[obj.FromDate.selectedIndex].value
	var err=0

	fy = parseInt (y)

	y = parseInt (y) - 2000
	
	// months with 30 days
	if (m ==4 || m==6 || m==9 || m==11){
		if (d==31) {
			alert ("That month does not have 31 days.");
			return false;
		}	
	}

	if (m==2){
		if (d>29) {
			alert ("That month does not have 31 days.");
			return false;
		}
		if (d==29 && ((y/4)!=parseInt(y/4))) {
			alert ("That year is not a leap year.");
			return false;
		}
	}

	var searchDate = new Date(fy, parseInt(m)-1, parseInt(d), today.getHours(), today.getMinutes(), today.getSeconds())

	if (searchDate < today) {
		alert ("Please choose a date that is after today.");
		return false;
	}
}


    function showreviewform(iHotel)
    {
    var Url = "hotel_review.asp?hotel=" + iHotel;
    window_handle=window.open ( Url, "", "toolbar=0,resizable=1,menubar=0,location=0,status=0,scrollbars=3,width=550,height=520,screenX=30,screenY=15,left=30,top=15");
    window_handle.focus();
    }
    
    function showresortreviewform(iResort)
    {
    var Url = "resort_review.asp?resort=" + iResort;
    window_handle=window.open ( Url, "", "toolbar=0,resizable=1,menubar=0,location=0,status=0,scrollbars=3,width=550,height=520,screenX=30,screenY=15,left=30,top=15");
    window_handle.focus();
    }

    function showemailform(link)
    {
    var Url = "email.asp?url=" + link;
    window_handle=window.open ( Url, "", "toolbar=0,resizable=1,menubar=0,location=0,status=0,scrollbars=3,width=450,height=320,screenX=30,screenY=15,left=30,top=15");
    window_handle.focus();
    }

function confirmdelete()
{
var answer=confirm("This will delete this Hotel.\n Are you sure you want to continue?");
if (answer)
	return true ;
else
	return false ;
}

function confirmdeleteresort()
{
var answer=confirm("This will delete this entire Resort.\n Are you sure you want to continue?");
if (answer)
	return true ;
else
	return false ;
}

function confirmdeleteregion()
{
var answer=confirm("This will delete this entire Region.\n Are you sure you want to continue?");
if (answer)
	return true ;
else
	return false ;
}

