(function($){
/**
 * jQuery outerhtml
 *
 * Copyright (c) 2009 Gen Ichino a.k.a. zenoplex
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
if(!$.isFunction($.fn.outerHtml)){$.fn.extend({outerHtml:function(a){if(a){return this.each(function(){$(this).replaceWith(a)})}var b=$("<div/>").append($(this).clone());var c=b.html();b.remove();return c}})}

/* 
 * jFeed : jQuery feed parser plugin
 * Copyright (C) 2007 Jean-François Hovinne - http://www.hovinne.com/
 * jFeed extended : added support for content:encoded and IE for loading local files.
 * Copyright (C) 2009 zenoplex - http://www.zenoplex.jp/
 * Dual licensed under the MIT (MIT-license.txt)
 * and GPL (GPL-license.txt) licenses.
 */
if(!$.isFunction($.getFeed)){$.getFeed=function(c){var e={url:null,data:null,success:null,complete:null,error:null};c=$.extend(e,c);if(c.url){$.ajax({type:'GET',url:c.url,data:c.data,dataType:($.browser.msie)?"text":"xml",success:function(a){var b;if(typeof a=="string"){b=new ActiveXObject("Microsoft.XMLDOM");b.async=false;b.loadXML(a)}else{b=a}var d=new JFeed(b);if($.isFunction(c.success))c.success(d)},error:function(a,b,d){if($.isFunction(c.error))c.error(a,b,d)}})}};function JFeed(a){if(a)this.parse(a)};JFeed.prototype={type:'',version:'',title:'',link:'',description:'',parse:function(a){if($('channel',a).length==1){this.type='rss';var b=new JRss(a)}else if($('feed',a).length==1){this.type='atom';var b=new JAtom(a)}if(b)$.extend(this,b)}};function JFeedItem(){};JFeedItem.prototype={title:'',link:'',description:'',content:'',updated:'',id:''};function JAtom(a){this._parse(a)};JAtom.prototype={_parse:function(d){var c=$($('feed',d).eq(0));this.version='1.0';this.title=c.find('title:first').text();this.link=c.find('link:first').attr('href');this.description=c.find('subtitle:first').text();this.language=c.attr('xml:lang');this.updated=c.find('updated:first').text();this.items=new Array();var e=this;$('entry',d).each(function(){var a=new JFeedItem();var b=$(this);a.title=b.find('title').eq(0).text();a.link=b.find('link').eq(0).attr('href');a.description=b.find('summary').eq(0).text();a.content=b.find('content').eq(0).text();a.updated=b.find('updated').eq(0).text();a.id=b.find('id').eq(0).text();e.items.push(a)})}};function JRss(a){this._parse(a)};JRss.prototype={_parse:function(d){if($('rss',d).length==0)this.version='1.0';else this.version=$('rss',d).eq(0).attr('version');var c=$($('channel',d).eq(0));this.title=c.find('title:first').text();this.link=c.find('link:first').text();this.description=c.find('description:first').text();this.language=c.find('language:first').text();this.updated=c.find('lastBuildDate:first').text();this.items=new Array();var e=this;$('item',d).each(function(){var a=new JFeedItem();var b=$(this);a.title=b.find('title').eq(0).text();a.link=b.find('link').eq(0).text();a.description=b.find('description').eq(0).text();a.content=b.find('[nodeName=content:encoded]').eq(0).text();a.updated=b.find('pubDate').eq(0).text();a.id=b.find('guid').eq(0).text();e.items.push(a)})}}};

/*
 * Extended by Gen Ichino
 * * added success, error events callback options
 * * added notFound options to replace 404 images
 * * optimized script
 * * * used jQuery.data instead of using attr to store temp data.
 * * * removing events after candidates of lazyload are gone.
 * 
 * Lazy Load - jQuery plugin for lazy loading images
 *
 * Copyright (c) 2007-2009 Mika Tuupola
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Project home:
 *   http://www.appelsiini.net/projects/lazyload
 *   http://www.zenoplex.jp/tools/lazyload/extended_lazyload_sample.html
 * 
 * Version:  based on 1.4.0
 *
 */
(function(a){a.fn.lazyload=function(b){var k={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window,success:null,error:null};var b=a.extend(k,b);var h=this;if("scroll"==b.event){function i(d){var e=0;h.each(function(){if(!a.belowthefold(this,b)&&!a.rightoffold(this,b)){a(this).trigger("APPEAR")}else{if(e++>b.failurelimit){return false}}});var f=a.grep(h,function(g){return!a(g).data('loaded')});h=a(f);if(h.length<1){a(b.container).unbind('scroll',i)}};a(b.container).bind("scroll",i)};return this.each(function(){var c=a(this);c.data('original',c.attr("src"));c.one("APPEAR",function(f,l){if(!c.data('loaded')){function j(g){c.data('loaded',true);var d;var e;if(g.type=='load'){d=b.success;e=c.data('original')}else{d=b.error;e=b.notFound}a(this).unbind('load').unbind('error');c.hide().removeData('original');if(!e){return}if(l){c.attr('src',e).show()}else{c.attr('src',e)[b.effect](b.effectspeed)}if(a.isFunction(d)){d(c.get(0))}}var m=a('<img />');m.bind('load',j).bind('error',j).attr('src',c.data('original'))}});if("scroll"!=b.event||a.belowthefold(c.get(0),b)||a.rightoffold(c.get(0),b)){if(b.placeholder){c.attr("src",b.placeholder)}else{c.removeAttr("src")}c.data('loaded',false)}else{if(b.placeholder){c.attr("src",b.placeholder)}else{c.removeAttr("src")}if(!a.belowthefold(c.get(0),b)){c.trigger('APPEAR',[true])}}if("scroll"!=b.event){c.bind(b.event,function(g){if(!c.data('loaded')){c.trigger("APPEAR")}})}})};a.belowthefold=function(g,d){var e=a(window);if(d.container===undefined||d.container===window){var f=e.height()+e.scrollTop()}else{var f=a(d.container).offset().top+a(d.container).height()}return f<=a(g).offset().top-d.threshold};a.rightoffold=function(g,d){var e=a(window);if(d.container===undefined||d.container===window){var f=e.width()+e.scrollLeft()}else{var f=a(d.container).offset().left+a(d.container).width()}return f<=a(g).offset().left-d.threshold};a.extend(a.expr[':'],{"below-the-fold":"$.belowthefold(a, {threshold : 0, container: window})","above-the-fold":"!$.belowthefold(a, {threshold : 0, container: window})","right-of-fold":"$.rightoffold(a, {threshold : 0, container: window})","left-of-fold":"!$.rightoffold(a, {threshold : 0, container: window})"})})(jQuery);

/**
 * jQuery.Preload
 * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com
 * Dual licensed under MIT and GPL.
 * Date: 3/25/2009
 *
 * @projectDescription Multifunctional preloader
 * @author Ariel Flesler
 * @version 1.0.8
 *
 * @id jQuery.preload
 * @param {String, jQuery, Array< String, <a>, <link>, <img> >} original Collection of sources to preload
 * @param {Object} settings Hash of settings.
 *
 * @id jQuery.fn.preload
 * @param {Object} settings Hash of settings.
 * @return {jQuery} Returns the same jQuery object, for chaining.
 *
 * @example Link Mode:
 *	$.preload( '#images a' );
 *
 * @example Rollover Mode:
 *	$.preload( '#images img', {
 *		find:/\.(gif|jpg)/,
 *		replace:'_over.$1'
 *	});
 *
 * @example Src Mode:
 *	$.preload( [ 'red', 'blue', 'yellow' ], {
 *		base:'images/colors/',
 *		ext:'.jpg'
 *	});
 *
 * @example Placeholder Mode:
 *	$.preload( '#images img', {
 *		placeholder:'placeholder.jpg',
 *		notFound:'notfound.jpg'
 *	});
 *
 * @example Placeholder+Rollover Mode(High res):
 *	$.preload( '#images img', {
 *		placeholder:true,
 *		find:/\.(gif|jpg)/,
 *		replace:'_high.$1'
 *	});
 */
(function(e){var f=e.preload=function(g,b){if(g.split)g=e(g);b=e.extend({},f.defaults,b);var k=e.map(g,function(d){if(!d)return;if(d.split)return b.base+d+b.ext;var c=d.src||d.href;if(typeof b.placeholder=='string'&&d.src)d.src=b.placeholder;if(c&&b.find)c=c.replace(b.find,b.replace);return c||null});var a={loaded:0,failed:0,next:0,done:0,total:k.length};if(!a.total)return l();var h=e(Array(b.threshold+1).join('<img/>')).load(i).error(i).bind('abort',i).each(j);function i(d){a.element=this;a.found=d.type=='load';a.image=this.src;a.index=this.index;var c=a.original=g[this.index];a[a.found?'loaded':'failed']++;a.done++;if(b.enforceCache)f.cache.push(e('<img/>').attr('src',a.image)[0]);if(b.placeholder&&c.src)c.src=a.found?a.image:b.notFound||c.src;if(b.onComplete)b.onComplete(a);if(a.found&&b.success)b.success(a);else if(b.error)b.error(a);if(a.done<a.total)j(0,this);else{if(h&&h.unbind)h.unbind('load').unbind('error').unbind('abort');h=null;l()}};function j(d,c,m){if(c.attachEvent&&a.next&&a.next%f.gap==0&&!m){setTimeout(function(){j(d,c,true)},0);return false}if(a.next==a.total)return false;c.index=a.next;c.src=k[a.next++];if(b.onRequest){a.index=c.index;a.element=c;a.image=c.src;a.original=g[a.next-1];b.onRequest(a)}};function l(){if(b.onFinish)b.onFinish(a)}};f.gap=14;f.cache=[];f.defaults={threshold:2,base:'',ext:'',replace:''};e.fn.preload=function(d){f(this,d);return this}})(jQuery);

/**
 * Copyright (c) 2009 Feedforce Inc.,
 * 
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */
if(!$.isFunction($.fn.listRecommend)){$.fn.listRecommend=function(d){var o={num:4,url:'/feed/rss/type=1,2,3',target:'_blank'};var d=$.extend(o,d);var t=$('<div class="loading"><img src="/images/ajax-loader.gif" />読み込み中</div>');return this.each(function(){var i=$(this);var j=t.clone();i.append(j);var m="";function b(p){var s=p.items;$(s).each(function(n,e){if(n>=d.num)return false;if(e.link==window.location)return;var f=$(e.content);var k=f.find('dt');var q=k.filter(':contains("物件名")').next().text();var g=k.filter(':contains("価格")').next().text();if(g){var c=/([\d|,]+)/.exec(g);g=(c)?c[1]:''}var l=f.find('img').eq(0);l.attr({width:145,height:109});var r=this.title.substring(this.title.indexOf(':')+1,this.title.length);var a='<div class="yelBox">';a+='<div class="yelCap">';a+='<h4><a href="'+this.link+'" target="'+d.target+'">'+q+'</a></h4>';a+='</div>';a+='<div><img src="/images/bg_yelcap_03.gif" /></div>';a+='<div class="photo"><a href="'+e.link+'" target="'+d.target+'">'+l.outerHtml()+'</a></div>';a+='<dl>';a+='<dt><span>'+g+'</span>万円</dt>';a+='<dd><a href="'+e.link+'" target="'+d.target+'">'+r+'</a></dd>';a+='</dl>';a+='<div><img src="/images/bg_rbox_02.gif"/></div>';a+='</div>';m+=a});var h=$('<div>'+m+'</div>');j.remove();i.append(h);h.find('div.photo img').bind('error',function(){$(this).hide()})};$.getFeed({url:d.url,success:b,error:function(n,e,f){}})})}};if(!$.isFunction($.fn.listMansion)){$.fn.listMansion=function(b){var d={num:2,url:'http://www.rsssuite.jp/list/f8787/index.rdf',target:'_blank'};var b=$.extend(d,b);var o=$('<div class="loading"><img src="/images/ajax-loader.gif" />読み込み中</div>');return this.each(function(){var h=$(this);var i=o.clone();h.append(i);var j="";function m(l){if(l.responseStatus!=200)return;var r=l.responseData.feed;var a=r.entries;$(a).each(function(n,e){if(n>=b.num)return false;if(e.link==window.location)return;var f=$(e.content);var k=f.find('img').eq(0);k.attr({width:145,height:109});var q=f.text();var g=f.text();var c='<div class="grayBox">';c+='<div class="grayCap">';c+='<h4><a href="'+this.link+'" target="'+b.target+'">'+q+'</a></h4>';c+='</div>';c+='<div><img src="/images/bg_graycap_03.gif" /></div>';c+='<div class="photo"><a href="'+e.link+'" target="'+b.target+'">'+k.outerHtml()+'</a></div>';c+='<p><a href="'+this.link+'" target="'+b.target+'">'+g+'</a></p>';c+='<div><img src="/images/bg_rbox_02.gif"/></div>';c+='</div>';j+=c});var p=$('<div>'+j+'</div>');i.remove();h.append(p);var s=h.height()};$.getJSON('http://ajax.googleapis.com/ajax/services/feed/load?q='+encodeURIComponent(b.url)+'&hl='+b.lang+'&num='+b.num+'&v=1.0&output='+b.output+'&callback=?',m)})}};
})(jQuery);
