function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function getSelected(obj){
 obj.action = window.location.pathname;
 obj.submit();
}

function openDetail(sURL, iRefNum, iPicSeq, iNumPic)
{
	var sNewURL;
	sNewURL = sURL + '/PopupPic.cfm?lgpic=' + iRefNum + '&pic_seq=' + iPicSeq + '&NumPic=' + iNumPic;
	wDetail = window.open(sNewURL ,'wDetail','resizable=yes,scrollbars=yes,status=no,toolbar=no,height=520,width=550,top=25,left=75');
	wDetail.focus();
}

function openSPC()
{
	var sNewURL;
	sNewURL = '/cvv.htm';
	wSPC = window.open(sNewURL ,'wSPC','resizable=yes,scrollbars=yes,status=no,toolbar=no,height=700,width=500');
	wSPC.focus();
}

function openSmallCal(sURL, pRefNum, pMonth, pYear)
{
	sNewURL = sURL + '/PopupCalendar.cfm?ref_num=' + pRefNum + '&month=' + pMonth + '&year=' + pYear;
	wCalendar = window.open(sNewURL , 'wCalendar', 'resizable=yes,scrollbars=no,status=no,toolbar=no,height=300,width=530,top=25,left=75');
	wCalendar.focus();
}

function openTranslate(sURL)
{
	top.location.href = sURL;
}

function Favorite(){
if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
  var url="http://www.perfectplaces.com/";
  var title="Perfect Places Vacation Rental Properties";
  window.external.AddFavorite(url,title);
   }
   else {
	  if(navigator.appName == "Netscape")
		 alert ("Please press Ctrl-D to add www.perfectplaces.com your favorites");
   }
}

function openCurrency(sURL,sC)
{
	var sNewURL;
	sNewURL = sURL + '/currency_converter.cfm';
	if(sC != undefined){
		sNewURL = sNewURL + '?c=' + sC;
	}
	currency_convert = window.open(sNewURL,'currency_convert','resizable=yes,scrollbars=no,status=no,toolbar=no,height=180,width=600,top=25,left=75');
	currency_convert.focus();
}

function openMapWindow(url)
{
	window.open(url,"Window","scrollbars, width=670,height=710,resizable");
}

function openRentorsOrgWindow(url)
{
	window.open(url,"Window","scrollbars, width=700,height=640,resizable");
}

function openBookQuestion(url)
{
	var sNewURL;
	sNewURL = '/bookQuestion.htm';
	wBook = window.open(sNewURL ,'wBook','resizable=yes,scrollbars=yes,status=no,toolbar=no,height=600,width=500');
	wBook.focus();
}

function clearCriteria(clearType) {
	if (clearType == "avail") {
	document.getElementById("resetAvail").checked=true;
	}
	else if (clearType == "filterUnknown") {
	document.getElementById("filterUnknown").checked=false;
	}
	else if (clearType == "pet_friendly") {
	document.getElementById("pet_friendly").checked=false;
	}		
	else if (clearType == "handicap") {
	document.getElementById("handicap").checked=false;
	}		
	else if (clearType == "onlineBooking") {
	document.getElementById("showOnlineBooking").checked=false;
	}		
	else if (clearType == "accom") {
	document.getElementById("accomodations").selectedIndex = 0;
	}		
	else if (clearType == "beds") {
	document.getElementById("num_bedrooms").selectedIndex = 0;
	}		
	else if (clearType == "interest") {
	document.getElementById("category").selectedIndex = 0;
	}	
	else if (clearType == "pool") {
	document.getElementById("pool").checked = false;
	}		
	else if (clearType == "internet") {
	document.getElementById("internet").checked = false;
	}		
	document.getElementById("searchForm").submit();
}

function showCityList(ListNum) {
	document.getElementById("cityList" + ListNum).style.display = "block";
	document.getElementById("cityListLink" + ListNum).style.display = "block";
	document.getElementById("cityListLink" + ListNum).innerHTML='<a href="javascript:hideCityList(' + ListNum + ');" style="text-decoration:none; color:#666666;"><img src="/site_image/MinusSign.gif" border="0"> Click to hide city list</a>';
}

function hideCityList(ListNum) {
	document.getElementById("cityList" + ListNum).style.display = "none";
	document.getElementById("cityListLink" + ListNum).innerHTML='<a href="javascript:showCityList(' + ListNum + ');" style="text-decoration:none; color:#666666;"><img src="/site_image/PlusSign.gif" border="0"> Click to show city list</a>';
}
