//:: /typo3conf/ext/housingestate_mgm/pi1/static/housingestatemgm.js
//===============================================================
window.addEvent('load',function(){housingestatemgm.loadFlatImages();});housingestatemgm={currentenDisplayedFlatImage:0,checkFromTo:function(fromField,toField){var d=document;var from=parseFloat(d.getElementById("roomsFrom").value);var to=parseFloat(d.getElementById("roomsTo").value);if(fromField.selectedIndex!=0&&toField.selectedIndex!=0){if(to<from){var store=from;d.getElementById("roomsFrom").value=to;d.getElementById("roomsTo").value=store;}}},loadFlatImages:function(){if(typeof housingestatemgm_variables=='undefined'){return;}
for(var i=0;i<housingestatemgm_variables.flatImages.length;i++){var flatData=housingestatemgm_variables.flatImages[i];if(flatData.image){$('imageContainer').innerHTML+='<div id="flatImage'+flatData.uid+'" class="flatImage">'+flatData.image+'</div>';}}},showFlatImage:function(id){if(!$('flatImage'+id)){return this.showDefaultFlatImage();}
if($('flatImage'+this.currentenDisplayedFlatImage)){$('flatImage'+this.currentenDisplayedFlatImage).style.display='none';}
this.currentenDisplayedFlatImage=id;$('flatImage'+id).style.display='block';},showDefaultFlatImage:function(){if($('flatImage'+this.currentenDisplayedFlatImage)){$('flatImage'+this.currentenDisplayedFlatImage).style.display='none';}
this.currentenDisplayedFlatImage=0;$('flatImage0').style.display='block';}}


