//
//    mainRollOver
//
//    This provides the methods needed to do roll overs for the main page.  There is a delay in roll over.   
//    This permits the user to move over a picture without displaying the data, but, delaying over the image for 
//    5 seconds will cause the property data to be displayed.
//

    var imgName ;

    function windowWidth() {
        return (document.body.clientWidth) ;

    }


    function OnRollOver(number) {
        var label = "S"+number ;
        var i     = number     ;
       if ((imgName != "NONE") && (label == imgName)) {
            if (propertyList[i].landOnly == 1) {
                document.all['LotAddress'].innerHTML = propertyList[i].street + ", " + propertyList[i].city ;
                document.all['LotDescription'].innerHTML = propertyList[i].comment ;
                document.all['LotAcreage'].innerHTML = propertyList[i].size ;
        
                document.all['LotInfoLayer'].style.top  = parseInt(document.all[imgName].style.top) + 10  ;
                if (parseInt(document.all[imgName].style.left) > windowWidth()/2 - 100) {
                    document.all['LotInfoLayer'].style.left = parseInt(document.all[imgName].style.left) - 
                        parseInt(document.all['LotInfoLayer'].style.width) + 10 ;
                } else {
                    document.all['LotInfoLayer'].style.left = parseInt(document.all[imgName].style.left) + 180  ;
                }  
            } else {
                document.all['address'].innerHTML = propertyList[i].street + ", " + propertyList[i].city ;
                document.all['description'].innerHTML = propertyList[i].comment ;
                document.all['acreage'].innerHTML = propertyList[i].size ;
                document.all['bed'].innerHTML   = "Bed/Bath: " + propertyList[i].bed_bath;
        
                document.all['PropertyInfoLayer'].style.top  = parseInt(document.all[imgName].style.top) + 10  ;
                if (parseInt(document.all[imgName].style.left) > windowWidth()/2 - 100) {
                    document.all['PropertyInfoLayer'].style.left = parseInt(document.all[imgName].style.left) - 
                        parseInt(document.all['PropertyInfoLayer'].style.width) + 10 ;
                } else {
                    document.all['PropertyInfoLayer'].style.left = parseInt(document.all[imgName].style.left) + 180  ;
                }
            }
        }        
    }

    

    function OnRollOverProperty (i) {

        imgName = 'S' + i ;
        setTimeout("OnRollOver("+i+")",500) ;

    }

    function OnRollOutProperty (i) {
        imgName ="NONE" ; 
        document.all['LotInfoLayer'].style.top       = 5500 ;
        document.all['LotInfoLayer'].style.left      = 20  ; 

        document.all['PropertyInfoLayer'].style.top  = 5500 ;
        document.all['PropertyInfoLayer'].style.left = 20  ;
    }
    
