var myJSONObject = {"listing": [{"name": "8.85 Acre Waterfront Development...", "price": "", "sqFoot": "", "location": "North Fort Myers, FL", "listingNumber": "", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=121", "photo": "media/images/listings/121/lq_photo_00000131_preview.jpg", "minRate": "", "propType": "Land, Bank Owned", "maxRate": ""},{"name": "8,596 SF Professional Building F...", "price": "", "sqFoot": "", "location": "Cape Coral, FL", "listingNumber": "15904792", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=135", "photo": "media/images/listings/135/lq_photo_00000426_preview.jpg", "minRate": "", "propType": "Office, Bank Owned", "maxRate": ""},{"name": "56,715 SF Outparcel For Sale", "price": "$850,000", "sqFoot": "", "location": "Cape Coral, FL", "listingNumber": "16184088", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=163", "photo": "media/images/listings/163/lq_photo_00000208_preview.jpg", "minRate": "", "propType": "Land, Bank Owned", "maxRate": ""},{"name": "43,520 SF Commercial Development...", "price": "", "sqFoot": "", "location": "Lehigh Acres, FL", "listingNumber": "16220846", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=168", "photo": "media/images/listings/168/lq_photo_00000238_preview.jpg", "minRate": "", "propType": "Land, Bank Owned", "maxRate": ""},{"name": "POST FORECLOSURE LIQUIDATION - 2...", "price": "Call Now - Fantastic Year End Closing Price", "sqFoot": "", "location": "Fort Myers, FL", "listingNumber": "", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=171", "photo": "media/images/listings/171/lq_photo_00000252_preview.jpg", "minRate": "", "propType": "Industrial, Bank Owned", "maxRate": ""},{"name": "1.84 Acre Residential Developmen...", "price": "", "sqFoot": "", "location": "Fort Myers, FL", "listingNumber": "16380562", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=210", "photo": "media/images/listings/210/lq_photo_00000364_preview.jpg", "minRate": "", "propType": "Land, Bank Owned", "maxRate": ""},{"name": "Bank Owned Development Site", "price": "$1,700,000", "sqFoot": "", "location": "Bonita Springs, FL", "listingNumber": "16586025", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=248", "photo": "media/images/listings/248/lq_photo_00000495_preview.jpg", "minRate": "", "propType": "Land, Bank Owned", "maxRate": ""},{"name": "Publix at Northridge", "price": "", "sqFoot": "", "location": "Sarasota, FL", "listingNumber": "16558300", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=237", "photo": "media/images/listings/237/lq_photo_00000456_preview.jpg", "minRate": "", "propType": "Retail", "maxRate": ""},{"name": "11 Sites - Residential Developme...", "price": "$199,000 - Bulk Price", "sqFoot": "", "location": "Saint James City, FL", "listingNumber": "16280762", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=190", "photo": "media/images/listings/190/lq_photo_00000322_preview.jpg", "minRate": "", "propType": "Land, Bank Owned", "maxRate": ""},{"name": "Premier Community Center for Lea...", "price": "", "sqFoot": "", "location": "Bradenton, FL", "listingNumber": "16529430", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=234", "photo": "media/images/listings/234/lq_photo_00000437_preview.jpg", "minRate": "", "propType": "Retail", "maxRate": ""},{"name": "Bank Branch For Sale", "price": "$1,450,000", "sqFoot": "", "location": "Englewood, FL", "listingNumber": "16298787", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=196", "photo": "media/images/listings/196/lq_photo_00000334_preview.jpg", "minRate": "", "propType": "Office", "maxRate": ""},{"name": "Bayshore Gardens", "price": "", "sqFoot": "", "location": "Bradenton, FL", "listingNumber": "16558114", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=238", "photo": "media/images/listings/238/lq_photo_00000461_preview.jpg", "minRate": "", "propType": "Retail", "maxRate": ""},{"name": "University Plaza", "price": "$12.00 - $26.00 PSF", "sqFoot": "", "location": "Fort Myers, FL", "listingNumber": "", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=249", "photo": "media/images/listings/249/lq_photo_00000500_preview.jpg", "minRate": "", "propType": "Land", "maxRate": ""}]}; var _doIt="1"; var timerID = 0; var _currentIndex=""; var _listingCount; var _listingHref2=""; timerID = setTimeout("initListing();", 1500); function goDetails(){ location=_listingHref2; } function Start() { timerID = setTimeout("listingNext()", 5000); } function Stop() { if(timerID) { clearTimeout(timerID); timerID = 0; } } function initListing(){ if(myJSONObject){ _listingCount = myJSONObject.listing.length-1; random_num = (Math.round((Math.random()*_listingCount))) loadListing(random_num); //alert(random_num); Start(); }else{ // alert("-1"); } } function listingNext(){ clearTimeout(timerID); _currentIndex++; if(_currentIndex>_listingCount){ _currentIndex=0; } loadListing(_currentIndex); timerID = setTimeout("listingNext()", 5000); } function listingPrev(){ clearTimeout(timerID); _currentIndex--; if(_currentIndex<0){ _currentIndex=_listingCount; } loadListing(_currentIndex); timerID = setTimeout("listingNext()", 5000); } function loadListing(_listingIndex){ _currentIndex=_listingIndex var _listingObj=myJSONObject.listing[_listingIndex]; if(_listingObj){ _listingHref2=_listingObj.listingHref; if(document.all){ if(document.getElementById("ps_listingName")){ document.getElementById("ps_listingName").innerText=_listingObj.name; } if(document.getElementById("ps_price")){ if(_listingObj.price!=""){ document.getElementById("tr_price").style.display=""; document.getElementById("ps_price").innerHTML=_listingObj.price; }else{ document.getElementById("tr_price").style.display="none"; } } if(document.getElementById("ps_minRate")){ document.getElementById("ps_minRate").innerHTML=(_listingObj.minRate!="")?_listingObj.minRate+"
":""; } if(document.getElementById("ps_sqFoot")){ if(_listingObj.sqFoot!=""){ document.getElementById("tr_sqFoot").style.display=""; document.getElementById("ps_sqFoot").innerHTML=_listingObj.sqFoot; }else{ document.getElementById("tr_sqFoot").style.display="none"; } } if(document.getElementById("ps_location")){ document.getElementById("ps_location").innerText=_listingObj.location; } if(document.getElementById("ps_listingNumber")){ if(_listingObj.listingNumber!=""){ document.getElementById("tr_listingNumber").style.display=""; document.getElementById("ps_listingNumber").innerText=_listingObj.listingNumber; }else{ document.getElementById("tr_listingNumber").style.display="none"; } } if(document.getElementById("photo1")){ document.getElementById("photo1").src=_listingObj.photo; } if(document.getElementById("ps_propType")){ document.getElementById("ps_propType").innerHTML=_listingObj.propType; } } else{ if(document.getElementById("ps_listingName")){ document.getElementById("ps_listingName").textContent=_listingObj.name; } if(document.getElementById("ps_price")){ document.getElementById("ps_price").textContent=_listingObj.price; } if(document.getElementById("ps_sqFoot")){ document.getElementById("ps_sqFoot").innerHTML=(_listingObj.sqFoot!=" x ")?_listingObj.sqFoot+"
":""; } if(document.getElementById("ps_location")){ document.getElementById("ps_location").textContent=_listingObj.location; } if(document.getElementById("ps_listingNumber")){ document.getElementById("ps_listingNumber").textContent=_listingObj.listingNumber; } if(document.getElementById("ps_propType")){ document.getElementById("ps_propType").innerHTML=_listingObj.propType; } if(document.getElementById("photo1")){ document.getElementById("photo1").src=_listingObj.photo; } //document.getElementById('element').textContent = "my text"; } }else{ timerID = setTimeout("initListing();", 500); } }