function getCookieVal (offset) {  
var endstr = document.cookie.indexOf (";", offset);  
if (endstr == -1)    
endstr = document.cookie.length;  
return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;  
var i = 0;  
while (i < clen) 
  {var j = i + alen;    
   if (document.cookie.substring(i, j) == arg)      
   return getCookieVal (j);    
   i = document.cookie.indexOf(" ", i) + 1;    
   if (i == 0) break;   
  }  
return null;

}

function getAllCookies() { 
var cookies;
propertycount = 0;   // global var
ratingcount = 0;	   // global var
var everycookievalue = document.cookie; 
var pairsSplit = everycookievalue.split(";"); 
var patternNospace = /[^\s]+/; 
var finalName; 
var finalValue; 
for ( count=0 ; ( pairsSplit[count] != undefined ) ; count++ ) 
   {elementsSplit = pairsSplit[count].split("="); 
    finalName = elementsSplit[0].match(patternNospace); 
    finalName = finalName + '';   						// converts finalName to type string
    // finalValue = elementsSplit[1].match(patternNospace);
    finalValue = GetCookie(finalName);
    // property052705-10424=1
    if (  ((finalName.substring(0,8) == 'property') && (finalName.substring(14,15) == '-') && (finalValue == 1))    ||
          ((finalName.substring(0,8) == 'OLDSTYLE') && (finalValue == 1)) 
       )
      {// presumes no other cookie will have a value of 1. Ignores possibility of someone entering a "1" for notes. . .
       cookies = cookies + finalName + ' ';
       propertycount = propertycount + 1;
      }
    // if ((finalName.substring(0,8) == 'property') && (finalName.substring(20,27) == '_rating'))
    if (finalName.match('_rating'))
      {cookies = cookies + finalName + ' ';
       ratingcount = ratingcount + 1;
      }
   } 

return cookies;

} 

function SetCookie(cookieName,cookieValue,nDays) { 
var today = new Date(); 
var expire = new Date(); 
if (nDays==null || nDays==0) 
   {nDays=720;}
expire.setTime(today.getTime() + 3600000*24*nDays); 
document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString(); 

} 

function Set_Cookie (name,value,expires,path,domain,secure) { 

// set time, it's in milliseconds 
var today = new Date(); 
today.setTime( today.getTime() ); 

/* 
if the expires variable is set, make the correct 
expires time, the current script below will set 
it for x number of days, to make it for hours, 
delete * 24, for minutes, delete * 60 * 24 
*/ 

if ( expires ) 
{ expires = expires * 1000 * 60 * 60 * 24; } 

var expires_date = new Date( today.getTime() + (expires) ); 

document.cookie = name + "=" +escape( value ) + 
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) + 
( ( secure ) ? ";secure" : "" ); 

}

//---------------------------------------------------------------------------------------------------------------------------------
function DisplayTravelFolderForTAClient (taid,twidth,theight,tcellpadding) { 

var firstname = GetCookie('firstname');
var lastname = GetCookie('lastname');

if ((firstname == null) || (firstname  == "") || (lastname == null) || (lastname  == ""))
   {
document.write('<img src="http://www.villasintl.com/newdesign/spacer.gif" width=100 height=1 border=0><table width="'+twidth+'" height="'+theight+'" border="0" cellspacing="1" cellpadding="'+tcellpadding+'" bgcolor="#004646">');
document.write('<tr align="middle">');
document.write('<td valign="middle" bgcolor="#FFFFFF">');
document.write('<table width="width=100%" border="0" cellspacing="0" cellpadding="0">');

document.write('<tr><td valign=top><div class="tftext3">TRAVEL FOLDER FOR YOUR CLIENTS</div><div class="tftext4">');
cookies = getAllCookies();
document.write('<br>On your <a href="http://www.villasintl.com/cgi-bin/travelagents/clientcorrespondence.cgi" class=underlinetext><b>VITA home page</b></a>, press "travel folder login" for one of your clients.</b></div>');
document.write('</div></td></tr>');

document.write('</table></div></td></tr></table>');

document.write('<table width="'+twidth+'" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr><td bgcolor="#FFFFFF"><div align="center"><a href="http://www.villasintl.com/cgi-bin/travelagents/clientcorrespondence.cgi" class=underlinetext><b>Your VITA Home Page</b></a><map name="travelfolder"><area shape="rect" coords="95,6,149,19" href="http://www.villasintl.com/cgi-bin/travelfolder1/signout.cgi" alt="Sign Out"><area shape="rect" coords="38,5,92,20" href="http://www.villasintl.com/cgi-bin/travelfolder1/viewtravelfolder.cgi" alt="View"></map></div></td>');
document.write('</tr></table>');

   }
  else
   {

document.write('<img src="http://www.villasintl.com/newdesign/spacer.gif" width=100 height=1 border=0><table width="'+twidth+'" height="'+theight+'" border="0" cellspacing="1" cellpadding="'+tcellpadding+'" bgcolor="#004646">');
document.write('<tr align="middle">');
document.write('<td valign="middle" bgcolor="#FFFFFF">');
document.write('<table width="width=100%" border="0" cellspacing="0" cellpadding="0">');

document.write('<tr><td valign=top><div class="tftext3">TRAVEL FOLDER FOR YOUR CLIENT<br><font color=0066CC>'+firstname+' '+lastname+'</font></div><div class="tftext4">');
cookies = getAllCookies();
document.write('<br><div align=right><b><a href="http://www.villasintl.com/cgi-bin/travelfolder1/viewtravelfolder.cgi">properties: '+propertycount+'</a></b>');
document.write('<br><b><a href="http://www.villasintl.com/cgi-bin/travelfolder1/viewemail.cgi">messages: 0</a></b></div>');
document.write('</div></td></tr>');

document.write('</table></div></td></tr></table>');

document.write('<table width="'+twidth+'" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr><td bgcolor="#FFFFFF"><div align="center"><img src="http://www.villasintl.com/newdesign/tfmenu2.jpg" width="150" height="26" border="0"  usemap="#travelfolder"><br><a href="http://www.villasintl.com/cgi-bin/travelagents/clientcorrespondence.cgi" class=underlinetext><b>Your VITA Home Page</b></a><map name="travelfolder"><area shape="rect" coords="95,6,149,19" href="http://www.villasintl.com/cgi-bin/travelfolder1/signout.cgi" alt="Sign Out"><area shape="rect" coords="38,5,92,20" href="http://www.villasintl.com/cgi-bin/travelfolder1/viewtravelfolder.cgi" alt="View"></map></div></td>');
document.write('</tr></table>');

  }

}

//---------------------------------------------------------------------------------------------------------------------------------
function DisplayTravelFolderNew (twidth,theight,tcellpadding) { 

// This function needs to do two things:
// 1) Prior to a permanent travel folder being created, it needs to: 
//		a) display "no properties in your folder"; or (b) display "n properties in your folder" and display "View" and "Contact Us" buttons.
// 2) After a permanent travel folder has been created, it needs to display "n properties in your folder" and display "View" button.


var tfid = GetCookie('tfid');
var cook = document.cookie;

if ((twidth == null) || (twidth == ""))
   {twidth=150;}
if ((theight == null) || (theight == ""))
   {theight=87;}
if ((tcellpadding == null) || (tcellpadding == ""))
   {tcellpadding=5;}

var taid = GetCookie('taid');
var firstname = GetCookie('firstname');
var lastname = GetCookie('lastname');
if ((taid != null) && (taid != ""))
   {DisplayTravelFolderForTAClient(taid,twidth,theight,tcellpadding);
    return(true);}


// Find out how many properties are in temporary "cookie" folder



// 1) Prior to a permanent travel folder being created, it needs to: 
//		a) display "no properties in your folder"; or (b) display "n properties in your folder" and display "View" and "Contact Us" buttons.

if ((tfid == null) || (tfid == ""))
   {// case: pre-contact temporary travel folder
    document.write('<img src="http://www.villasintl.com/newdesign/spacer.gif" width=100 height=1 border=0><table width="'+twidth+'" height="'+theight+'" border="0" cellspacing="1" cellpadding="'+tcellpadding+'" bgcolor="#004646">');
    document.write('<tr align="middle">');
    document.write('<td valign="middle" bgcolor="#FFFFFF">');
    document.write('<table width="width=100%" border="0" cellspacing="0" cellpadding="0">');

    cookies = getAllCookies();
    if (propertycount == 0)
       {message = 'Add one or more properties that interest you, then <b>contact us (by <a href="http://www.villasintl.com/cgi-bin/travelfolder1/viewtemptravelfolder.cgi#form" class=underlinetext>form</a> or phone)</b> for price and availability.'}
     else
       {message = 'Add as many properties as you like! Then <b>contact us (by <a href="http://www.villasintl.com/cgi-bin/travelfolder1/viewtemptravelfolder.cgi#form" class=underlinetext>form</a> or phone)</b>, so we can help you with price, availability, alternative properties, and booking.'}

    if (twidth == 150)
       {document.write('<tr><td valign=top><div class="tftext3">YOUR TRAVEL FOLDER</div><div class="tftext4">'+message);
        document.write('<br><br><div align=right><b><a href="http://www.villasintl.com/cgi-bin/travelfolder1/viewtemptravelfolder.cgi">properties: '+propertycount+'</a></b>');
        document.write('<br><div align=right><b><a href="http://www.villasintl.com/cgi-bin/travelfolder1/viewtemptravelfolder.cgi">rated by you: '+ratingcount+'</a></b>');
        // document.write('<br>'+document.cookie);
        document.write('</div></td></tr>');
       }
      else
       {document.write('<tr><td valign=top><div class="tftext3">YOUR TRAVEL FOLDER</div><div class="tftext4">'+message);
        document.write('<br><br><div align=right><b><a href="http://www.villasintl.com/cgi-bin/travelfolder1/viewtemptravelfolder.cgi">properties: '+propertycount+'</a></b>');
        document.write('<br><div align=right><b><a href="http://www.villasintl.com/cgi-bin/travelfolder1/viewtemptravelfolder.cgi">rated by you: '+ratingcount+'</a></b>');
        // document.write('<br>'+document.cookie);
        document.write('</div></td></tr>');
       }

    document.write('</table></div></td></tr></table>');

    document.write('<table width="'+twidth+'" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr><td bgcolor="#FFFFFF"><div align="center"><img src="http://www.villasintl.com/newdesign/tfmenu3.jpg" width="150" height="26" border="0" vspace=2 usemap="#travelfolder"><map name="travelfolder"><area shape="rect" coords="95,6,149,19" href="http://www.villasintl.com/cgi-bin/travelfolder1/viewtemptravelfolder.cgi#form" alt="Contact Us"><area shape="rect" coords="38,5,92,20" href="http://www.villasintl.com/cgi-bin/travelfolder1/viewtemptravelfolder.cgi" alt="View"></map></div></td></tr>');
    document.write('<tr><td bgcolor="#FFFFFF">Already have a permanent travel folder? <a href="http://www.villasintl.com/cgi-bin/travelfolder1/account_signin.cgi"><b>Sign in</b></a>.</td></tr>');
    document.write('</table>');
   }
 else
   {// case: post-contact travel folder with a travel folder id: tfid 

    var firstname = GetCookie('firstname');
    var firstnamesubstrings=firstname.split('+');

document.write('<img src="http://www.villasintl.com/newdesign/spacer.gif" width=100 height=1 border=0><table width="'+twidth+'" height="'+theight+'" border="0" cellspacing="1" cellpadding="'+tcellpadding+'" bgcolor="#004646">');
    document.write('<tr align="middle">');
    document.write('<td valign="middle" bgcolor="#FFFFFF">');
    document.write('<table width="width=100%" border="0" cellspacing="0" cellpadding="0">');

    document.write('<tr><td valign=top><div class="tftext3">YOUR TRAVEL FOLDER</div><div class="tftext4">');
    document.write('You are signed in, ');
    for (i=0; i < firstnamesubstrings.length; ++i)
         {document.write(firstnamesubstrings[i]);}
    cookies = getAllCookies();
    document.write('!<br><br><div align=right><b><a href="http://www.villasintl.com/cgi-bin/travelfolder1/viewtravelfolder.cgi">properties: '+propertycount+'</a></b>');
    document.write('<br><b><a href="http://www.villasintl.com/cgi-bin/travelfolder1/viewemail.cgi">messages: 0</a></b></div>');
    document.write('</div></td></tr>');

    document.write('</table></div></td></tr></table>');

    document.write('<table width="'+twidth+'" border="0" cellspacing="0" cellpadding="0">');
    document.write('<tr><td bgcolor="#FFFFFF"><div align="center"><img src="http://www.villasintl.com/newdesign/tfmenu2.jpg" width="150" height="26" border="0"  usemap="#travelfolder"><map name="travelfolder"><area shape="rect" coords="95,6,149,19" href="http://www.villasintl.com/cgi-bin/travelfolder1/signout.cgi" alt="Sign Out"><area shape="rect" coords="38,5,92,20" href="http://www.villasintl.com/cgi-bin/travelfolder1/viewtravelfolder.cgi" alt="View"></map></div></td>');
    document.write('</tr></table>');

   }

}

//---------------------------------------------------------------------------------------------------------------------------------
function DisplayTravelFolder (twidth,theight,tcellpadding) { 

// var newdesign = GetCookie('newdesign');

var olddesign = GetCookie('olddesign');

if (olddesign != 1)
   {SetCookie('newdesign',1);
    DisplayTravelFolderNew(twidth,theight,tcellpadding);
    return(true);
   }

var tfid = GetCookie('tfid');
// var cook = document.cookie;

if ((twidth == null) || (twidth == ""))
   {twidth=150;}
if ((theight == null) || (theight == ""))
   {theight=87;}
if ((tcellpadding == null) || (tcellpadding == ""))
   {tcellpadding=5;}

if ((tfid == null) || (tfid == ""))
   {document.write('<img src="http://www.villasintl.com/newdesign/spacer.gif" width=100 height=1 border=0><table width="'+twidth+'" height="'+theight+'" border="0" cellspacing="1" cellpadding="'+tcellpadding+'" bgcolor="#004646">');
    document.write('<tr align="middle">');
    document.write('<td valign="middle" bgcolor="#FFFFFF">');
    document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0">');

    if (twidth == 150)
       {document.write('<tr><td valign=top><div class="tftext2">TRAVEL FOLDER</div><div class="tftext">See some properties you like? Set up your own travel folder and keep them for future reference.</div></td></tr>');
       }
      else
       {document.write('<tr><td valign=top><div class="tftext2">TRAVEL FOLDER</div><div class="tftext">See some properties you like? Set up your own travel folder and keep them for future reference.</div></td></tr>');
       }

    document.write('</table></div></td></tr></table>');

    document.write('<table width="'+twidth+'" border="0" cellspacing="0" cellpadding="0">');
document.write('<tr><td bgcolor="#FFFFFF"><div align="center"><img src="http://www.villasintl.com/newdesign/tfmenu.jpg" width="150" height="26" border="0" vspace=2 usemap="#travelfolder"><map name="travelfolder"><area shape="rect" coords="95,6,149,19" href="http://www.villasintl.com/cgi-bin/travelfolder/account_signin.cgi" alt="Sign In"><area shape="rect" coords="38,5,92,20" href="http://www.villasintl.com/cgi-bin/travelfolder/account_register.cgi" alt="Register"></map></div></td>');
    document.write('</tr></table>');
   }
 else
   {var firstname = GetCookie('firstname');
    var firstnamesubstrings=firstname.split('+');
    document.write('<img src="http://www.villasintl.com/newdesign/spacer.gif" width=100 height=1 border=0><table width="'+twidth+'" border="0" cellspacing="1" cellpadding="2" bgcolor="#004646">');
    document.write('<tr align="middle">');
    document.write('<td valign="top" bgcolor="#FFFFFF">');
    document.write('<div align="left">');
    document.write('<table width="100%" border="0" cellspacing="0" cellpadding="5">');
    document.write('<tr><td valign=top><div class="tftext2">TRAVEL FOLDER</div><br><div class="tftext">You are signed in, ');
    for (i=0; i < firstnamesubstrings.length; ++i)
        {document.write(firstnamesubstrings[i]);
         document.write(' ');}
    document.write('!</div></td></tr>');
    document.write('</table></div></td></tr></table>');

    document.write('<table width="'+twidth+'" border="0" cellspacing="0" cellpadding="0">');
    document.write('<tr><td bgcolor="#FFFFFF"><div align="center"><img src="http://www.villasintl.com/newdesign/tfmenu2.jpg" width="150" height="26" border="0"  usemap="#travelfolder"><map name="travelfolder"><area shape="rect" coords="95,6,149,19" href="http://www.villasintl.com/cgi-bin/travelfolder/signout.cgi" alt="Sign Out"><area shape="rect" coords="38,5,92,20" href="http://www.villasintl.com/cgi-bin/travelfolder/viewtravelfolder.cgi" alt="View"></map></div></td>');
    document.write('</tr></table>');
   }

}

//---------------------------------------------------------------------------------------------------------------------------------
function DisplayLine (twidth,theight) { 

if (titlegraphicflag ==1)
   {document.write('<img src="http://www.villasintl.com/newdesign/hline.gif" width='+twidth+' height='+theight+' border=0>');}
 else
   {document.write('');}

}

function LOAD(i) { 

     if (navigator.appVersion.indexOf('MSIE') != -1)    
        {if (i == 'guide')  
            window.open('http://www.villasintl.com/price_guide.htm','LOAD','width=630,height=400,left=0,top=0,toolbar=0,directories=0,menubar=0,status=0,resizable=0,location=0,scrollbars=1,copyhistory=0');
        }
     else       
        {if (i == 'guide') 
            window.open('http://www.villasintl.com/price_guide.htm','LOAD','width=630,height=400,left=0,top=0,toolbar=0,directories=0,menubar=0,status=0,resizable=0,location=0,scrollbars=1,copyhistory=0');  
        }

} 

//---------------------------------------------------------------------------------------------------------------------------------
function DisplayCheckButton (advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns) {

var propertyidcookie = GetCookie(propertyid);  // is set to 1 if property is in temp travel folder already
var tfid = GetCookie('tfid');
var newdesign = GetCookie('newdesign');

var cookies = getAllCookies();

if (propertyidcookie == '1')
   {// don't display button if property already in folder
    return;}
  else if ((tfid == null) || (tfid == ""))
   {if ((newdesign == '1') && (propertycount == 0))
       {// Display new pre-contact "new design" button
        DisplayDefaultCheckButton(advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns);}
      else
       {return;}
   }
  else
   {// they have a travel folder; disallow submitting a "more info" form
    return;}
}

//---------------------------------------------------------------------------------------------------------------------------------
function DisplayDefaultCheckButton (advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns) {

document.write('<table width=350><tr><td>&nbsp;</td></tr>');
document.write('<tr>');
document.write('<td valign="bottom" align=center>');
document.write('<form method="post" action="http://www.villasintl.com/cgi-bin/travelfolder1/generate_infoform.cgi">');
document.write(infoformargs);
document.write('<div align="center">');
document.write('<input type="submit" name="Submit" value="Check Price & Availability" class="box13red">');
document.write('</div>');
document.write('</form>');
document.write('</td>');
document.write('</tr></table>');

}

//---------------------------------------------------------------------------------------------------------------------------------
function DisplayButtonSection (advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns) {

var propertyidcookie = GetCookie(propertyid);  // is set to 1 if property is in temp travel folder already
var tfid = GetCookie('tfid');
var newdesign = GetCookie('newdesign');

// document.write(document.cookie);
// document.write('propertyidcookie: '+propertyidcookie);

if (propertyidcookie == '1')
   {if (newdesign == '1')
       {if ((tfid == null) || (tfid == ""))
          {DisplayNewAlreadyInTempFolderButtonOption(advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns);}
         else
          {DisplayNewAlreadyInPermanentFolderButtonOption(advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns);}
       }
      else
       {DisplayAlreadyInFolderButtonOption(advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns);}
   }
  else if ((tfid == null) || (tfid == ""))
   {if (newdesign == '1')
       {// Display new pre-contact "new design" buttons
        DisplayNewDesignDefaultButtonOption(advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns);}
      else
       {// This allows people to submit a "more info" form
        DisplayDefaultButtonOption(advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns);}
   }
  else
   {// they have a travel folder; disallow submitting a "more info" form
    if (newdesign == '1')
       {DisplayNewAlreadyHaveFolderButtonOption(advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns);}
      else
       {DisplayAlreadyHaveFolderButtonOption(advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns);}
   }
}

//---------------------------------------------------------------------------------------------------------------------------------
function DisplayNewDesignDefaultButtonOption (advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns) {

document.write('<center>');
document.write('<table align=center width=100%>');

if (advertiser != '')
   {document.write('<tr>');
    document.write('<td colspan=9><font color="'+captioncolor+'"><b>We invite you to choose one of the following four options:</b></font></td>');
    document.write('</tr>');
    document.write('<tr>');
    document.write('<td colspan=9 align=center>&nbsp;</td>');
    document.write('</tr>');
   }
  else
   {document.write('<tr>');
    document.write('<td colspan=7><font color="'+captioncolor+'"><b>We invite you to choose one of the following three options:</b></font></td>');
    document.write('</tr>');
    document.write('<tr>');
    document.write('<td colspan=7 align=center>&nbsp;</td>');
    document.write('<tr>');
   }

document.write('<tr>');
document.write(availabilityhtml);

document.write('<td valign="bottom">');
document.write('<form method="post" action="http://www.villasintl.com/cgi-bin/travelfolder1/addtotemptravelfolder.cgi">');
document.write('<div align="center">');
document.write('<input type="hidden" name="propertyid" value="'+propertyid+'">');
document.write('<input type="hidden" name="caller" value="addtf">');
document.write('<input type="submit" name="Submit" value="Add To Travel Folder" class="'+nextstepboxclass+'">');
document.write('</div>');
document.write('</form>');
document.write('</td>');

document.write('<td width=10 valign="bottom">&nbsp;</td>');

document.write('<td valign="bottom">');
document.write('<form method="post" action="http://www.villasintl.com/cgi-bin/travelfolder1/viewtemptravelfolder.cgi">');
document.write('<div align="center">');
document.write('<input type="hidden" name="caller" value="viewtf">');
document.write('<input type="submit" name="Submit" value="View Travel Folder" class="'+nextstepboxclass+'">');
document.write('</div>');
document.write('</form>');
document.write('</td>');

document.write('</td width=10>&nbsp;</td>');

var cookies = getAllCookies();

if (propertycount == 0)
   {document.write('<td valign="bottom">');
    document.write('<form method="post" action="http://www.villasintl.com/cgi-bin/travelfolder1/generate_infoform.cgi">');
    document.write(infoformargs);
    document.write('<div align="center">');
    document.write('<input type="submit" name="Submit" value="Check Price & Availability" class="'+nextstepboxclass+'">');
    document.write('</div>');
    document.write('</form>');
    document.write('</td>');
   }
  else
   {document.write('<td valign="bottom">');
    document.write('<form method="post" action="http://www.villasintl.com/cgi-bin/travelfolder1/generate_infoform2.cgi">');
    document.write(infoformargs);
    document.write('<div align="center">');
    document.write('<input type="submit" name="Submit" value="Contact Us" class="'+nextstepboxclass+'">');
    document.write('</div>');
    document.write('</form>');
    document.write('</td>');
   }

document.write('</tr>');
document.write('<tr>');
document.write('<td valign="bottom" colspan="'+nbrcolumns+'">');

if (advertiser != '')
   {document.write('Select <font color="'+captioncolor+'"><b>Show Availability</b></font> for a calendar updated by the property owner.<br><br>');}

if (propertycount == 0)
   {document.write('Create your personal travel folder and add this property to it by selecting <font color="'+captioncolor+'"><b>Add To Travel Folder</b></font>.<br><br>');}
  else
   {document.write('Add this property to your travel folder by selecting <font color="'+captioncolor+'"><b>Add To Travel Folder</b></font>.<br><br>');}

document.write('Select <font color="'+captioncolor+'"><b>View Travel Folder</b></font> to look at the properties you\'ve added to your folder.</font><br><br>');

if (propertycount == 0)
    {document.write('Select <font color="'+captioncolor+'"><b>Check Price / Availability</b></font> if you\'re seriously interested in <b>this particular property only</b>, and want to submit your request right away.<br><br>');}
  else
    {document.write('Select <font color="'+captioncolor+'"><b>Contact Us</b></font> to provide us with additional details about your travel preferences: dates, budget, etc. We will then <b>check on availability and price</b>, and place a hold on your chosen property (or properties).<br><br>');}
document.write('</td>');
document.write('</tr>');
document.write('</table>');
document.write('</CENTER>');
document.write('<br>');

}

//---------------------------------------------------------------------------------------------------------------------------------
function DisplayDefaultButtonOption (advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns) {

document.write('<center>');
document.write('<br>');
document.write('<table align=center width=100%>');

if (advertiser != '')
   {document.write('<tr>');
    document.write('<td colspan=9><font color="'+captioncolor+'"><b>We invite you to choose one of the following five options:</b></font></td>');
    document.write('</tr>');
    document.write('<tr>');
    document.write('<td colspan=9 align=center>&nbsp;</td>');
    document.write('</tr>');
   }
  else
   {document.write('<tr>');
    document.write('<td colspan=7><font color="'+captioncolor+'"><b>We invite you to choose one of the following four options:</b></font></td>');
    document.write('</tr>');
    document.write('<tr>');
    document.write('<td colspan=7 align=center>&nbsp;</td>');
    document.write('<tr>');
   }

document.write('<tr>');
document.write(availabilityhtml);

document.write('<td valign="bottom">');
document.write('<form method="post" action="http://www.villasintl.com/cgi-bin/generate_infoform2.cgi">');
document.write(infoformargs);
document.write('<div align="center">');
document.write('<input type="submit" name="Submit" value="Check Price / Availability" class="'+nextstepboxclass+'">');
document.write('</div>');
document.write('</form>');
document.write('</td>');

document.write('</td width=10>&nbsp;</td>');

document.write('<td valign="bottom">');
document.write('<form method="post" action="http://www.villasintl.com/cgi-bin/generate_infoform3.cgi">');
document.write(infoformargs);
document.write('<div align="center">');
document.write('<input type="submit" name="Submit" value="Offer Me Alternatives" class="'+nextstepboxclass+'">');
document.write('</div>');
document.write('</form>');
document.write('</td>');

document.write('<td width=10 valign="bottom">&nbsp;</td>');

document.write('<td valign="bottom">');
document.write('<form method="post" action="http://www.villasintl.com/cgi-bin/travelfolder/addtotravelfolder.cgi">');
document.write('<div align="center">');
document.write('<input type="hidden" name="propertyid" value="'+propertyid+'">');
document.write('<input type="hidden" name="caller" value="addtf">');
document.write('<input type="submit" name="Submit" value="Add To Travel Folder" class="'+nextstepboxclass+'">');
document.write('</div>');
document.write('</form>');
document.write('</td>');
document.write('<td width=10 valign="bottom">&nbsp;</td>');
document.write('<td valign="bottom">');
document.write('<form method="post" action="http://www.villasintl.com/cgi-bin/travelfolder/viewtravelfolder.cgi">');
document.write('<div align="center">');
document.write('<input type="hidden" name="caller" value="viewtf">');
document.write('<input type="submit" name="Submit" value="View Travel Folder" class="'+nextstepboxclass+'">');
document.write('</div>');
document.write('</form>');
document.write('</td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td valign="bottom" colspan="'+nbrcolumns+'">');
document.write('Press <font color="'+captioncolor+'"><b>Check Price / Availability</b></font> to get our assistance on this property\'s availability or current pricing.<br>');
document.write('Press <font color="'+captioncolor+'"><b>Offer Me Alternatives</b></font> to explore alternative properties, alternative locations, etc., with our help.<br>');
document.write('Press <font color="'+captioncolor+'"><b>Add To Travel Folder</b></font> if you want to look at a number of properties ');
document.write('before asking for our assistance.');
document.write('</td>');
document.write('</tr>');
document.write('</table>');
document.write('</CENTER>');
document.write('<br>');

}

//---------------------------------------------------------------------------------------------------------------------------------
function DisplayNewAlreadyInTempFolderButtonOption (advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns) {

document.write('<center>');
document.write('<br>');
document.write('<table align=center width=100%>');

document.write('<tr>');
document.write('<td colspan=7 align=center><font color="'+captioncolor+'"><b>This property is already in your travel folder.</b></font></td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td colspan=7 align=center>&nbsp;</td>');
document.write('<tr>');


document.write('<tr>');
document.write(availabilityhtml);

document.write('<td valign="bottom">');
document.write('<form method="post" action="http://www.villasintl.com/cgi-bin/travelfolder1/viewtemptravelfolder.cgi">');
document.write('<div align="center">');
document.write('<input type="hidden" name="caller" value="viewtf">');
document.write('<input type="submit" name="Submit" value="View Travel Folder" class="'+nextstepboxclass+'">');
document.write('</div>');
document.write('</form>');
document.write('</td>');
document.write('</tr>');
document.write('</table>');
document.write('</CENTER>');
document.write('<br>');

}

//---------------------------------------------------------------------------------------------------------------------------------
function DisplayNewAlreadyInPermanentFolderButtonOption (advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns) {

document.write('<center>');
document.write('<br>');
document.write('<table align=center width=100%>');

document.write('<tr>');
document.write('<td colspan=7 align=center><font color="'+captioncolor+'"><b>This property is already in your travel folder.</b></font></td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td colspan=7 align=center>&nbsp;</td>');
document.write('<tr>');


document.write('<tr>');
document.write(availabilityhtml);

document.write('<td valign="bottom">');
document.write('<form method="post" action="http://www.villasintl.com/cgi-bin/travelfolder1/viewtravelfolder.cgi">');
document.write('<div align="center">');
document.write('<input type="hidden" name="caller" value="viewtf">');
document.write('<input type="submit" name="Submit" value="View Travel Folder" class="'+nextstepboxclass+'">');
document.write('</div>');
document.write('</form>');
document.write('</td>');
document.write('</tr>');
document.write('</table>');
document.write('</CENTER>');
document.write('<br>');

}

//---------------------------------------------------------------------------------------------------------------------------------
function DisplayAlreadyInFolderButtonOption (advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns) {

document.write('<center>');
document.write('<br>');
document.write('<table align=center width=100%>');

document.write('<tr>');
document.write('<td colspan=7 align=center><font color="'+captioncolor+'"><b>This property is already in your travel folder.</b></font></td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td colspan=7 align=center>&nbsp;</td>');
document.write('<tr>');


document.write('<tr>');
document.write(availabilityhtml);

document.write('<td valign="bottom">');
document.write('<form method="post" action="http://www.villasintl.com/cgi-bin/travelfolder/viewtravelfolder.cgi">');
document.write('<div align="center">');
document.write('<input type="hidden" name="caller" value="viewtf">');
document.write('<input type="submit" name="Submit" value="View Travel Folder" class="'+nextstepboxclass+'">');
document.write('</div>');
document.write('</form>');
document.write('</td>');
document.write('</tr>');
document.write('</table>');
document.write('</CENTER>');
document.write('<br>');

}

//---------------------------------------------------------------------------------------------------------------------------------
function DisplayNewAlreadyHaveFolderButtonOption (advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns) {

document.write('<center>');
document.write('<br>');
document.write('<table align=center width=100%>');

document.write('<tr>');
document.write(availabilityhtml);

document.write('<td valign="bottom">');
document.write('<form method="post" action="http://www.villasintl.com/cgi-bin/travelfolder1/addtotravelfolder.cgi">');
document.write('<div align="center">');
document.write('<input type="hidden" name="propertyid" value="'+propertyid+'">');
document.write('<input type="hidden" name="caller" value="addtf">');
document.write('<input type="submit" name="Submit" value="Add To Travel Folder" class="'+nextstepboxclass+'">');
document.write('</div>');
document.write('</form>');
document.write('</td>');
document.write('<td width=10 valign="bottom">&nbsp;</td>');
document.write('<td valign="bottom">');
document.write('<form method="post" action="http://www.villasintl.com/cgi-bin/travelfolder1/viewtravelfolder.cgi">');
document.write('<div align="center">');
document.write('<input type="hidden" name="caller" value="viewtf">');
document.write('<input type="submit" name="Submit" value="View Travel Folder" class="'+nextstepboxclass+'">');
document.write('</div>');
document.write('</form>');
document.write('</td>');
document.write('</tr>');
document.write('</table>');
document.write('</CENTER>');
document.write('<br>');

}


//---------------------------------------------------------------------------------------------------------------------------------
function DisplayAlreadyHaveFolderButtonOption (advertiser,captioncolor,nextstepboxclass,availabilityhtml,infoformargs,propertyid,nbrcolumns) {

document.write('<center>');
document.write('<br>');
document.write('<table align=center width=100%>');

document.write('<tr>');
document.write(availabilityhtml);

document.write('<td valign="bottom">');
document.write('<form method="post" action="http://www.villasintl.com/cgi-bin/travelfolder/addtotravelfolder.cgi">');
document.write('<div align="center">');
document.write('<input type="hidden" name="propertyid" value="'+propertyid+'">');
document.write('<input type="hidden" name="caller" value="addtf">');
document.write('<input type="submit" name="Submit" value="Add To Travel Folder" class="'+nextstepboxclass+'">');
document.write('</div>');
document.write('</form>');
document.write('</td>');
document.write('<td width=10 valign="bottom">&nbsp;</td>');
document.write('<td valign="bottom">');
document.write('<form method="post" action="http://www.villasintl.com/cgi-bin/travelfolder/viewtravelfolder.cgi">');
document.write('<div align="center">');
document.write('<input type="hidden" name="caller" value="viewtf">');
document.write('<input type="submit" name="Submit" value="View Travel Folder" class="'+nextstepboxclass+'">');
document.write('</div>');
document.write('</form>');
document.write('</td>');
document.write('</tr>');
document.write('</table>');
document.write('</CENTER>');
document.write('<br>');

}


//---------------------------------------------------------------------------------------------------------------------------------
function RememberTemporaryPropertyRatingsChoice (input,propertyid) {

var rating = input.value;
var url = 'http://www.villasintl.com/cgi-bin/travelfolder1/ratetempproperty.cgi?propertyid=' + propertyid + '&rating=' + rating;
window.location.href = url;

}

//---------------------------------------------------------------------------------------------------------------------------------
function RememberTemporaryCheckPropertyChoice (input,propertyid) {

if (input.checked == true)
   {var url = 'http://www.villasintl.com/cgi-bin/travelfolder1/checktemppropertypricing.cgi?propertyid=' + propertyid + '&flag=yes';}
  else
   {var url = 'http://www.villasintl.com/cgi-bin/travelfolder1/checktemppropertypricing.cgi?propertyid=' + propertyid + '&flag=';}

window.location.href = url;

}

//---------------------------------------------------------------------------------------------------------------------------------
function RememberTemporaryHoldPropertyChoice (input,propertyid) {

if (input.checked == true)
   {var url = 'http://www.villasintl.com/cgi-bin/travelfolder1/holdtempproperty.cgi?propertyid=' + propertyid + '&flag=yes';}
  else
   {var url = 'http://www.villasintl.com/cgi-bin/travelfolder1/holdtempproperty.cgi?propertyid=' + propertyid + '&flag=';}

window.location.href = url;

}

//---------------------------------------------------------------------------------------------------------------------------------
function RememberCheckboxChoice (input) {

if (input.checked == true)
   {Set_Cookie(input.name,'yes',730,'/','.villasintl.com',0);}
  else
   {Set_Cookie(input.name,'no',730,'/','.villasintl.com',0);}

}

//---------------------------------------------------------------------------------------------------------------------------------
function RememberPermanentCheckPropertyChoice (input,propertyid) {

if (input.checked == true)
   {var url = 'http://www.villasintl.com/cgi-bin/travelfolder1/checkpropertypricing.cgi?propertyid=' + propertyid + '&flag=yes';}
  else
   {var url = 'http://www.villasintl.com/cgi-bin/travelfolder1/checkpropertypricing.cgi?propertyid=' + propertyid + '&flag=';}

window.location.href = url;

}

//---------------------------------------------------------------------------------------------------------------------------------
function RememberPermanentHoldPropertyChoice (input,propertyid) {

if (input.checked == true)
   {var url = 'http://www.villasintl.com/cgi-bin/travelfolder1/holdproperty.cgi?propertyid=' + propertyid + '&flag=yes';}
  else
   {var url = 'http://www.villasintl.com/cgi-bin/travelfolder1/holdproperty.cgi?propertyid=' + propertyid + '&flag=';}

window.location.href = url;

}

//---------------------------------------------------------------------------------------------------------------------------------
function RememberPermanentPropertyRatingsChoice (input,propertyid) {

var rating = input.value;
var url = 'http://www.villasintl.com/cgi-bin/travelfolder1/rateproperty.cgi?propertyid=' + propertyid + '&rating=' + rating;
window.location.href = url;

}

//---------------------------------------------------------------------------------------------------------------------------------
function RememberPermanentPropertyAvailabilityChoice (input,propertyid) {

var availability = input.value;
var url = 'http://www.villasintl.com/cgi-bin/travelfolder1/adjustpropertyavailability.cgi?propertyid=' + propertyid + '&availability=' + availability;
window.location.href = url;

}

//---------------------------------------------------------------------------------------------------------------------------------
function RememberClientPropertyListingsFilterSetting (input) {

var setting = input.value;
var url = 'http://www.villasintl.com/cgi-bin/travelfolder1/adjustclientpropertylistingsfiltersetting.cgi?setting=' + setting;
window.location.href = url;

}

//---------------------------------------------------------------------------------------------------------------------------------
function RememberVIStaffPropertyListingsFilterSetting (input) {

var setting = input.value;
var url = 'http://www.villasintl.com/cgi-bin/travelfolder1/adjustvistaffpropertylistingsfiltersetting.cgi?setting=' + setting;
window.location.href = url;

}

//---------------------------------------------------------------------------------------------------------------------------------
function RememberVirtualPropertyListingsFilterSetting (input) {

var setting = input.value;
var url = 'http://www.villasintl.com/cgi-bin/travelfolder1/adjustvirtualpropertylistingsfiltersetting.cgi?setting=' + setting;
window.location.href = url;

}

//---------------------------------------------------------------------------------------------------------------------------------
function RememberUnavailablePropertyListingsFilterSetting (input) {

var setting = input.value;
var url = 'http://www.villasintl.com/cgi-bin/travelfolder1/adjustunavailablepropertylistingsfiltersetting.cgi?setting=' + setting;
window.location.href = url;

}

//---------------------------------------------------------------------------------------------------------------------------------
function gosite (propertyid) {

window.location.href  = "http://www.villasintl.com/cgi-bin/travelfolder1/viewtemptravelfolder.cgi";

}


//---------------------------------------------------------------------------------------------------------------------------------
function setcookie1 (name,value,exp_y,exp_m,exp_d,path,domain,secure) { 

var cookie_string = name + "=" + escape ( value ); 
if (exp_y) 
   {// 15/02/2003
    var expires = new Date ( exp_y, exp_m, exp_d );
    cookie_string += "; expires=" + expires.toGMTString();
   }
if (path) 
   {cookie_string += "; path=" + escape ( path );}
if (domain)
   {cookie_string += "; domain=" + escape ( domain );}
if (secure)
   {cookie_string += "; secure";}

document.cookie = cookie_string;

} 


