var myJSONObject = {"listing": [{"name": "56,715 SF Outparcel For Sale", "price": "Undisclosed", "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": "Bonita Springs Retail For Lease", "price": "", "sqFoot": "", "location": "Bonita Springs, FL", "listingNumber": "17393926", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=397", "photo": "media/images/listings/397/lq_photo_00001111_preview.jpg", "minRate": "", "propType": "Retail", "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": "Waterfront Development Site with...", "price": "$6,100,000", "sqFoot": "", "location": "North Fort Myers, FL", "listingNumber": "16652794", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=265", "photo": "media/images/listings/265/lq_photo_00000579_preview.jpg", "minRate": "", "propType": "Land, Bank Owned", "maxRate": ""},{"name": "Free Standing Restaurant - US 41", "price": "", "sqFoot": "", "location": "Fort Myers, FL", "listingNumber": "", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=278", "photo": "media/images/listings/278/lq_photo_00000623_preview.jpg", "minRate": "", "propType": "Restaurant", "maxRate": ""},{"name": "13.3 AC Pine Island Road Frontage", "price": "$1,790,000 ($3.00 PSF)", "sqFoot": "", "location": "Cape Coral, FL", "listingNumber": "16356683", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=205", "photo": "media/images/listings/205/lq_photo_00001238_preview.jpg", "minRate": "", "propType": "Land, Bank Owned", "maxRate": ""},{"name": "Beachway Plaza", "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": "Cape Coral Parkway & Del Prado B...", "price": "$1,975,575 ($75 PSF)", "sqFoot": "", "location": "Cape Coral, FL", "listingNumber": "16825552", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=297", "photo": "media/images/listings/297/lq_photo_00000675_preview.jpg", "minRate": "", "propType": "Office", "maxRate": ""},{"name": "Prominent Medical/Professional O...", "price": "", "sqFoot": "", "location": "Port Charlotte, FL", "listingNumber": "16756960", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=288", "photo": "media/images/listings/288/lq_photo_00001153_preview.jpg", "minRate": "", "propType": "Office", "maxRate": ""},{"name": "Pier 1 Imports Plaza", "price": "", "sqFoot": "", "location": "Fort Myers, FL", "listingNumber": "16815843", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=295", "photo": "media/images/listings/295/lq_photo_00000670_preview.jpg", "minRate": "", "propType": "Retail", "maxRate": ""},{"name": "Bank Branch For Sale", "price": "$825,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, Bank Owned", "maxRate": ""},{"name": "Bank Owned Parcels For Sale", "price": "$295,000 - $1,660,000", "sqFoot": "", "location": "Port Charlotte, FL", "listingNumber": "16774875", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=294", "photo": "media/images/listings/294/lq_photo_00001176_preview.jpg", "minRate": "", "propType": "Land, Bank Owned", "maxRate": ""},{"name": "Medical Office Condo For Sale", "price": "$210,000.00", "sqFoot": "", "location": "Sarasota, FL", "listingNumber": "17205109", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=358", "photo": "media/images/listings/358/lq_photo_00000868_preview.jpg", "minRate": "", "propType": "Office, Bank Owned", "maxRate": ""},{"name": "Lee Boulevard West Retail Center", "price": "$1,650,000", "sqFoot": "", "location": "Lehigh Acres, FL", "listingNumber": "16614609", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=254", "photo": "media/images/listings/254/lq_photo_00000568_preview.jpg", "minRate": "", "propType": "Retail, Investment", "maxRate": ""},{"name": "Flex Space For Lease", "price": "", "sqFoot": "", "location": "Fort Myers, FL", "listingNumber": "16615679", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=256", "photo": "media/images/listings/256/lq_photo_00001085_preview.jpg", "minRate": "", "propType": "Industrial", "maxRate": ""},{"name": "Entitled Office / Retail Site", "price": "$462,000 ($12.00 PSF)", "sqFoot": "", "location": "Fort Myers, FL", "listingNumber": "", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=277", "photo": "media/images/listings/277/lq_photo_00000622_preview.jpg", "minRate": "", "propType": "Land", "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": "16645140", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=249", "photo": "media/images/listings/249/lq_photo_00001084_preview.jpg", "minRate": "", "propType": "Land", "maxRate": ""},{"name": "Commercial Land For Sale", "price": "$1,539,500 ($6.95 PSF)", "sqFoot": "", "location": "Fort Myers, FL", "listingNumber": "16698170", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=276", "photo": "media/images/listings/276/lq_photo_00000635_preview.jpg", "minRate": "", "propType": "Land", "maxRate": ""},{"name": "Bank Owned Land For Sale", "price": "$1,100,000", "sqFoot": "", "location": "Cape Coral, FL", "listingNumber": "17237520", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=366", "photo": "media/images/listings/366/lq_photo_00000886_preview.jpg", "minRate": "", "propType": "Land, Bank Owned", "maxRate": ""},{"name": "Approved Development Parcel For ...", "price": "$1,120,000", "sqFoot": "", "location": "Naples, FL", "listingNumber": "17409263", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=399", "photo": "media/images/listings/399/lq_photo_00001126_preview.jpg", "minRate": "", "propType": "Land, Bank Owned", "maxRate": ""},{"name": "Lee Boulevard Parcel For Sale", "price": "$535,000", "sqFoot": "", "location": "Lehigh Acres, FL", "listingNumber": "17376766", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=393", "photo": "media/images/listings/393/lq_photo_00001092_preview.jpg", "minRate": "", "propType": "Land", "maxRate": ""},{"name": "Bank Owned Office/Warehouse For ...", "price": "$380,000", "sqFoot": "", "location": "North Fort Myers, FL", "listingNumber": "17375249", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=394", "photo": "media/images/listings/394/lq_photo_00001097_preview.jpg", "minRate": "", "propType": "Office, Bank Owned", "maxRate": ""},{"name": "Bank Owned Industrial Parcels Fo...", "price": "$299,000", "sqFoot": "", "location": "Fort Myers, FL", "listingNumber": "17420362", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=402", "photo": "media/images/listings/402/lq_photo_00001139_preview.jpg", "minRate": "", "propType": "Land, Bank Owned", "maxRate": ""},{"name": "Office Complex For Sale", "price": "$435,000", "sqFoot": "", "location": "Fort Myers, FL", "listingNumber": "17007683", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=323", "photo": "media/images/listings/323/lq_photo_00001189_preview.jpg", "minRate": "", "propType": "Office", "maxRate": ""},{"name": "Bank Owned Industrial Parcels Fo...", "price": "$1,999,000", "sqFoot": "", "location": "Fort Myers, FL", "listingNumber": "17420382", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=403", "photo": "media/images/listings/403/lq_photo_00001140_preview.jpg", "minRate": "", "propType": "Land, Bank Owned", "maxRate": ""},{"name": "Professional Office Suites - Lak...", "price": "", "sqFoot": "", "location": "Sarasota, FL", "listingNumber": "17376128", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=395", "photo": "media/images/listings/395/lq_photo_00001101_preview.jpg", "minRate": "", "propType": "Office", "maxRate": ""},{"name": "3,675 SF Free Standing Building", "price": "$329,900 ($90 PSF)", "sqFoot": "", "location": "Cape Coral, FL", "listingNumber": "17134110", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=339", "photo": "media/images/listings/339/lq_photo_00000808_preview.jpg", "minRate": "", "propType": "Office", "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); } }