YAHOO.util.Event.addListener(window,'load',function(){doImageLoad()}); function doImageLoad(){ var objImage = document.getElementById('imgProperty_Image'); var objPropImage = document.getElementById('Property_Image'); //var objImage = iQ.Utils.getBrowserObject('imgProperty_Image'); //var objPropImage = iQ.Utils.getBrowserObject('Property_Image'); var tmpMargin = 0; if( window.getComputedStyle ){ var currDivHeight = window.getComputedStyle(objPropImage,null).height; }else if(objPropImage.currentStyle ){ var currDivHeight = objPropImage.currentStyle.height; } var currDivHeight = currDivHeight.replace('px',''); //this converts to a int currDivHeight = currDivHeight * 1; var currImgHeight = objImage.height; //this converts to a int currImgHeight = currImgHeight * 1; if(currImgHeight > currDivHeight){ tmpDiff = eval(currImgHeight - currDivHeight); tmpMargin = tmpDiff / 2; } objImage.style.marginTop = '-' + tmpMargin; //if we are on the map page then lets make sure the object is there //if it is then lets load the map //var objMap = iQ.Utils.getBrowserObject('myMap'); //if(objMap){ // doLoadMaps(); //} //var objPhotoTour = iQ.Utils.getBrowserObject('myPhotoTour'); } var objMap = null; function doLoadMaps(){ objMap = new VEMap('myMap'); objMap.LoadMap(); objMap.ClearInfoBoxStyles(); objMap.Find(null,'#rsPropertyInfo.StreetAddress#,#rsPropertyInfo.Zip_Code#',null,null,0,1,false,false,false,true,function(){doMapProp()}); } function doMapProp(){ objLatLong = objMap.GetCenter(); var shape = new VEShape(VEShapeType.Pushpin,objLatLong); shape.SetTitle('Property Location'); shape.SetDescription('#rsPropertyInfo.StreetAddress#'); shape.SetCustomIcon('