
$(document).ready(function(){if(getFlashVersion()=='0,0,0'&&!$('#gallery').is('visible')){$('#gallery').show();var galleries=$('#gallery').adGallery({loader_image:"/img/loading.gif",thumb_opacity:0.7,animate_first_image:true,scroll_jump:0,display_back_and_forward:false,effect:'fade',resize:false});}
$('#properties-listings-left').tabs();$('#pp-tabs, #pp-comments').tabs();$('#pp-tabs').bind('tabsshow',function(event,ui){if(ui.panel.id=="map"){initialize_map();}});$('#PropertySort').bind('change',function(){$('#PropertyAddForm').submit();});$('#pp-share-button').bind('click',function(){$('#pp-share-loading').fadeIn(function(){$.post($('#PropertyShareAddForm').attr('action'),$('#PropertyShareAddForm').serialize(),function(data){$('#PropertyShareYourEmail').val('');$('#PropertyShareFriendsEmail').val('');$('#PropertyShareMessage').val('');alert($('notice',data).html());$('#pp-share-loading').fadeOut();},'text');});});if($('.pp-comment-comment').length==0){$('#pp-comment-nocomment').show();}
$('#pp-comment-button').bind('click',function(){$('#PropertyCommentAddForm .input').each(function(){$(this).removeClass('error');if($(this).find('div.error-message').length>0){$(this).find('div.error-message').remove();}});$('#pp-comment-loading').fadeIn(function(){$.post($('#PropertyCommentPropertyForm').attr('action'),$('#PropertyCommentPropertyForm').serialize(),function(data){$('error',data).each(function(){$('#'+$(this).attr('model')+$(this).attr('field')).parent().addClass('error');$('#'+$(this).attr('model')+$(this).attr('field')).after('<div class="error-message">'+$(this).attr('message')+'</div>');});if($('error',data).length<=0){$('#PropertyCommentEmail').val($('#PropertyCommentEmail').val());$('#PropertyCommentName').val($('#PropertyCommentName').val());$('#PropertyCommentComment').val($('#PropertyCommentComment').val());$('#pp-comment-nocomment').hide();$('#pp-comment-loading').hide();$('#pp-post-comment').fadeOut(function(){$('#pp-comment-area').append($('data',data).html());$('html, body').animate({scrollTop:$('#layouts-listings-footer').offset().top});});}
else{alert($('notice',data).html());}},'text');});});if($('#pp-content').html()){$.get(ping_url);}
$('#pp-post-comment-toggle').bind('click',function(){if($('#pp-post-comment').css('display')=='block'){$('#pp-post-comment').fadeOut();}
else{$('#pp-post-comment').fadeIn();}});$('#pp-post-comment input').click(function(){if($(this).val()=='Name'||$(this).val()=='Email'){$(this).select();}});$('#pp-post-comment textarea').click(function(){if($(this).val()=='Type your comment here'){$(this).select();}});});function initialize_map(){try{var geocoder;var map;geocoder=new google.maps.Geocoder();var latlng=new google.maps.LatLng(-34.397,150.644);var myOptions={zoom:18,center:latlng,mapTypeId:google.maps.MapTypeId.ROADMAP};map=new google.maps.Map(document.getElementById('property-map-render'),myOptions);if(geocoder){geocoder.geocode({'address':address},function(results,status){if(status==google.maps.GeocoderStatus.OK){map.setCenter(results[0].geometry.location);var marker=new google.maps.Marker({map:map,position:results[0].geometry.location});}});}}
catch(err){}}
function getFlashVersion(){try{try{var axo=new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');try{axo.AllowScriptAccess='always';}
catch(e){return'6,0,0';}}catch(e){}
return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g,',').match(/^,?(.+),?$/)[1];}catch(e){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){return(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1];}}catch(e){}}
return'0,0,0';}