
jQuery.era={};jQuery.era.browser={ie6flg:null,isIE6:function(){if(this.ie6flg!=null){return this.ie6flg}
return this.ie6flg=navigator.userAgent.match(/.*MSIE\s*6\.[0-9].*/)?true:false;}}
jQuery.era.searchSavedCondition=function(){if($('#sso_parts_searchCondition').val()){window.location.href=$('#sso_parts_searchCondition').val();return false;}else if(!$('#sso_parts_cookie_searchConditionGet').val()){$.era.message.show('confirm','検索条件が保存されていません。');return false;}
this.xhr=$.era.cancelRequest(this.xhr);this.xhr=$.ajax({type:'GET',url:$('#sso_parts_cookie_searchConditionGet').val(),success:function(responce){if(responce&&responce.length>0){window.location.href=responce;}else{$.era.message.show('confirm','検索条件が保存されていません。');}},error:function(responce,error,con){if(responce.status!=0){$.era.message.show('confirm','エラーが発生しました。');}}});return false;};jQuery.era.submitForm=function(formSelector,url,type){$(formSelector).attr('method',type||'post').attr('action',url).submit();};jQuery.era.getCount=function(target,param){if(!target||!param){return;}
this.xhr=$.era.cancelRequest(this.xhr);this.xhr=$.ajax({type:'POST',url:$('#sso_parts_searchCount_index').val(),data:param,success:function(responce){$(target).each(function(){$(this).html($(this).find('span.txt')).prepend(responce);});},error:function(){}});};jQuery.era.countClear=function(target){$(target).each(function(){$(this).html($(this).find('span.txt')).prepend('<input type="hidden" value="false" name="isSearch"/>'+'<span class="num"><img height="26" width="21" alt="0" src="'+$('#sso_era_url').val()+'images/p2_Panel_number00.gif"/></span>');});};jQuery.era.message={conf:{target:'#p2miniPop',isIE6:null},show:function(type,message){var pop=$(this.conf.target);if(pop.data('visible')){this.hide();}
if(type=='load'){pop.find('span.close a, p.btn a').hide().end().find('p.txt').html(message||'<img src="'+$('#sso_era_url').val()+'images/loading.gif" />検索中');}else if(type=='reading'){pop.find('span.close a, p.btn a').hide().end().find('p.txt').html(message||'<img src="'+$('#sso_era_url').val()+'images/loading.gif" />読み込み中');}else if(type=='notice'){pop.find('span.close a, p.btn a').hide().end().find('p.txt').html(message||'');}else if(type=='confirm'){pop.find('span.close a, p.btn a').click($.scope(this,function(){this.hide();return false;})).show().end().find('p.txt').html(message||'');}
if(this.conf.isIE6==null){this.conf.isIE6=$.era.browser.isIE6();}
if(this.conf.isIE6){$('select').css('visibility','hidden');}
pop.setCenterPos().data('visible',true).show();},hide:function(){if(!$.era.overlay.is()&&this.conf.isIE6){$('select').not('.dummy').css('visibility','visible');}
$(this.conf.target).data('visible',false).hide()},write:function(html){$(this.conf.target).find('p.txt').html(html);},is:function(){return($(this.conf.target).data('visible'));},error:{maxnum:function(){return arguments[0]+'が'+arguments[1]+'箇所以上選択されています。';},required:function(){return arguments[0]+'は必須です。';},noResultList:function(){return'申し訳ございません。<br />ご指定の検索条件に該当する物件はありません。';}}};jQuery.era.overlay={conf:{target:'#overlay',isIE6:null,timer:null},show:function(){var overlay=$(this.conf.target);if(this.conf.isIE6==null){this.conf.isIE6=$.era.browser.isIE6();}
if(!overlay.data('visible')){if(this.conf.isIE6){var doc=$(document.body);$('select').css('visibility','hidden');overlay.css({backgroundColor:'#000',position:'absolute',width:doc.width(),height:doc.height(),top:'0px',left:'0px',opacity:'0.5',filter:'alpha(opacity=50)'}).data('visible',true).show();this.conf.timer=setInterval(function(){overlay.css({width:doc.width(),height:doc.height()});},100);}else{overlay.css({backgroundColor:'#000',position:'fixed',width:'100%',height:'100%',top:'0px',left:'0px',opacity:'0.5',filter:'alpha(opacity=50)'}).data('visible',true).show();}}},hide:function(){if(this.conf.isIE6){$('select').not('.dummy').css('visibility','visible');if(this.conf.timer){clearInterval(this.conf.timer);}}
$(this.conf.target).data('visible',false).hide();},is:function(){return($(this.conf.target).data('visible'));}};jQuery.era.lazyLoad={load:function(selector,options){var conf={noImg:$('#sso_era_url').val()+'images/p2_no_image01.gif',timeout:30};$.extend(conf,options);conf.images=$(selector);conf.loadCnt=0;conf.images.each(function(){$.data(this,'lazyload',{top:$.cumulativeOffset(this).top,isSet:false});});draw();$(window).scroll(draw);function draw(){var win=$(window);var top=win.scrollTop();var range={top:top,bottom:top+win.height()};conf.images.each(function(idx,image){var pos=null;if($(image).data('lazyload')){pos=$(image).data('lazyload').top;}
if(range.top<pos&&pos<=range.bottom){var imgContainer=$(image);if(imgContainer.data('lazyload').isSet){return;}
var img=new Image();var path=(imgContainer.attr('name'))?imgContainer.attr('name'):conf.noImg;img.onload=$.scope(self,function(){imgContainer.attr({'src':path});if(imgContainer.data('timer')){clearTimeout(imgContainer.data('timer'));}});img.onerror=$.scope(self,function(){imgContainer.attr({'src':conf.noImg});if(imgContainer.data('timer')){clearTimeout(imgContainer.data('timer'));}});img.src=path;var timer=setTimeout(function(){if(img.src!=imgContainer.attr('src')){imgContainer.attr({'src':conf.noImg});}},conf.timeout*1000);imgContainer.data('timer',timer);conf.loadCnt++;imgContainer.data('lazyload',{isSet:true});}});if(conf.loadCnt>=conf.images.length){$(window).unbind('scroll');}};},destroy:function(){$(window).unbind('scroll');}};jQuery.cumulativeOffset=function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;}while(element);return{'top':valueT,'left':valueL};};jQuery.scope=function(target,func){return function(){return func.apply(target,arguments);}};jQuery.era.commmonHeader=function(){var conf={xhr:null};$('#headerUserBlock').find('#searchBtn').click(function(){$.era.searchSavedCondition();return false;}).end().find('.autoSwapImg').live('mouseover',function(){$(this).attr('src',$(this).attr('src').replace('.gif','ov.gif'));}).live('mouseout',function(){$(this).attr('src',$(this).attr('src').replace('ov.gif','.gif'));}).live('click',function(){switchImage($(this).attr('id'));var fontSize=$(this).attr('id');var size=$(this).attr('id').substring(5);var path=$('#sso_parts_cookie_fontSizeSet').val();conf.xhr=$.era.cancelRequest(conf.xhr);conf.xhr=$.ajax({url:path,data:{'value':size},success:function(responce){},error:function(){}});$('link[rel*=style][title]').each(function(){this.disabled=true;if(this.getAttribute('title')==fontSize){this.disabled=false;}});return false;function switchImage(elmId){$('#font-large, #font-medium, #font-small').each(function(){if($(this).attr('id')==elmId){$(this).removeClass('autoSwapImg');}else{if(!$(this).hasClass('autoSwapImg')){$(this).attr('src',$(this).attr('src').replace('ov.gif','.gif')).addClass('autoSwapImg');}}});};});$('#gnavArea .autoSwapImg').hover(function(){if($(this).attr('src')!=undefined){$(this).attr('src',$(this).attr('src').replace('.gif','ov.gif'));}},function(){if($(this).attr('src')!=undefined){$(this).attr('src',$(this).attr('src').replace('ov.gif','.gif'));}});$('#toPageTop').click(function(e){e.preventDefault();$('html,　body').animate({scrollTop:0},'fast');return false;});};jQuery.era.check={mailAddress:function(input){return(input.match(/^(.+)@(.+)$/));},phoneNum:function(input1,input2,input3){return(input1.match(/^[0-9]{1,5}$/)&&input2.match(/^[0-9]{1,4}$/)&&input3.match(/^[0-9]{1,4}$/));},zipcode:function(input){return(input.match(/^[0-9]{3}-[0-9]{4}$/)||input.match(/^[0-9]{7}$/));},date:{mmdd:function(input1,input2){return(input1.match(/^[0-9]{1,2}$/)&&input2.match(/^[0-9]{1,2}$/));}}};jQuery.era.cancelRequest=function(xhr){try{if(xhr&&xhr.abort){xhr.abort();}}catch(error){}
finally{return xhr=null;}};jQuery.era.checkboxVal=function(selector){var elm=$(selector);var rtn=[];elm.each(function(){var val=$(this).val();if(val)rtn.push(val);});return rtn||[];};jQuery.fn.extend({setCenterPos:function(){var target=$(this);var win=$(window);return target.css({left:(win.width()-target.width())/2+win.scrollLeft(),top:(win.height()-target.height())/2+win.scrollTop()})}});jQuery.era.search=function(formSelector,url,type){this.xhr=$.era.cancelRequest(this.xhr);this.xhr=$.ajax({type:'POST',url:url,data:$(formSelector).serialize(),success:function(responce){if(responce&&responce.length>0){window.location.href=responce;}else{$.era.message.show('confirm','検索に失敗しました。');}},error:function(){$.era.message.show('confirm','エラーが発生しました。');}});};$(function(){$.era.commmonHeader();});