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": "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": "$2,500,000", "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,600,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": "Waterfront Development Site with...", "price": "$7,200,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": "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": "North Pointe Plaza Office Space ...", "price": "", "sqFoot": "", "location": "North Fort Myers, FL", "listingNumber": "16605652", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=252", "photo": "media/images/listings/252/lq_photo_00000511_preview.jpg", "minRate": "", "propType": "Office", "maxRate": ""},{"name": "The Preserve - Bonita Office Bui...", "price": "$650,000 Each", "sqFoot": "", "location": "Bonita Springs, FL", "listingNumber": "16710907", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=280", "photo": "media/images/listings/280/lq_photo_00000630_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_00000646_preview.jpg", "minRate": "", "propType": "Office", "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": "Lee Boulevard West Retail Center", "price": "$3,499,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_00000525_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_00000531_preview.jpg", "minRate": "", "propType": "Land", "maxRate": ""},{"name": "Pine Island Marketplace", "price": "$11,200,000", "sqFoot": "", "location": "Cape Coral, FL", "listingNumber": "16639218", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=264", "photo": "media/images/listings/264/lq_photo_00000571_preview.jpg", "minRate": "", "propType": "Retail, Bank Owned, Investment", "maxRate": ""},{"name": "Prominent Fort Myers Office For ...", "price": "", "sqFoot": "", "location": "Fort Myers, FL", "listingNumber": "16682642", "listingHref": "florida-commercial-real-estate-for-sale-detail.html?ID=273", "photo": "media/images/listings/273/lq_photo_00000615_preview.jpg", "minRate": "", "propType": "Office", "maxRate": ""},{"name": "Commercial Land For Sale", "price": "$1,716,703 ($7.75 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": ""}]};
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);
}
}