
(function($,window,undefined){$(function(){var
document=window.document,_SSL_SCHEMA=$.Mynavi.getSslSchema(),isLogin=$.Mynavi.isLogin(),T=window.searchTemplate,C=window.searchController,isShowPulldown=false,currentShowPulldown=null,currentCategory=null,returnCategory=null,defaultCondition=$("#searchConditionUri").val(),currentCondition=defaultCondition,layerBlock=$("#layerBlock"),areaSearchContent=$("#areaSearchContent"),railSearchContent=$("#railSearchContent"),occupationSearchContent=$("#occupationSearchContent"),kodawariSearchContent=$("#kodawariSearchContent"),showReturnLayer=layerBlock.find(".showReturnLayer"),searchPr=$("#searchPr");Deferred.define();$(document).click(function(){if(isShowPulldown){hidePulldown();}});$(window).resize(function(event){if(isShowPulldown){hidePulldown();}});$(window).unload(function(event){});$.scope(function(){var elem=$("#f7counterNumber");elem.html($.counterImageMaker(elem.html(),T.counter01).join(""));});$.scope(function(){var freewordForm=$("#TopSearchConditionFacadeModel"),freewordText=$("#freeword"),href=$.rejectDomain(freewordForm.attr("action")),defaultValue=freewordText.attr("title");freewordForm.submit(function(event){event.preventDefault();var url;if(freewordText.val()===defaultValue||freewordText.val()===""){url=[href,"all"].join("");}else{var word=$.replaceDisallow(freewordText.val());freewordText.val(word);url=[href,"word_",encodeURIComponent(word),"/"].join("");}
location.href=url;});$("#freewordBtn").click(function(event){event.preventDefault();freewordForm.submit();});freewordText.placeholder({color:"#999999"}).loadBlur();});$("#searchBtnArea").find("img").mouseover(function(){$(this).attr("src",$(this).attr("src").replace("_out","_on"));}).mouseout(function(){$(this).attr("src",$(this).attr("src").replace("_on","_out"));}).end();$("#areaSearch").click(function(event){event.preventDefault();areaSearchContent.html("");showReturnLayer.css({visibility:"visible"});searchHierarchy(PanelCategory.AREA,"#areaLayer");});$("#railSearch").click(function(event){event.preventDefault();railSearchContent.html("");showReturnLayer.css({visibility:"visible"});searchHierarchy(PanelCategory.RAIL,"#railLayer");});$("#occupationSearch").click(function(event){event.preventDefault();occupationSearchContent.html("");showReturnLayer.css({visibility:"visible"});searchHierarchy(PanelCategory.OCCUPATION,"#occupationLayer");});$("#kodawariSearch").click(function(event){event.preventDefault();kodawariSearchContent.find("li").children().css({visibility:"hidden"});showReturnLayer.css({visibility:"hidden"});searchHierarchy(PanelCategory.KODAWARI,"#kodawariLayer");});layerBlock.find(".doSearch").click(function(event){event.preventDefault();var url=[currentCondition];if(defaultCondition===$.rejectDomain(currentCondition)){url.push("all");}
location.href=url.join("");}).end();layerBlock.find(".showKodawariLayer").click(function(event){event.preventDefault();kodawariSearchContent.find("li").children().css({visibility:"hidden"});returnCategory=currentCategory;currentCategory=PanelCategory.KODAWARI;$.mLightBox.changeLayer({mLightBoxId:"#kodawariLayer",duration:50,callback:function(){var urimap=$.makeUri(currentCondition);var offset=__elemOffset($("#"+currentCategory+"Layer"));C.searchHierarchy($.uriParamJoin(urimap.uri,urimap.param),currentCategory,function(json){currentCondition=json.current.condition;searchPrSetting(json.searchPrBanner,offset);});},resizebeforeback:function(){if(searchPr.css("display")!=="none"){var offset=__elemOffset($("#"+currentCategory+"Layer"));searchPr.css({top:offset.top,left:offset.left+4});}},closecallback:function(){searchPr.hide();}});}).end();showReturnLayer.click(function(event){event.preventDefault();if(PanelCategory.AREA===returnCategory){areaSearchContent.html("");}else if(PanelCategory.RAIL===returnCategory){railSearchContent.html("");}else if(PanelCategory.OCCUPATION===returnCategory){occupationSearchContent.html("");}
currentCategory=returnCategory;returnCategory=null;$.mLightBox.changeLayer({mLightBoxId:"#"+currentCategory+"Layer",duration:50,callback:function(){var urimap=$.makeUri(currentCondition);var offset=__elemOffset($("#"+currentCategory+"Layer"));C.searchHierarchy($.uriParamJoin(urimap.uri,urimap.param),currentCategory,function(json){currentCondition=json.current.condition;searchPrSetting(json.searchPrBanner,offset);});},resizebeforeback:function(){if(searchPr.css("display")!=="none"){var offset=__elemOffset($("#"+currentCategory+"Layer"));searchPr.css({top:offset.top,left:offset.left+4});}},closecallback:function(){searchPr.hide();}});});layerBlock.find(".closeLayer").click(function(event){event.preventDefault();$.mLightBox.close(function(){currentCondition=defaultCondition;searchPr.hide();});}).end();function searchHierarchy(category,id){currentCondition=defaultCondition;currentCategory=category;$.mLightBox({mLightBoxId:id,duration:50,callback:function(){var urimap=$.makeUri(defaultCondition);var offset=__elemOffset($("#"+currentCategory+"Layer"));C.searchHierarchy($.uriParamJoin(urimap.uri,urimap.param),currentCategory,function(json){currentCondition=json.current.condition;searchPrSetting(json.searchPrBanner,offset);});},resizebeforeback:function(){if(searchPr.css("display")!=="none"){var offset=__elemOffset($("#"+currentCategory+"Layer"));searchPr.css({top:offset.top,left:offset.left+4});}},closecallback:function(){searchPr.hide();}});}
areaSearchContent.click(function(event){event.preventDefault();event.stopPropagation();updateHierarchy(this,event,PanelCategory.AREA);});railSearchContent.click(function(event){event.preventDefault();event.stopPropagation();updateHierarchy(this,event,PanelCategory.RAIL);});occupationSearchContent.click(function(event){event.preventDefault();event.stopPropagation();updateHierarchy(this,event,PanelCategory.OCCUPATION);});kodawariSearchContent.click(function(event){event.preventDefault();event.stopPropagation();updateHierarchy(this,event,PanelCategory.KODAWARI);});$("#kodawariPulldownBlock").click(function(event){event.preventDefault();event.stopPropagation();updateHierarchy(this,event,PanelCategory.KODAWARI);});next(function(){var urimap=$.makeUri(currentCondition);$.ajax({type:"GET",url:"/top/TopTopixBanner.do",data:{query:urimap.uri},dataType:"json",cache:false,success:function(json){if(!json||!json.topixBanner){return;}
var html=[];$.each(json.topixBanner,function(index,obj){html.push("<li><a href='");html.push(obj.bannerLinkTo);html.push("'");html.push(obj.newWindowFlg==="1"?" target='_blank'":"");html.push(">");html.push(obj.bannerText);html.push("</a></li>");});$("#topixBannerList").html(html.join("")).parents(".recommendArea").show();},error:function(XHR,textStatus,errorThrown){}});});function updateHierarchy(elem,event,category){var _this=this,target=$(event.target);if(!ajaxSettings(target)){return;}
var element=$(target)[0].tagName.toLowerCase()==="a"?$(target):$(target).parents("a");if(element.size()<=0){return;}
var urimap=$.makeUri($(element).attr("url")||$(element).attr("href"));C.searchHierarchy($.uriParamJoin(urimap.uri,urimap.param),currentCategory,function(json){currentCondition=json.current.condition;});}
function ajaxSettings(target){if(isShowPulldown){hidePulldown();}
if($(target).findParentHasClass("close")){return false;}
var disabledid=$(target).findParentHasClass("disabled");if(disabledid){return false;}
var dropdownid=$(target).findParentHasClass("dropdown_");if(dropdownid){showPulldown(target,dropdownid);return false;}
return true;}
function hidePulldown(){if(!currentShowPulldown){return;}
$(currentShowPulldown).hide();currentShowPulldown=null;isShowPulldown=false;}
function showPulldown(target,dropdownid){currentShowPulldown=$("#"+dropdownid);var offset=$(target).offset(),top=$(target).outerHeight(),height=currentShowPulldown.height();$(currentShowPulldown).css({height:'0px',opacity:1,left:offset.left+'px',"top":(offset.top+top)+'px',display:'block',zIndex:2000}).animate({height:height+'px'},100,"easeInOutCirc",function(){});isShowPulldown=true;}
function searchPrSetting(searchPrBanner,offset){if(!searchPrBanner){searchPr.hide();return;}
var html=new Array();html.push(searchTemplate.pr070200.evaluate(searchPrBanner));html.push(searchPrBanner.imgStr);html.push(searchTemplate.pr070300);searchPr.find("#searchPrImage").html(html.join(""));searchPr.css({top:offset.top,left:offset.left+4}).show();$(window).trigger("resize");}
function __elemOffset(element){var top=Math.max(Math.floor($(window).scrollTop()+($(window).height()-$(element).height())/2),0),left=Math.max(Math.floor($(window).scrollLeft()+($(window).width()-$(element).width())/2),0)+$(element).width();return{top:(top<0?0:top),left:(left<0?0:left)};}});})(jQuery,window);new function(){function heightLine(){this.className="heightLine";this.parentClassName="heightLineParent"
reg=new RegExp(this.className+"-([a-zA-Z0-9-_]+)","i");objCN=new Array();var objAll=document.getElementsByTagName?document.getElementsByTagName("*"):document.all;for(var i=0;i<objAll.length;i++){var eltClass=objAll[i].className.split(/\s+/);for(var j=0;j<eltClass.length;j++){if(eltClass[j]==this.className){if(!objCN["main CN"])objCN["main CN"]=new Array();objCN["main CN"].push(objAll[i]);break;}else if(eltClass[j]==this.parentClassName){if(!objCN["parent CN"])objCN["parent CN"]=new Array();objCN["parent CN"].push(objAll[i]);break;}else if(eltClass[j].match(reg)){var OCN=eltClass[j].match(reg)
if(!objCN[OCN])objCN[OCN]=new Array();objCN[OCN].push(objAll[i]);break;}}}
var e=document.createElement("div");var s=document.createTextNode("S");e.appendChild(s);e.style.visibility="hidden"
e.style.position="absolute"
e.style.top="0"
document.body.appendChild(e);var defHeight=e.offsetHeight;changeBoxSize=function(){for(var key in objCN){if(objCN.hasOwnProperty(key)){if(key=="parent CN"){for(var i=0;i<objCN[key].length;i++){var max_height=0;var CCN=objCN[key][i].childNodes;for(var j=0;j<CCN.length;j++){if(CCN[j]&&CCN[j].nodeType==1){CCN[j].style.height="auto";max_height=max_height>CCN[j].offsetHeight?max_height:CCN[j].offsetHeight;}}
for(var j=0;j<CCN.length;j++){if(CCN[j].style){var stylea=CCN[j].currentStyle||document.defaultView.getComputedStyle(CCN[j],'');var newheight=max_height;if(stylea.paddingTop)newheight-=stylea.paddingTop.replace("px","");if(stylea.paddingBottom)newheight-=stylea.paddingBottom.replace("px","");if(stylea.borderTopWidth&&stylea.borderTopWidth!="medium")newheight-=stylea.borderTopWidth.replace("px","");if(stylea.borderBottomWidth&&stylea.borderBottomWidth!="medium")newheight-=stylea.borderBottomWidth.replace("px","");CCN[j].style.height=newheight+"px";}}}}else{var max_height=0;for(var i=0;i<objCN[key].length;i++){objCN[key][i].style.height="auto";max_height=max_height>objCN[key][i].offsetHeight?max_height:objCN[key][i].offsetHeight;}
for(var i=0;i<objCN[key].length;i++){if(objCN[key][i].style){var stylea=objCN[key][i].currentStyle||document.defaultView.getComputedStyle(objCN[key][i],'');var newheight=max_height;if(stylea.paddingTop)newheight-=stylea.paddingTop.replace("px","");if(stylea.paddingBottom)newheight-=stylea.paddingBottom.replace("px","");if(stylea.borderTopWidth&&stylea.borderTopWidth!="medium")newheight-=stylea.borderTopWidth.replace("px","")
if(stylea.borderBottomWidth&&stylea.borderBottomWidth!="medium")newheight-=stylea.borderBottomWidth.replace("px","");objCN[key][i].style.height=newheight+"px";}}}}}}
checkBoxSize=function(){if(defHeight!=e.offsetHeight){changeBoxSize();defHeight=e.offsetHeight;}}
changeBoxSize();setInterval(checkBoxSize,1000)
window.onresize=changeBoxSize;}
function addEvent(elm,listener,fn){try{elm.addEventListener(listener,fn,false);}catch(e){elm.attachEvent("on"+listener,fn);}}
addEvent(window,"load",heightLine);}
