/* -----------------------------------------------
   (c) 2003 JBS Consulting
   contact: jbsconsulting@on.to
  ------------------------------------------------ */

// ----------------------------------------------------------
// SETTINGS:
document.write ('<script language="JavaScript" type="text/javascript" src="http://austinrealestateonline.com/properties.js"></script>');
document.write ('<script language="JavaScript" type="text/javascript" src="http://austinrealestateonline.com/agents.js"></script>');

var vFullScreen  = 'yes';
var vScrollBars  = 'yes';
var vLeft   = '10';
var vTop    = '10';
var vHeight = window.screen.availHeight - (vTop  * 2);
var vWidth  = window.screen.availWidth  - (vLeft * 2);
var vResize    = 'yes';
var vLocation = 'yes';
var vMenuBar = 'yes';
var vStatus = 'yes';
var vToolBar = 'yes';
var vSettings  = '';
vSettings     += 'fullscreen=' + vFullScreen;
vSettings     += ',scrollbars=' + vScrollBars;
vSettings     += ',left=' + vLeft;
vSettings     += ',top=' + vTop;
vSettings     += ',height=' + vHeight;
vSettings     += ',width=' + vWidth;
vSettings     += ',resizable=' + vResize;
vSettings     += ',location=' + vLocation;
vSettings     += ',menubar=' + vMenuBar;
vSettings     += ',status=' + vStatus;
vSettings     += ',toolbar=' + vToolBar;
vContactSettings = vSettings + ', fullscreen=no, location=yes';

var slideShowSpeed = 7;
var crossFadeDuration = 3;
var crossFadeTransition = 24; // _12_; 0 - 23; 24 to use Blend instead
var Pic = new Array();
Pic[0] = 'http://austinrealestateonline.com/images/unavail.jpg'
var vTimeOut;
var vOther = 1; 

cDefault  = "0";
cTextOnly = "1";
cMinimal  = "2";
cFull     = "3";
cResultQty = 10;
// ----------------------------------------------------------

// ----------------------------------------------------------
// READCLINE:
function ReadCLine (vIndex, vValue) {    if (arguments.length < 1) vIndex = 0;    if (arguments.length < 2) vValue = 1;    var vString, vLength;    var vCLine = new Array();    var vStart = 1;    var vKeyCount = 0;    vString = "" + unescape(location.search);    vString = vString.substring(1, vString.length);    for (var c = 0; c < vString.length; c++)     if (vString.charAt(c).indexOf("&") != -1) vKeyCount++;    if (vIndex > vKeyCount) {     vIndex = 0;     return '';    }    for (var vIndexCount = 0; vIndexCount <= vIndex; vIndexCount++) {     vString = "" + unescape(location.search);     vString = vString.substring(vStart, vString.length);     vLength = vString.indexOf('&');     if (vLength == -1) vLength = vString.length;     vString = vString.substring(0, vLength);     vCLine[vIndexCount] = new Array();     vCLine[vIndexCount][0] = vString.substring(0, vString.indexOf('='));     vCLine[vIndexCount][1] = vString.substring(vString.indexOf('=') + 1, vLength);     vStart = vStart + vLength + 1;    }    return vCLine[vIndex][vValue];   }
// ----------------------------------------------------------

////  F O R M A T  C U R R E N C Y  ////
function FormatCurrency (vNumber, vToText) { vNumber = vNumber.toString().replace(/\$|\,/g,''); if(arguments.length <= 0) vNumber = "0"; vSign = (vNumber == (vNumber = Math.abs(vNumber))); vNumber = Math.floor(vNumber * 100+0.50000000001); vCents = vNumber % 100; vNumber = Math.floor(vNumber / 100).toString(); if (vCents < 10) vCents = "0" + vCents; for (var vIntCount = 0; vIntCount < Math.floor((vNumber.length - (1 + vIntCount))/3); vIntCount++)  vNumber = vNumber.substring(0, vNumber.length - (4 * vIntCount + 3)) +','+ vNumber.substring(vNumber.length - (4 * vIntCount + 3)); if (!vToText) return (((vSign)?'':'-') + '$' + vNumber); return IntToText(vNumber) + ' Dollars and ' + vCents + ' Cents';}
function IntToText (vNumber) { vNumber = vNumber.toString().replace(/\$|\,/g,''); var vText = ''; var n = ''; for (var vDigit = 0; vDigit < vNumber.length; vDigit++) {  if ((vNumber.length - vDigit == 2) ||      (vNumber.length - vDigit == 5) ||      (vNumber.length - vDigit == 8)) {   vTens = vNumber.charAt(vDigit) + vNumber.charAt(vDigit + 1);   if (vTens == '11') {n = " Eleven"; vDigit++;}   else if (vTens == '12') {n = " Twelve"; vDigit++;}   else if (vTens == '13') {n = " Thirteen"; vDigit++;}   else if (vTens == '14') {n = " Fourteen"; vDigit++;}   else if (vTens == '15') {n = " Fifteen"; vDigit++;}   else if (vTens == '16') {n = " Sixteen"; vDigit++;}   else if (vTens == '17') {n = " Seventeen"; vDigit++;}   else if (vTens == '18') {n = " Eighteen"; vDigit++;}   else if (vTens == '19') {n = " Ninteen"; vDigit++;}   else switch (vNumber.charAt(vDigit)) {    case '0': n= ""; break;    case '1': n= " Ten"; break;    case '2': n= " Twenty"; break;    case '3': n= " Thirty"; break;    case '4': n= " Fourty"; break;    case '5': n= " Fifty"; break;    case '6': n= " Sixty"; break;    case '7': n= " Seventy"; break;    case '8': n= " Eighty"; break;    case '9': n= " Ninety"; break;    default:  n = "Not a Number";   }  } else {   switch (vNumber.charAt(vDigit)) {    case '0': n= ""; break;    case '1': n= " One"; break;    case '2': n= " Two"; break;    case '3': n= " Three"; break;    case '4': n= " Four"; break;    case '5': n= " Five"; break;    case '6': n= " Six"; break;    case '7': n= " Seven"; break;    case '8': n= " Eight"; break;    case '9': n= " Nine"; break;    default:  n = "Not a Number";   }  }  if ((vNumber.length - vDigit == 9) && (n != '')) n += ' Hundred';  if (vNumber.length - vDigit == 7) n += ' Million';  if ((vNumber.length - vDigit == 6) && (n != '')) n += ' Hundred';  if (vNumber.length - vDigit == 4) n += ' Thousand';  if ((vNumber.length - vDigit == 3) && (n != '')) n += ' Hundred';  vText = vText + n; } return vText; }

// ----------------------------------------------------------
// RUNSLIDESHOW
   function runSlideShow (vImgName) {
    if (document.getElementById('SlideForm').SlideButton.value == "Pause") {
     var p = Pic.length;
     if (vOther > (p - 1)) vOther = 1;
     var preLoad = new Array();
     for (i = 0; i < p; i++) {
      preLoad[i] = new Image();
      preLoad[i].src = Pic[i];
     }
     if (document.all) {
      if (crossFadeTransition == 24) {
       eval("document.images."+ vImgName +".style.filter='blendTrans(duration=" + crossFadeDuration + ")';");
       eval("document.images."+ vImgName +".filters.blendTrans.Apply();");
      } else {
       eval("document.images."+ vImgName +".style.filter='revealTrans(duration=" + crossFadeDuration + ", transition=" + crossFadeTransition +")';");
       eval("document.images."+ vImgName +".filters.revealTrans.Apply();");
      }
     }
     eval("document.images."+ vImgName +".src = preLoad[vOther].src;");
     if (document.all) {
      if (crossFadeTransition == 24) {
       eval("document.images."+ vImgName +".filters.blendTrans.Play();");
      } else {
       eval("document.images."+ vImgName +".filters.revealTrans.Play();");
      }
     }
     vOther = vOther + 1;
     vTimeOut = setTimeout("runSlideShow ('" + vImgName + "')", slideShowSpeed * 1000);
    }
   }
// ----------------------------------------------------------

// ----------------------------------------------------------
// FEATUREDPROPERTIES_S:
   function FeaturedProperty_s (PropNum) {
    document.write ('<TR><TD CLASS=gensmall>');
    document.write ('<B>'+ vPropertyA[PropNum][cPAddress] +'</B><BR>');
    document.write ('<A HREF="javascript:void(0);" style="text-decoration:none;" onclick="window.open(\'property.htm?ad='+ vPropertyA[PropNum][cPAddress] +'\',\'dep\', vSettings);">');
    document.write (vPropertyA[PropNum][cPAddress]);
    vImage = 'unavail.jpg';
    if (vPropertyA[PropNum][cPImages][0].length > 0) {
     vImage = vPropertyA[PropNum][cPImages][0];
    }

    document.write ('<IMG SRC="http://austinrealestateonline.com/images/'+ vImage +'" ALIGN=LEFT height=100 BORDER=0>');
    document.write ('</A>');
    document.write (vPropertyA[PropNum][cPSD] +'<BR>');
    document.write ('<I>Bdrms:</I> '+ vPropertyA[PropNum][cPBed] +'<BR>');
    document.write ('<I>Bath:</I> '+ vPropertyA[PropNum][cPBath] +'<BR>');
    document.write ('<I>Price:</I> '+ FormatCurrency (vPropertyA[PropNum][cPPrice]) +'<BR>');
    document.write ('</TD></TR>');
    document.write ('<TR><TD><HR></TD></TR>');
   }
// ----------------------------------------------------------
// ShowFeatures_Slideshow
   function ShowFeatures_Slideshow (vDisplayCount) {
    vSegment = vPCount / vDisplayCount;
    for (vCount = 0; vCount < vDisplayCount; vCount++) {
     vRandom = Math.random() * vSegment + (vSegment * vCount);
     vRandom = Math.floor(vRandom);
     if (vPropertyA[vRandom][cPFeatured] == "Y") {
      myvariableslide[vCount]=FeaturedProperty_slideshow(vRandom)
     }
    }
    return myvariableslide2;
   }

// ----------------------------------------------------------

// FEATUREDPROPERTIES_GetTotal:
   function FeaturedProperty_GetTotal ()
{
    vFeatCount = 0;
    for (vCount = 0; vCount <= vPCount; vCount++) {
     if (vPropertyA[vCount][cPFeatured] == "Y") vFeatCount++;
	 if (vPropertyA[vCount][cPFeatured] == "N") vFeatCount++;
    }
    return vFeatCount;
}

// ----------------------------------------------------------
// PROPERTIES GETOPTIONVALUES
   function  GetOptionValues()
{
	vText2 = "";
    for (vCount = 0; vCount <= vPCount; vCount++) {
	 vText2 += "<option value='";
     vText2 += "property.htm?ad=" + vPropertyA[vCount][cPAddress]
	 vText2 += "'>";
     vText2 += vPropertyA[vCount][cPAddress];
	 vText2 += "</option>";
    }
    return vText2;
}

// ----------------------------------------------------------

// FEATUREDPROPERTIES_Slideshow:
   function FeaturedProperty_slideshow (vDisplayCount) {
    var variableslide=new Array()	
    vSegment = vPCount / vDisplayCount;
	fCount = 0;
    for (vCount = 0; vCount < vDisplayCount; vCount++) 
    {
     vRandom = Math.random() * vSegment + (vSegment * vCount);
     vRandom = Math.floor(vRandom);
     vImage = 'unavail.jpg';
     if (vPropertyA[vRandom][cPImages][0].length > 0) 
     {
       vImage = vPropertyA[vRandom][cPImages][0];
     }
     vImage = 'http://austinrealestateonline.com/images/'+ vImage
     vLinkk = 'property.htm?ad='+ vPropertyA[vRandom][cPAddress]
     vTextt = '<strong>' + vPropertyA[vRandom][cPAddress] + '</strong><BR>' + vPropertyA[vRandom][cPBed] + ' Bedroom(s)<BR>' + vPropertyA[vRandom][cPBath] + ' Bath(s)<BR>' + FormatCurrency (vPropertyA[vRandom][cPPrice])    
     
      if (vPropertyA[vRandom][cPFeatured] == "Y")
	  {
		  variableslide[fCount]=[vImage,vLinkk,vTextt]
		  fCount = fCount + 1;
	  }
	   
    }
    
    return variableslide;
   }
// ----------------------------------------------------------
// FEATUREDPROPERTY_B:
   function FeaturedProperty_B (PropNum, vDetail) {
    if (arguments.length < 2) vDetail = cDefault;

    vImage = 'unavail.jpg';
    if (vPropertyA[PropNum][cPImages][0].length > 0) {
     vImage = vPropertyA[PropNum][cPImages][0];
    }

    if (vDetail == cDefault) {
     vText = '';
     vText += '<A CLASS=gensmall HREF="javascript:void(0);" onclick="window.open(\'property.htm?ad='+ vPropertyA[PropNum][cPAddress] +'\',\'dep\', vSettings);">';
     vText += '<CENTER><B>'+ vPropertyA[PropNum][cPSD] +'</B><BR>';
     vText += '<IMG SRC="http://austinrealestateonline.com/images/'+ vImage +'" HEIGHT=100 BORDER=0><BR>';
     vText += vPropertyA[PropNum][cPBed] +' Beds | ';
     vText += vPropertyA[PropNum][cPBath] +' Baths<BR>';
     if (vPropertyA[PropNum][cPVTourURL] != '')
      vText += '<IMG SRC="http://austinrealestateonline.com/images/vtour.gif" ALT="Virtual Tour Available!" height=15 BORDER=0><BR>';
     vText += '<I>'+ FormatCurrency (vPropertyA[PropNum][cPPrice]) +'</I></CENTER>';
     vText += '</A>';
     vText += '<HR>';
    }
    if (vDetail == cFull) {
     vText = '';
     vText += '<A HREF="javascript:void(0);" onclick="window.open(\'property.htm?ad='+ vPropertyA[PropNum][cPAddress] +'\',\'dep\', vSettings);">';
     vText += '<CENTER><B>'+ vPropertyA[PropNum][cPSD] +'</B><BR>';
     vText += '<I CLASS=TDsmall>'+ vPropertyA[PropNum][cPAddress] +'</I></CENTER>';
     vText += '<TABLE cellpadding=5 cellspacing=5>';
     vText += '<TR><TD ALIGN=left width=25%>';
     vText += '<IMG SRC="http://austinrealestateonline.com/images/'+ vImage +'" height=100 BORDER=0></td>';
     vText += '<TD CLASS=TDsmall ALIGN=left width=25%>';
     vText += vPropertyA[PropNum][cPBed] +' Bedrooms<BR>';
     vText += vPropertyA[PropNum][cPBath] +' Bathrooms<BR>';
     if (vPropertyA[PropNum][cPSqFt] != '')
      vText += vPropertyA[PropNum][cPSqFt] +' SqFt<BR>';
     if (vPropertyA[PropNum][cPSize] != '')
      vText += 'Lot Size: '+ vPropertyA[PropNum][cPSize] +'<BR>';
     if (vPropertyA[PropNum][cPYrBlt] != '')
      vText += 'Built: '+ vPropertyA[PropNum][cPYrBlt] +'<BR>';
     if (vPropertyA[PropNum][cPGarage] != '')
      vText += 'Garages: ' + vPropertyA[PropNum][cPGarage];
     if (vPropertyA[PropNum][cPVTourURL] != '')
      vText += '<CENTER>Virtual Tour:&nbsp;<IMG SRC="http://austinrealestateonline.com/images/vtour.gif" ALT="Virtual Tour Available!" height=15 BORDER=0></CENTER>';
     vText += '</td><TD width=50% align=justify>'+ vPropertyA[PropNum][cPComment] + '</TD></tr></TABLE>';
     vText += '<DIV CLASS=RIGHT><I>'+ FormatCurrency (vPropertyA[PropNum][cPPrice]) +'</I></DIV>';
     vText += '</A>';
     vText += '<HR>';
    }
    if (vDetail == cMinimal) {
     vText = '';
/////
     vText += '<TR><TD COLSPAN=4 ALIGN=CENTER><HR>';
/////
     vText += '<A CLASS=gensmall HREF="javascript:void(0);" onclick="window.open(\'property.htm?ad='+ vPropertyA[PropNum][cPAddress] +'\',\'dep\', vSettings);">';
     vText += '<B>'+ vPropertyA[PropNum][cPSD] +'</B><BR>';
     vText += '</A>';
     vText += '<TR><TD ALIGN=CENTER>';
     vText += '<A CLASS=gensmall HREF="javascript:void(0);" onclick="window.open(\'property.htm?ad='+ vPropertyA[PropNum][cPAddress] +'\',\'dep\', vSettings);">';
     vText += '<IMG SRC="http://austinrealestateonline.com/images/'+ vImage +'" height=100 BORDER=0>';
     vText += '</A>';
     vText += '<TD CLASS=TDsmall><I>'+ FormatCurrency (vPropertyA[PropNum][cPPrice]) +'</I><BR>';
     vText += 'Beds: '+ vPropertyA[PropNum][cPBed] +'<BR>';
     vText += 'Baths: '+ vPropertyA[PropNum][cPBath] +'<BR>';
     vText += 'SqFt: '+ vPropertyA[PropNum][cPSqFt];
     vText += '<TD CLASS=TDsmall>';
     vText += 'Lot Size: '+ vPropertyA[PropNum][cPSize] +'<BR>';
     vText += 'Built: '+ vPropertyA[PropNum][cPYrBlt] +'<BR>';
     vText += 'Garage:<BR>'+ vPropertyA[PropNum][cPGarage];
     if (vPropertyA[PropNum][cPVTourURL] != '')
      vText += '<CENTER><IMG SRC="http://austinrealestateonline.com/images/vtour.gif" ALT="Virtual Tour Available!" height=15 BORDER=0></CENTER>';
    }
    if (vDetail == cTextOnly) {
     vText = '';
     vText += '<TR><TD>';
     vText += '<A CLASS=gensmall HREF="javascript:void(0);" onclick="window.open(\'property.htm?ad='+ vPropertyA[PropNum][cPAddress] +'\',\'dep\', vSettings);">';
     vText += '<B>'+ vPropertyA[PropNum][cPSD] +'</B><TD CLASS=TDsmall>';
     vText += '<I>'+ FormatCurrency (vPropertyA[PropNum][cPPrice]) +'</I><TD CLASS=TDsmall>';
     vText += vPropertyA[PropNum][cPBed] +' Beds<TD CLASS=TDsmall>';
     vText += vPropertyA[PropNum][cPBath] +' Baths';
     if (vPropertyA[PropNum][cPVTourURL] != '')
      vText += ' <IMG SRC="http://austinrealestateonline.com/images/vtour.gif" ALT="Virtual Tour Available!" height=15 BORDER=0>';
     vText += '</A>';
    }
    return vText;
   }
// ----------------------------------------------------------

// ----------------------------------------------------------
// TOGGLEBUTTON:
   function ToggleButton(text) {
    document.getElementById('SlideForm').SlideButton.value = (text == "Pause") ? " Play " : "Pause";
    runSlideShow('SlideShow');
   }
// ----------------------------------------------------------

// ----------------------------------------------------------
// FEATUREDPROPERTY_P:
   function FeaturedProperty_P (PropNum) {
    document.write ('<TR><TD CLASS=gensmall ALIGN=LEFT><SPAN CLASS=ScreenOnly>');
    if (window.name == "dep") {
     vText  = '<A HREF="javascript:void(0);" onclick="window.close();">';
     vText += 'Close</A> | ';
    } else {
     vText  = '<A HREF="index.html">';
     vText += 'Home</A> | ';
    }
    document.write (vText);

    if ((PropNum * 1) > 0) {
     vText  = '<A HREF="property.htm?ad='+ vPropertyA[((PropNum *1)-1)][cPAddress] +'">';
     vText += 'Previous Property</A> | ';
    } else {
     vText  = '<I>Previous Property</I> | ';
    }
    document.write (vText);

    if ((PropNum * 1) < vPCount) {
     vText  = '<A HREF="property.htm?ad='+ vPropertyA[((PropNum *1)+1)][cPAddress] +'">';
     vText += 'Next Property</A>';
    } else {
     vText  = '<I>Next Property</I>';
    }
    document.write (vText);

    document.write ('</SPAN></TD>');
    document.write ('<TD CLASS=gensmall ALIGN=RIGHT width="100%"><SPAN CLASS=ScreenOnly>');
    document.write ('<A HREF="mailto:' + vAgentA[GetAgent(vPropertyA[PropNum][cPAgent])][cAEmail] + '">');
    document.write ('Contact '+ vAgentA[GetAgent(vPropertyA[PropNum][cPAgent])][cAName]);
    document.write ('</A>');
    document.write(' | <a href="javascript:void(0)" onclick=\'window.open("recommend/recommend.asp?loc='+window.location.href+'","","height=280,width=380,top=150,left=200,toolbar=no,menubar=no,location=no,status=no,resizable=1");\' title="Recommend this to a friend">Email a Friend</a>');
    document.write (' | <A HREF="#" onclick="window.print();return false;">');
    document.write ('Print Flyer</A>');
    document.write ('</SPAN></TD></TR>');
    document.write ('<TR><TD COLSPAN=2>');
    document.write ('<CENTER><H2>'+ vPropertyA[PropNum][cPAddress] +'</H2></CENTER>');
    document.write ('</TD></TR><TR><TD VALIGN=TOP ALIGN=CENTER>');
    document.write ('<CENTER>');
    document.write ('<FORM ID=SlideForm class=gensmall STYLE="MARGIN:1px;">');
    document.write ('<SPAN CLASS=ScreenOnly>Slideshow Control: ');
    document.write ('<input type=button class=blksmall name="SlideButton" onClick="ToggleButton(this.value);" value="Pause">');
    document.write ('</SPAN></FORM>');
    document.write ('<TABLE HEIGHT=300px WIDTH=400px><TR><TD ALIGN=CENTER>');
     document.write ('<A HREF="javascript:void(0);">');
      document.write ('<DIV CLASS="SSIMGBLOCK">');
       document.write ('<img class="SSIMG" src="http://austinrealestateonline.com/images/unavail.jpg" name="SlideShow" WIDTH=400 ALIGN=CENTER BORDER=0 onclick="ToggleButton(\'Pause\'); window.open(\'image.html?prop='+ PropNum +'&img=\'+ (vOther -1), \'image\', vSettings);">');
      document.write ('</DIV>');
     document.write ('</A>');
    document.write ('</TABLE>');
    document.write ('</CENTER>');

    document.write ('</A>');
    document.write ('</TD><TD VALIGN=TOP CLASS=gensmall>');

    document.write ('<CENTER><B>'+ vPropertyA[PropNum][cPSD] +'</B></CENTER>');
    document.write (vPropertyA[PropNum][cPBed] +' Bedroom(s)<BR>');
    document.write (vPropertyA[PropNum][cPBath] +' Bath(s)<BR>');
    document.write (vPropertyA[PropNum][cPGarage] +' Garage<BR>');
    if (vPropertyA[PropNum][cPSqFt] != '')     document.write ('<I>Sq Ft:</I> '+ vPropertyA[PropNum][cPSqFt] +'<BR>');
    if (vPropertyA[PropNum][cPSize] != '')     document.write ('<I>Lot Size:</I> '+ vPropertyA[PropNum][cPSize] +'<BR>');
    if (vPropertyA[PropNum][cPYrBlt] != '')     document.write ('<I>Year Built:</I> '+ vPropertyA[PropNum][cPYrBlt]);
    document.write ('<CENTER>'+ FormatCurrency (vPropertyA[PropNum][cPPrice]) +'</CENTER>');
    if (vPropertyA[PropNum][cPMLS] != '') document.write ('<BR><I>MLS#</I> '+ vPropertyA[PropNum][cPMLS] +'<BR>');

    if (vPropertyA[PropNum][cPVTourURL] != '') {
     document.write ('<BR><CENTER>');
     document.write ('<A HREF="javascript:void(0);" onclick=\'window.open("'+ vPropertyA[PropNum][cPVTourURL] +'","vtour","left='+ vLeft +', top='+ vTop +', width='+ vWidth +', height='+ vHeight +', fullscreen=no");\'>Take a Virtual Tour</A></CENTER>');
     document.write ('</CENTER>');
    }
    document.write ('<BR>');

    vImage = 'unavail.jpg';
    if (vPropertyA[PropNum][cPImages][0].length > 0) {
     vImage = vPropertyA[PropNum][cPImages][0];
    }

    document.write ('<CENTER>');
      document.write ('<DIV CLASS="MAINIMGBLOCK">');
       document.write ('<IMG CLASS="MAINIMG" SRC="http://austinrealestateonline.com/images/'+ vImage +'" BORDER=0 WIDTH=280 onclick="window.open(\'image.html?prop='+ PropNum +'&img='+ 0 +'\', \'image\', vSettings);">');
      document.write ('</DIV>');
    document.write ('<BR><I class=gensmall>'+ vPropertyA[PropNum][cPCaptions][0] +'</I></CENTER>');

    for (var vCount = 0; vCount < vPropertyA[PropNum][cPImages].length; vCount++) 
     Pic[vCount] = 'http://austinrealestateonline.com/images/'+ vPropertyA[PropNum][cPImages][vCount];
    if (Pic.length > 1) runSlideShow("SlideShow");
    document.write ('</TD></TR>');

    document.write ('<TR><TD COLSPAN=2>');
    document.write ('<P>'+ vPropertyA[PropNum][cPComment]);
    document.write ('<BR><BR></TD></TR>');

    if (vPropertyA[PropNum][cPFeatures][0].length > 0) {
     document.write ('<TR><TD COLSPAN=2><HR>');
     document.write ('<TABLE ALIGN=CENTER WIDTH=90%>');
     for (var vCount = 0; vCount < vPropertyA[PropNum][cPFeatures].length; vCount++) {
      if ((vCount % 2) == 0) {
       document.write ('<TR><TD CLASS=FBody>');
       document.write ('&bull; '+ vPropertyA[PropNum][cPFeatures][vCount]);
      } else {
       document.write ('<TD CLASS=FBody ALIGN=RIGHT>');
       document.write (vPropertyA[PropNum][cPFeatures][vCount] +' &bull;');
      }
     }
     document.write ('</TABLE>');
     document.write ('</TD></TR>');
    }

    document.write ('<TR><TD COLSPAN=2><CENTER>');
    document.write ('<a href="javascript:void(0);" onclick=\'window.open("http://us.rd.yahoo.com/maps/us/insert/Tmap/extmap/*-http://maps.yahoo.com/maps_result?addr='+ vPropertyA[PropNum][cPAddress] +'&csz='+vPropertyA[PropNum][cPCity]+'%2C+tx&country=us","_blank","left=100, top=100, resizable=yes, scrollbars=yes");\'>');
    document.write ('View Map</a> | ');
    document.write ('<a href="javascript:void(0);" onclick=\'window.open("http://us.rd.yahoo.com/maps//maps/extDD/*-http://maps.yahoo.com//dd?taddr='+ vPropertyA[PropNum][cPAddress] +'&tcsz='+vPropertyA[PropNum][cPCity]+'%2C+TX&country=us","_blank","left=100, top=100, resizable=yes, scrollbars=yes");\'>');
    document.write ('Get Directions</a>');
    document.write ('</TD></TR>');

    document.write ('<TR><TD COLSPAN=2><SPAN CLASS=ScreenOnly><HR><CENTER>');
    for (var vCount = 0; vCount < vPropertyA[PropNum][cPImages].length; vCount++) {
      document.write (' <IMG SRC="http://austinrealestateonline.com/images/'+ vPropertyA[PropNum][cPImages][vCount] +'" HEIGHT=75 BORDER=1 ALT="'+ vPropertyA[PropNum][cPCaptions][vCount] +'" onclick="window.open(\'image.html?prop='+ PropNum +'&img='+ vCount +'\', \'image\', vSettings);">');
    }
    document.write ('</CENTER></SPAN>');

    document.write ('<TR><TD COLSPAN=2><HR>');
    vImg = vAgentA[GetAgent(vPropertyA[PropNum][cPAgent])][cAImage];
    document.write ('<P>'+ vAgentA[GetAgent(vPropertyA[PropNum][cPAgent])][cAPBio] + '</P>');
    if (vImg.length > 0) document.write ('<IMG ALIGN=LEFT SRC="http://austinrealestateonline.com/images/'+ vImg +'" WIDTH=100>');
    document.write ('<H2>'+ vAgentA[GetAgent(vPropertyA[PropNum][cPAgent])][cAName] +'</H2>');
    document.write ('<H3>RE/MAX River City</H3>');
    document.write ('<H4>Office: '+ vAgentA[GetAgent(vPropertyA[PropNum][cPAgent])][cAPhone] +'<BR>');
    document.write ('Cell: '+ vAgentA[GetAgent(vPropertyA[PropNum][cPAgent])][cACell] +'<BR>');
    vURL = vAgentA[GetAgent(vPropertyA[PropNum][cPAgent])][cAURL];
    if (vURL.length > 0)
     document.write ('<A HREF="http://'+ vURL +'">'+ vURL +'</A><BR>');
    document.write (vAgentA[GetAgent(vPropertyA[PropNum][cPAgent])][cAEmail] +'</H4>');
    document.write ('</TD></TR>');
   }
// ----------------------------------------------------------

// ----------------------------------------------------------
// GETPROPERTY:
   function GetProperty (vTarget) {
    for (vPropertyCount = 0; vPropertyCount <= vPCount; vPropertyCount++) {
     if (vTarget == vPropertyA[vPropertyCount][cPAddress]) 
      return vPropertyCount;
    }
    return 0;
   }
// ----------------------------------------------------------

// ----------------------------------------------------------
// GETAGENT:
   function GetAgent (vTarget) {
    for (vAgentCount = 0; vAgentCount <= vACount; vAgentCount++) {
     if (vTarget == vAgentA[vAgentCount][cAName]) 
      return vAgentCount;
    }
    return 0;
   }
// ----------------------------------------------------------

// ----------------------------------------------------------
// SETUPAGENTS:
   function SetupAgents () {
    for (vAgentCount = 0; vAgentCount <= vACount; vAgentCount++) {
     if (vAgentA[vAgentCount][cAName] != "1")
	document.write ('<option value="'+ vAgentA[vAgentCount][cAName] +'">'+ vAgentA[vAgentCount][cAName] +'</option>');
    }
   }
// ----------------------------------------------------------

// ----------------------------------------------------------
// GETAGENTRESULTS
   function GetAgentResults () {
    var aResults = new Array();
    vResultCount = 0;
    for (vAgentCount = 0; vAgentCount <= vACount; vAgentCount++) {
     if (vAgentA[vAgentCount][cAName] == document.getElementById('SearchForm').AgentName.value) {
      aResults[vResultCount] = vAgentCount;
      vResultCount++;
     }
    }
    vText = " ";
    for (vResultCount = 0; vResultCount <= (aResults.length - 1); vResultCount++) {
     vText += FeaturedAgent (aResults[vResultCount]);
    }
    return vText;
   }
// ----------------------------------------------------------

// ----------------------------------------------------------
// FEATUREDAGENT:
   function FeaturedAgent (AgentNum) {
    vText  = '';
    vImg = vAgentA[AgentNum][cAImage];
    if (vImg.length > 0) vText += '<IMG ALIGN=LEFT SRC="http://austinrealestateonline.com/images/'+ vImg +'" WIDTH=100>';
    if (vAgentA[AgentNum][cAName] != "1") vText += '<div class="text1"><strong>'+ vAgentA[AgentNum][cAName] +'</strong></div>';
    if (vAgentA[AgentNum][cAName] != "1") vText += '<div class="text1">RE/MAX River City</div>';
    if (vAgentA[AgentNum][cAName] != "1") vText += '<div class="text1"><strong>Office: </strong>'+ vAgentA[AgentNum][cAPhone] +'<BR>';
    if (vAgentA[AgentNum][cAName] != "1") vText += '<strong>Cell: </strong>'+ vAgentA[AgentNum][cACell] +'<BR>';
    if (vAgentA[AgentNum][cAName] != "1") vURL = vAgentA[AgentNum][cAURL];
    if (vAgentA[AgentNum][cAName] != "1") {
    if (vURL.length > 0)
     vText += '<A HREF="http://'+ vURL +'">' + vURL +'</A><BR>';}
    if (vAgentA[AgentNum][cAName] != "1") vText += '<A HREF="mailto:'+ vAgentA[AgentNum][cAEmail] +'">' +vAgentA[AgentNum][cAEmail] +'</A></div><br>';
    vText += '<div class="text1">'+ vAgentA[AgentNum][cABio] +'</div>';
    return vText;
   }
// ----------------------------------------------------------

// ----------------------------------------------------------
// GETRESULTS
   function GetResults (vQty, vStart) {
    if (arguments.length < 1) vQty = 10;
    if (arguments.length < 2) vStart = ReadCLine();
    if (vStart == '') vStart = 0;
    var aResults = new Array();
    vResultCount = 0;
    for (vPropertyCount = 0; vPropertyCount <= vPCount; vPropertyCount++) {
     if (
      ((vPropertyA[vPropertyCount][cPAgent] == document.getElementById('SearchForm').PropertyAgent.value) || (document.getElementById('SearchForm').PropertyAgent.value == "Select"))
      &&
      ((vPropertyA[vPropertyCount][cPAddress] == document.getElementById('SearchForm').PropertyAddress.value) || (document.getElementById('SearchForm').PropertyAddress.value == "Select"))
      &&
      ((vPropertyA[vPropertyCount][cPSD] == document.getElementById('SearchForm').PropertySD.value) || (document.getElementById('SearchForm').PropertySD.value == "Select"))
      &&
      ((vPropertyA[vPropertyCount][cPMLS] == document.getElementById('SearchForm').PropertyMLS.value) || (document.getElementById('SearchForm').PropertyMLS.value == "Select"))
      &&
      ((vPropertyA[vPropertyCount][cPType] == document.getElementById('SearchForm').PropertyType.value) || (document.getElementById('SearchForm').PropertyType.value == "Select"))
      &&
      (((vPropertyA[vPropertyCount][cPBed] * 1) >= (document.getElementById('SearchForm').PropertyMinBeds.value * 1)) || (document.getElementById('SearchForm').PropertyMinBeds.value == "Select"))
      &&
      (((vPropertyA[vPropertyCount][cPBed] * 1) <= (document.getElementById('SearchForm').PropertyMaxBeds.value * 1)) || (document.getElementById('SearchForm').PropertyMaxBeds.value == "Select"))
      &&
      ((vPropertyA[vPropertyCount][cPBath] >= document.getElementById('SearchForm').PropertyMinBaths.value) || (document.getElementById('SearchForm').PropertyMinBaths.value == "Select"))
      &&
      ((vPropertyA[vPropertyCount][cPBath] <= document.getElementById('SearchForm').PropertyMaxBaths.value) || (document.getElementById('SearchForm').PropertyMaxBaths.value == "Select"))
      &&
      ((vPropertyA[vPropertyCount][cPGarage] >= document.getElementById('SearchForm').PropertyMinGarage.value) || (document.getElementById('SearchForm').PropertyMinGarage.value == "Select"))
      &&
      ((vPropertyA[vPropertyCount][cPGarage] <= document.getElementById('SearchForm').PropertyMaxGarage.value) || (document.getElementById('SearchForm').PropertyMaxGarage.value == "Select"))
      &&
      ((vPropertyA[vPropertyCount][cPSqFt] >= document.getElementById('SearchForm').PropertyMinSqFt.value) || (document.getElementById('SearchForm').PropertyMinSqFt.value == "Select"))
      &&
      ((vPropertyA[vPropertyCount][cPSqFt] <= document.getElementById('SearchForm').PropertyMaxSqFt.value) || (document.getElementById('SearchForm').PropertyMaxSqFt.value == "Select"))
      &&
      ((vPropertyA[vPropertyCount][cPSize] >= document.getElementById('SearchForm').PropertyMinSize.value) || (document.getElementById('SearchForm').PropertyMinSize.value == "Select"))
      &&
      ((vPropertyA[vPropertyCount][cPSize] <= document.getElementById('SearchForm').PropertyMaxSize.value) || (document.getElementById('SearchForm').PropertyMaxSize.value == "Select"))
      &&
      ((vPropertyA[vPropertyCount][cPYrBlt] >= document.getElementById('SearchForm').PropertyMinYrBlt.value) || (document.getElementById('SearchForm').PropertyMinYrBlt.value == "Select"))
      &&
      ((vPropertyA[vPropertyCount][cPYrBlt] <= document.getElementById('SearchForm').PropertyMaxYrBlt.value) || (document.getElementById('SearchForm').PropertyMaxYrBlt.value == "Select"))
      &&
      ((vPropertyA[vPropertyCount][cPLevels] >= document.getElementById('SearchForm').PropertyMinLevels.value) || (document.getElementById('SearchForm').PropertyMinLevels.value == "Select"))
      &&
      ((vPropertyA[vPropertyCount][cPLevels] <= document.getElementById('SearchForm').PropertyMaxLevels.value) || (document.getElementById('SearchForm').PropertyMaxLevels.value == "Select"))
      &&
      (((vPropertyA[vPropertyCount][cPPrice] * 1) >= (document.getElementById('SearchForm').PropertyMinPrice.value * 1)) || (document.getElementById('SearchForm').PropertyMinPrice.value == "Select"))
      &&
      (((vPropertyA[vPropertyCount][cPPrice] * 1) <= (document.getElementById('SearchForm').PropertyMaxPrice.value * 1)) || (document.getElementById('SearchForm').PropertyMaxPrice.value == "Select"))
      ) {
      aResults[vResultCount] = vPropertyCount;
      vResultCount++;
     }
    }
    vText = " ";

    vStart2 = vStart;
    vQty2 = vQty;
    vFeatCount = aResults.length;
    vPageCount = Math.round((vFeatCount / vQty) + .5);
    vCurrentPage = Math.round((vStart / vQty) + .5);
    
	//var string=(location.href); 
	//var getit=new Array(); 
	//var getit=string.split('s='); 
	//var result=getit[1]; 
	//if (result != "undefined") { 
	//	vCurrentPage = 1;
	//	if (result > 9) { 
	//	vCurrentPage = Math.round((result / 10) + 1);
	//	}
	//}

	vText += "<B>"+ vFeatCount +" Properties</B>";
	vText += "<DIV CLASS=RIGHT>Page "+ vCurrentPage +" of "+ vPageCount +"</DIV>";	
//    vText += "<span CLASS=RIGHT>Page "+ vCurrentPage  +" of "+ vPageCount +"</span><hr>";
    for (vResultCount = 0; vResultCount <= (aResults.length - 1); vResultCount++) {
     vStart2--;
     if (vStart2 < 0) {
      vText += FeaturedProperty_B (aResults[vResultCount], cMinimal);
      vQty2--;
      if (vQty2 == 0) vResultCount = vFeatCount+1;
     }
    }
    vText += "</TABLE>";

    vText += "<HR><table width=100% align=CENTER>"
    if (vStart*1 > vQty*1-1) vText += "<tr><td width=50% align=left><A HREF='javascript:void(0);' onclick='document.getElementById(\"ResultSpan\").innerHTML=GetResults(cResultQty, "+ (vStart*1 - vQty*1) +");'><< Prev </A></td>";
    if (vStart*1 + vQty*1 <= vFeatCount*1) vText += "<td width=50% align=right><A HREF='javascript:void(0);' onclick='document.getElementById(\"ResultSpan\").innerHTML=GetResults(cResultQty, "+ (vStart*1 + vQty*1) +");'>Next >></A></td>";
    vText += "</tr></TABLE>"

    return vText;
   }
// ----------------------------------------------------------
function select1_onchange() {
	   var temp = select1.options[select1.selectedIndex].value;
	   if (temp != "NoGo")		
	   {
		   window.location.href = temp;
    	}
   }
// ----------------------------------------------------------
function select2_onchange() {
	   var temp = select2.options[select2.selectedIndex].value;
	   if (temp != "NoGo")		
	   {
		   window.location.href = temp;
    	}
   }
// ----------------------------------------------------------
// ShowFeatures
   function ShowFeatures (vQty, vStart) {
    if (arguments.length < 1) vQty = 10;
    if (arguments.length < 2) vStart = ReadCLine();
    if (vStart == '') vStart = 0;
    vText = " ";
    vStart2 = vStart;
    vQty2 = vQty;
    vFeatCount = 0;
    for (vCount = 0; vCount <= vPCount; vCount++) {
     //if (vPropertyA[vCount][cPFeatured] == "Y") 
	   vFeatCount++;
    }
    //vText += "<B>"+ vFeatCount + " Properties</B>";
    vText += "<table width=100% border=0><tr><td><B>"+ vFeatCount + " Properties</B></td>";
    //vCurrentPage = vStart * vQty;
    vPageCount = Math.round((vFeatCount / vQty) + .5);
    //vCurrentPage = Math.round((vCurrentPage / vPageCount) + .5);

	var string=(location.href); 
	var getit=new Array(); 
	var getit=string.split('s='); 
	var result=getit[1]; 
	if (result != "undefined") { 
		vCurrentPage = 1;
		if (result > 9) { 
		vCurrentPage = Math.round((result / 10) + 1);
		}
	}
	vText += "<td align=right>Page "+ vCurrentPage +" of "+ vPageCount +"</td></tr></TABLE>";	
	vText += "<table border=1 width=100% align=center style=border-style:none bgcolor=#F4F4F4 cellpadding=3><tr><td><table width=100% border=0><tr><td width=40% align=left valign=top><SELECT id=select1 name=select1 class='gensmall2' LANGUAGE=javascript onchange='select1_onchange()'>";
	vText += "<OPTION VALUE='NoGo' selected>Search by Address</OPTION>";
	vText += GetOptionValues(vCount);
	vText += "</SELECT></td>";
	vText += "<td width=20% valign=middle align=center><a href=search.htm class='gensmall2'>Advanced Search</a></td>";
	vText += "<td width=40% align=right valign=middle><form name=form2 method=post action=search.asp>";
	vText += "<select name=ptype class='gensmall2' onChange='document.form2.submit()'>";
	vText += "<option>Search by Property Type</option>";
	vText += "<option value='1'>Land / Lot</option>";
	vText += "<option value='2'>Single Family</option>";
	vText += "<option value='3'>Lease</option>";
	vText += "<option value='4'>Farm and Ranch</option>";
	vText += "<option value='5'>Commercial</option>";
	vText += "<option value='6'>Multi-Family</option>";
	vText += "<option value='7'>Condo</option>";
	vText += "<option value='8'>Waterfront</option>";
	vText += "</select></form></td></tr></table></td></tr></table>";
    vText += "<HR>";
    for (vCount = 0; vCount <= vPCount; vCount++) {
    //if (vPropertyA[vCount][cPFeatured] == "Y")
	if ((vPropertyA[vCount][cPFeatured] == "Y")||(vPropertyA[vCount][cPFeatured] == "N"))
	 {
      vStart2--;
      if (vStart2 < 0) {
       vText += FeaturedProperty_B (vCount, cFull);
       vQty2--;
       if (vQty2 == 0) vCount = vPCount + 1;
      }
     }
    }
	vText += "<table width=100% align=center><tr>";
    if (vStart*1 > vQty*1-1) vText += "<td width=50% class=gensmall><A HREF='remaxproperties.html?s="+ (vStart*1 - vQty*1) +"'>&laquo;&nbsp;Prev</A></td>";
    if (vStart*1 + vQty*1 <= vFeatCount*1) vText += "<td width=50% align=right class=gensmall><A HREF='remaxproperties.html?s="+ (vStart*1 + vQty*1) +"'>Next&nbsp;&raquo;</A></td>";
	vText += "</tr></table>";
    return vText;
   }
// ----------------------------------------------------------

// ----------------------------------------------------------
// ShowFeatures_S
   function ShowFeatures_S (vDisplayCount) {
    vDisplayCount = vDisplayCount * 1;
    if (vDisplayCount > vPCount) vDisplayCount = vPCount;
    vText = " ";
    vSegment = vPCount / vDisplayCount;
    for (vCount = 0; vCount < vDisplayCount; vCount++) {
     vRandom = Math.random() * vSegment + (vSegment * vCount);
     vRandom = Math.floor(vRandom);
     if (vPropertyA[vRandom][cPFeatured] == "Y") 
      vText += FeaturedProperty_B (vRandom, cDefault); else vCount--;
    }
    return vText;
   }
// ----------------------------------------------------------
// ADDLINK
function AddLink (LINK_URL, LINK_TEXT) {
 document.write ('<A HREF=\'javascript: void(0);\' onclick=\'window.open("http://'+ LINK_URL +'", "link");\'>');
 document.write (LINK_TEXT + "</A><HR>");
}
// ----------------------------------------------------------

// ----------------------------------------------------------
// LINESDOWNCLASSIC
function LinesdownClassic() {
 clearTimeout(cfunc);
 var str="<li><a href="+content[ccap][url]+" TARGET=_BLANK><nobr>"+content[ccap][caption].substr(0,40)+"</nobr></a><br>";
 //var str="<li><a href="+content[ccap][url]+" TARGET=_BLANK><nobr>"+content[ccap][caption] +"</nobr></a><br>";
 var hn=0;
 var now=new Date();
 for(var i=1;i<6;i++) {
  hn=((ccap+i)<content.length)?ccap+i:ccap+i-content.length;
  str+="<li><a href="+content[hn][url]+" TARGET=_BLANK><nobr>"+content[hn][caption].substr(0,40)+"</nobr></a><br>";
 }
 var id=document.getElementById("div_n4s");
 id.innerHTML=str;
 ccap=(ccap==0) ? content.length-1 : ccap-1;
 cfunc=setTimeout("LinesdownClassic()",3000);
}
// ----------------------------------------------------------

// ----------------------------------------------------------
// SHOWNEWS
function ShowNews () {
 document.write ('<DIV ID="NEWSFRAME">');
 document.write ('<table class="BodyLine" cellspacing="0" cellpadding="3" width="100%" border="0">');
 document.write ('<tbody><tr><th class="DHeader">In The News</th></tr>');
 document.write ('<tr><td class="DBody">');
 document.write ('<div id=div_n4s></div>');
 ccap=0;
 cword=0;
 cfunc="LinesdownClassic"; 
 LinesdownClassic();
 document.write ('</td></tr></tbody></table></DIV>');
}
// ----------------------------------------------------------

// ----------------------------------------------------------
// GENERAL:
//   document.write (' ');
//   document.write ('<TABLE WIDTH=100%>');
//   FeaturedProperty_s(0);
//   FeaturedProperty_s(1);
//   FeaturedProperty_s(2);
//   FeaturedProperty_s(3);
//   document.write ('</TABLE>');
// ----------------------------------------------------------
