(function(window){var site=function(){return new site.fn.init();};site.fn=site.prototype={init:function(){},propertySearch:function(){jQuery.xero.ajax.add({type:"POST",url:"./property-search.json",dataType:"json",data:{name:jQuery("#property_name").val()},async:false,success:function(ret,textStatus){try{if(ret.property){jQuery("#property_name").val(ret.property.name);jQuery("#property_address").val(ret.property.address);jQuery("#property_address2").val(ret.property.address2);jQuery("#property_zip").val(ret.property.zip);jQuery("#property_general").val(ret.property.general);jQuery("#property_specific").val(ret.property.specific);jQuery("#property_size").val(ret.property.size);jQuery("#property_occupancy").val(ret.property.occupancy);jQuery("#property_age").val(ret.property.age);}else{jQuery.xero.message.show(ret.error.type,"Property Search",ret.error.message);}}catch(e){jQuery.xero.logging.exception(e);}}});},contactSearch:function(){jQuery.xero.ajax.add({type:"POST",url:"./contact-search.json",dataType:"json",data:{first:jQuery("#contact_first").val(),last:jQuery("#contact_last").val(),address:jQuery("#contact_address").val()},async:false,success:function(ret,textStatus){try{if(ret.contact){jQuery("#contact_first").val(ret.contact.first);jQuery("#contact_last").val(ret.contact.last);jQuery("#contact_address").val(ret.contact.address);jQuery("#contact_address2").val(ret.contact.address2);jQuery("#contact_zip").val(ret.contact.zip);jQuery("#contact_phone").val(ret.contact.phone);jQuery("#contact_email").val(ret.contact.email);jQuery("#contact_fax").val(ret.contact.fax);jQuery("#contact_occupancy").val(ret.contact.occupancy);jQuery("#contact_age").val(retcontact.age);}else{jQuery.xero.message.show(ret.error.type,"Contact Search",ret.error.message);}}catch(e){jQuery.xero.logging.exception(e);}}});},fetchLinks:function(){jQuery.xero.ajax.add({type:"GET",url:"/links/tree-view.json",dataType:"html",async:false,success:function(ret,textStatus){try{jQuery("#tree-for-links").html(ret);jQuery("#tree-for-links").treeview({});}catch(e){jQuery.xero.message.error("Exception",e);}}});},loadPage:function(url,target){if(target){window.open(url,target);}else{window.location=url;}}};site.fn.init.prototype=site.fn;window.site=site();})(window);