$(function() {
category = Array();
category['address'] = Array();
category['address'][0] = "HOKUTO HOME";
category['address'][1] = "北登建設工業株式会社のご連絡先";
category['address'][2] = "ground";
category['address'][3] = 0;
category['address'][4] = "address";
category['address'][5] = "address";
category['address'][6] = "";
category['news'] = Array();
category['news'][0] = "ニュース";
category['news'][1] = "北登建設工業株式会社の新着情報です";
category['news'][2] = "ground";
category['news'][3] = 1;
category['news'][4] = "news";
category['news'][5] = "news";
category['news'][6] = "";
category['news_'] = Array();
category['news_'][0] = "ニュース一覧";
category['news_'][1] = "北登建設工業株式会社のニュース一覧です";
category['news_'][2] = "page";
category['news_'][3] = 2;
category['news_'][4] = "news/";
category['news_'][5] = "news_";
category['news_'][6] = "";
category['event'] = Array();
category['event'][0] = "モデルハウス・物件情報";
category['event'][1] = "北登建設工業株式会社のモデルハウス・物件情報です";
category['event'][2] = "ground";
category['event'][3] = 3;
category['event'][4] = "event";
category['event'][5] = "event";
category['event'][6] = "";
category['event_list'] = Array();
category['event_list'][0] = "モデルハウス・物件情報 - LIST";
category['event_list'][1] = "北登建設工業株式会社のモデルハウス・物件情報一覧です";
category['event_list'][2] = "modal";
category['event_list'][3] = 4;
category['event_list'][4] = "event/list";
category['event_list'][5] = "event_list";
category['event_list'][6] = "6332";
category['event_'] = Array();
category['event_'][0] = "モデルハウス・物件情報一覧";
category['event_'][1] = "北登建設工業株式会社のモデルハウス・物件情報一覧です";
category['event_'][2] = "page";
category['event_'][3] = 5;
category['event_'][4] = "event/";
category['event_'][5] = "event_";
category['event_'][6] = "";
category['land'] = Array();
category['land'][0] = "土地情報";
category['land'][1] = "北登建設工業株式会社の土地情報です";
category['land'][2] = "ground";
category['land'][3] = 6;
category['land'][4] = "land";
category['land'][5] = "land";
category['land'][6] = "";
category['land_'] = Array();
category['land_'][0] = "土地情報一覧";
category['land_'][1] = "北登建設工業株式会社の土地情報一覧です";
category['land_'][2] = "page";
category['land_'][3] = 7;
category['land_'][4] = "land/";
category['land_'][5] = "land_";
category['land_'][6] = "";
category['land_list'] = Array();
category['land_list'][0] = "土地情報 - LIST";
category['land_list'][1] = "北登建設工業株式会社の土地情報一覧です";
category['land_list'][2] = "modal";
category['land_list'][3] = 8;
category['land_list'][4] = "land/list";
category['land_list'][5] = "land_list";
category['land_list'][6] = "3142";
category['nor'] = Array();
category['nor'][0] = "ノアール1000";
category['nor'][1] = "北登建設工業株式会社のノアール1000";
category['nor'][2] = "ground";
category['nor'][3] = 9;
category['nor'][4] = "nor";
category['nor'][5] = "nor";
category['nor'][6] = "";
category['nor_details'] = Array();
category['nor_details'][0] = "ノアール1000 - DETAILS";
category['nor_details'][1] = "北登建設工業株式会社のノアール1000について";
category['nor_details'][2] = "modal";
category['nor_details'][3] = 10;
category['nor_details'][4] = "nor/details";
category['nor_details'][5] = "nor_details";
category['nor_details'][6] = "4678";
category['vision'] = Array();
category['vision'][0] = "ホクトホーム";
category['vision'][1] = "北登建設工業株式会社のビジョン";
category['vision'][2] = "ground";
category['vision'][3] = 11;
category['vision'][4] = "vision";
category['vision'][5] = "vision";
category['vision'][6] = "";
category['vision_details'] = Array();
category['vision_details'][0] = "ホクトホーム - DETAILS";
category['vision_details'][1] = "北登建設工業株式会社の家づくりについて";
category['vision_details'][2] = "modal";
category['vision_details'][3] = 12;
category['vision_details'][4] = "vision/details";
category['vision_details'][5] = "vision_details";
category['vision_details'][6] = "0895";
category['gallery'] = Array();
category['gallery'][0] = "施工例";
category['gallery'][1] = "北登建設工業株式会社の施工例";
category['gallery'][2] = "ground";
category['gallery'][3] = 13;
category['gallery'][4] = "gallery";
category['gallery'][5] = "gallery";
category['gallery'][6] = "";
category['gallery_list'] = Array();
category['gallery_list'][0] = "施工例 - LIST";
category['gallery_list'][1] = "北登建設工業株式会社の施工例一覧です";
category['gallery_list'][2] = "modal";
category['gallery_list'][3] = 14;
category['gallery_list'][4] = "gallery/list";
category['gallery_list'][5] = "gallery_list";
category['gallery_list'][6] = "5987";
category['sale'] = Array();
category['sale'][0] = "売却相談";
category['sale'][1] = "北登建設工業株式会社への売却相談はこちらから";
category['sale'][2] = "modal";
category['sale'][3] = 15;
category['sale'][4] = "sale";
category['sale'][5] = "sale";
category['sale'][6] = "0002";
category['about'] = Array();
category['about'][0] = "会社概要";
category['about'][1] = "北登建設工業株式会社の会社概要はこちら";
category['about'][2] = "ground";
category['about'][3] = 16;
category['about'][4] = "about";
category['about'][5] = "about";
category['about'][6] = "";
category['about_details'] = Array();
category['about_details'][0] = "会社概要 - DETAILS";
category['about_details'][1] = "北登建設工業株式会社 会社概要";
category['about_details'][2] = "modal";
category['about_details'][3] = 17;
category['about_details'][4] = "about/details";
category['about_details'][5] = "about_details";
category['about_details'][6] = "5300";
category['recruit'] = Array();
category['recruit'][0] = "採用情報";
category['recruit'][1] = "北登建設工業株式会社の採用情報です";
category['recruit'][2] = "modal";
category['recruit'][3] = 18;
category['recruit'][4] = "recruit";
category['recruit'][5] = "recruit";
category['recruit'][6] = "8247";
category['branch'] = Array();
category['branch'][0] = "店舗情報";
category['branch'][1] = "北登建設工業株式会社の店舗情報";
category['branch'][2] = "ground";
category['branch'][3] = 19;
category['branch'][4] = "branch";
category['branch'][5] = "branch";
category['branch'][6] = "";
category['request'] = Array();
category['request'][0] = "資料請求";
category['request'][1] = "北登建設工業株式会社への資料請求はこちらから";
category['request'][2] = "modal";
category['request'][3] = 20;
category['request'][4] = "request";
category['request'][5] = "request";
category['request'][6] = "6723";
category['reservation'] = Array();
category['reservation'][0] = "来場予約";
category['reservation'][1] = "北登建設工業株式会社のモデルハウスへの来場予約はこちらから";
category['reservation'][2] = "modal";
category['reservation'][3] = 21;
category['reservation'][4] = "reservation";
category['reservation'][5] = "reservation";
category['reservation'][6] = "0001";
category['reservation_thanks'] = Array();
category['reservation_thanks'][0] = "来場予約";
category['reservation_thanks'][1] = "北登建設工業株式会社のモデルハウスへの来場予約:お申込みありがとうございました";
category['reservation_thanks'][2] = "modal";
category['reservation_thanks'][3] = 22;
category['reservation_thanks'][4] = "reservation/thanks";
category['reservation_thanks'][5] = "reservation_thanks";
category['reservation_thanks'][6] = "0001";
category['privacy'] = Array();
category['privacy'][0] = "個人情報保護方針";
category['privacy'][1] = "北登建設工業株式会社の個人情報保護方針";
category['privacy'][2] = "modal";
category['privacy'][3] = 23;
category['privacy'][4] = "privacy";
category['privacy'][5] = "privacy";
category['privacy'][6] = "7513";
page_category = Array();
var page_category_count = -1; entry_array = Array();
entry_array['editor_0257'] = Array();
entry_array['editor_0257'][0] = "gallery";
entry_array['editor_0257'][1] = "editor_0257";
entry_array['editor_0257'][2] = "gallery-content";
entry_array['editor_0587'] = Array();
entry_array['editor_0587'][0] = "gallery";
entry_array['editor_0587'][1] = "editor_0587";
entry_array['editor_0587'][2] = "gallery-content";
entry_array['editor_4698'] = Array();
entry_array['editor_4698'][0] = "gallery";
entry_array['editor_4698'][1] = "editor_4698";
entry_array['editor_4698'][2] = "gallery-content";
entry_array['editor_3155'] = Array();
entry_array['editor_3155'][0] = "gallery";
entry_array['editor_3155'][1] = "editor_3155";
entry_array['editor_3155'][2] = "gallery-content";
entry_array['editor_9204'] = Array();
entry_array['editor_9204'][0] = "gallery";
entry_array['editor_9204'][1] = "editor_9204";
entry_array['editor_9204'][2] = "gallery-content";
entry_array['editor_9092'] = Array();
entry_array['editor_9092'][0] = "gallery";
entry_array['editor_9092'][1] = "editor_9092";
entry_array['editor_9092'][2] = "gallery-content";
entry_array['editor_2652'] = Array();
entry_array['editor_2652'][0] = "gallery";
entry_array['editor_2652'][1] = "editor_2652";
entry_array['editor_2652'][2] = "gallery-content";
entry_array['editor_8017'] = Array();
entry_array['editor_8017'][0] = "gallery";
entry_array['editor_8017'][1] = "editor_8017";
entry_array['editor_8017'][2] = "gallery-content";
entry_array['editor_8238'] = Array();
entry_array['editor_8238'][0] = "gallery";
entry_array['editor_8238'][1] = "editor_8238";
entry_array['editor_8238'][2] = "gallery-content";
entry_array['editor_1956'] = Array();
entry_array['editor_1956'][0] = "gallery";
entry_array['editor_1956'][1] = "editor_1956";
entry_array['editor_1956'][2] = "gallery-content";
entry_array['editor_9607'] = Array();
entry_array['editor_9607'][0] = "gallery";
entry_array['editor_9607'][1] = "editor_9607";
entry_array['editor_9607'][2] = "gallery-content";
entry_array['editor_8766'] = Array();
entry_array['editor_8766'][0] = "gallery";
entry_array['editor_8766'][1] = "editor_8766";
entry_array['editor_8766'][2] = "gallery-content";
function htmlEncode(value){
return $('
').text(value).html();
}
function htmlDecode(value){
return $('').html(value).text();
}
function img_load_fade(){
$("img.preload:not('.loaded')").imagesLoaded(function(){
$(this).addClass("loaded");
});
}
$("img.preload:not('.loaded')").each(function(){
$(this).imagesLoaded(function(){
$(this).addClass("loaded");
});
});
scroll_action_flag = false;
root_site_title = "未来までずっと、この家で。 北登建設工業株式会社";
history_counter = 0;
past_href = location.href;
memorize_scrolltop = $(window).scrollTop();
memorize_lastvisit = "modal";
memorize_lasturl = location.href;
profile_url = "address";
now_viewing = "about/details";
now_viewing_slsh_to_ub = "about/details".replace( "/", "_" );
memorize_lastindex = "";
$(window).bind('load', function() {
if( memorize_lastvisit == "entry" || memorize_lastvisit == "modal" ){
scroll_action_flag = false;
// $("#entry > article").css({"margin-top": $(window).scrollTop()+10 - parseInt($("#container").offset().top)});
$("div#entry").fadeIn(400);
$("body").addClass("modal");
memorize_lastvisit_article_type = "";
}else if( memorize_lastvisit == "index" || memorize_lastvisit == "profile" ){
scroll_action_flag = false;
var target_nav = $(".class_" + "about/details".replace( "/", "_" ) + " a");
target_nav.parent("li").removeClass("over");
target_nav.parent("li").addClass("active");
target_nav.closest("li.parent").removeClass("over");
target_nav.closest("li.parent").addClass("p_active");
//article_type(ground・modal)の読み取り
var article_type = "";
if( $( "article#" + now_viewing_slsh_to_ub )[0] ){
article_type = $( "article#" + now_viewing_slsh_to_ub ).attr("class");
}else{
article_type = category[now_viewing_slsh_to_ub][2];
}
if( article_type.indexOf( "ground" ) != -1 ){
var scrollto = $('#' + now_viewing_slsh_to_ub ).offset().top-0;
$('html,body').animate({
scrollTop: scrollto
}, 1000, "easeOutQuint",
function(){
scroll_action_flag = true;
});
}else if( article_type.indexOf( "ground page" ) != -1 ){
var scrollto = $('#' + now_viewing_slsh_to_ub ).offset().top-0;
$('html,body').animate({
scrollTop: scrollto
}, 1000, "easeOutQuint",
function(){
scroll_action_flag = true;
});
}
memorize_lastvisit_article_type = article_type;
}else{
scroll_action_flag = false;
setTimeout(
function(){
scroll_action_flag = true;
}
, 1000);
memorize_lastvisit_article_type = "";
}
});
function PJAX_hrefchange( href, onpop ) {
scroll_action_flag = false;
if( typeof ajax_request != "undefined" ){
ajax_request.abort();
}
if( typeof scroll_action_limiter != "undefined" ){
clearTimeout( scroll_action_limiter );
}
if( href && past_href != href ){
past_href = href;
var id = href.replace( "https://www.hokuto-home.co.jp/", "" );
var id = id.replace( "?mode=preview", "" );
now_viewing = id;
now_viewing_slsh_to_ub = id.replace( /\//g, "" );
ajax_request = $.ajax({
url: "https://www.hokuto-home.co.jp/pjax_readtitle_json.php",
data: "id=" + id + "&type=json" + "",
dataType: "json",
success:
function(data, dataType){
if(!onpop){
PJAX_pushState( href, data.title );
}
document.title = data.title;
},
error:
function(XMLHttpRequest, textStatus, errorThrown){
}
});
if (typeof category[now_viewing_slsh_to_ub] == "undefined") {
if( typeof category[id.replace( /\//g, "_" )] != "undefined" ){
var entry_id = id;
var category_filter = "";
var ajax_file = "https://www.hokuto-home.co.jp/ajax_modal.php";
}else{
var arr = id.split("/");
var entry_id = arr[arr.length - 1];
var category_filter = id.replace("/" + entry_id ,"");
var ajax_file = "https://www.hokuto-home.co.jp/ajax_entry.php";
}
if( entry_id != "" && category_filter != "" ){
$("body").append("");
if( memorize_lastvisit == "entry"){
$('html,body').animate({
scrollTop: memorize_scrolltop
}, '200',
function(){
scroll_action_flag = false;
});
}else{
scroll_action_flag = false;
memorize_scrolltop = $(window).scrollTop();
}
ajax_request = $.ajax({
url: ajax_file,
data: "id=" + category_filter + "/" + entry_id + "",
success:
function(data, dataType){
$("div#entry").fadeOut(
400,
function(){
$(this).empty().append(data).fadeIn(
400,function(){
// $("#entry > article").css({"margin-top": $(window).scrollTop()+10 - parseInt($("#container").offset().top)});
$("div#loading").fadeOut(500, function() { $(this).remove(); });
$("body").addClass("modal");
$("#entry > article").scroll(function(){
window_action_entry();
});
}
);
}
);
memorize_lastvisit = "entry";
memorize_lastvisit_article_type = "modal";
memorize_lasturl = href;
memorize_lastindex = category_filter;
},
error:
function(XMLHttpRequest, textStatus, errorThrown){
}
});
}else if( entry_id != "" ){
$("body").append("");
ajax_request = $.ajax({
url: ajax_file,
data: "id=" + entry_id + "",
success:
function(data, dataType){
$("div#entry").fadeOut(
400,
function(){
$(this).empty().append(data).fadeIn(
400,function(){
// $("#entry > article").css({"margin-top": $(window).scrollTop()+10 - parseInt($("#container").offset().top)});
$("div#loading").fadeOut(500, function() { $(this).remove(); });
$("body").addClass("modal");
$("#entry > article").scroll(function(){
window_action_entry();
});
}
);
}
);
memorize_lastvisit = "entry";
memorize_lastvisit_article_type = "";
memorize_lasturl = href;
memorize_scrolltop = $(window).scrollTop();
memorize_lastindex = "";
},
error:
function(XMLHttpRequest, textStatus, errorThrown){
}
});
}
}
if( typeof entry_id == "undefined" && ( id != "" || id == profile_url ) ){
//article_type(ground・page・modal)の読み取り
var article_type = category[now_viewing_slsh_to_ub][2];
if( memorize_lastvisit == "entry" || memorize_lastvisit == "modal" ){
// $('html,body').animate({
// scrollTop: memorize_scrolltop
// }, 200);
$("div#entry").fadeOut(
400,
function(){
$("body").removeClass("modal");
$(this).empty();
scroll_action_flag = true;
memorize_lastvisit = "index";
memorize_lasturl = href;
memorize_scrolltop = 0;
memorize_lastindex = id;
}
);
if( memorize_lastindex != id ){
if( article_type == "ground" ){
var scrollto = $('#' + now_viewing_slsh_to_ub).offset().top-0;
$('html,body').animate({
scrollTop: scrollto
}, 1000, "easeOutQuint",
function(){
scroll_action_flag = true;
});
scroll_action_flag = true;
}else if( article_type == "modal" ){
var entry_id = id;
var category_filter = "";
var ajax_file = "https://www.hokuto-home.co.jp/ajax_modal.php";
$("body").append("");
if( memorize_lastvisit == "entry"){
$('html,body').animate({
scrollTop: memorize_scrolltop
}, '200',
function(){
scroll_action_flag = false;
});
}else{
scroll_action_flag = false;
memorize_scrolltop = $(window).scrollTop();
}
ajax_request = $.ajax({
url: ajax_file,
data: "id=" + entry_id + "",
success:
function(data, dataType){
$("div#entry").fadeOut(
400,
function(){
$(this).empty().append(data).fadeIn(
400,function(){
// $("#entry > article").css({"margin-top": $(window).scrollTop()+10 - parseInt($("#container").offset().top)});
$("div#loading").fadeOut(500, function() { $(this).remove(); });
$("body").addClass("modal");
$("#entry > article").scroll(function(){
window_action_entry();
});
}
);
}
);
memorize_lastvisit = "entry";
memorize_lastvisit_article_type = "modal";
memorize_lasturl = href;
memorize_lastindex = category_filter;
},
error:
function(XMLHttpRequest, textStatus, errorThrown){
}
});
}
memorize_lastvisit = "index";
memorize_lastvisit_article_type = article_type;
memorize_lasturl = href;
memorize_scrolltop = $(window).scrollTop();
memorize_lastindex = id;
}
}else{
$( "article.modal" ).parent().fadeOut(400);
// if( (article_type == "ground page" && memorize_lastvisit_article_type != "modal") || ( article_type == "ground" && memorize_lastvisit_article_type == "ground page" ) ){
if( (article_type == "ground page" && memorize_lastvisit_article_type != "modal") ){
if( now_viewing_slsh_to_ub != $("#container > article#pagebase > .wrapper > article").attr("id") ){
$("body").append("");
var first_flag = 0;
var past_elm = $("#container > article#pagebase > .wrapper > article");
var past_id = past_elm.attr("id");
var scrollto = $("#container > article#pagebase > .wrapper > article").offset().top;
$('html,body').stop().animate({
scrollTop: scrollto
}, 800,
function(){
if( first_flag == 0 ){
first_flag += 1;
$.ajax({
url: "https://www.hokuto-home.co.jp/ajax_page.php",
data: "ajax=true" + "&id=" + id + "",
success:
function(data, dataType){
var window_width = $(window).width();
$("#container > article#pagebase > .wrapper").append(data);
var new_elm = past_elm.next("article");
if(category[past_id][3] > category[now_viewing_slsh_to_ub][3]){
//left
elm_x = parseInt(past_elm.css("left"));
new_elm.css({
"z-index": 2,
"left": elm_x - window_width
});
new_elm.stop().animate({
"left": 0
}, 1000, "easeOutQuint");
past_elm.addClass("past_elm");
past_elm.css({
"left": elm_x
});
past_elm.stop().animate({
"left": window_width
}, 1000, "easeOutQuint",
function(){
$(this).remove();
});
}else{
//right
elm_x = parseInt(past_elm.css("left"));
new_elm.css({
"z-index": 2,
"left": elm_x + window_width
});
new_elm.stop().animate({
"left": 0
}, 1000, "easeOutQuint");
past_elm.addClass("past_elm");
past_elm.css({
"left": -elm_x
});
past_elm.stop().animate({
"left": elm_x - window_width
}, 1000, "easeOutQuint",
function(){
$(this).remove();
});
}
$("div#loading").fadeOut(500, function() {
$(this).remove();
});
$(".floatbase a.pjax").attr("href", "https://www.hokuto-home.co.jp/" + id);
scroll_action_flag = true;
},
error:
function(XMLHttpRequest, textStatus, errorThrown){
}
});
}
});
}else{
var scrollto = $("#container > article#pagebase > .wrapper > article").offset().top;
$('html,body').stop().animate({
scrollTop: scrollto
}, 800,
function(){
scroll_action_flag = true;
});
}
}else if( article_type == "ground" && memorize_lastvisit_article_type != "modal" ){
var scrollto = $('#' + now_viewing_slsh_to_ub).offset().top+10;
$('html,body').stop().animate({
scrollTop: scrollto
}, 800,
function(){
scroll_action_flag = true;
});
}else if( article_type == "modal" ){
var entry_id = id;
var category_filter = "";
var ajax_file = "https://www.hokuto-home.co.jp/ajax_modal.php";
$("body").append("");
if( memorize_lastvisit == "entry"){
$('html,body').animate({
scrollTop: memorize_scrolltop
}, '200',
function(){
scroll_action_flag = false;
});
}else{
scroll_action_flag = false;
memorize_scrolltop = $(window).scrollTop();
}
ajax_request = $.ajax({
url: ajax_file,
data: "id=" + entry_id + "",
success:
function(data, dataType){
$("div#entry").fadeOut(
400,
function(){
$(this).empty().append(data).fadeIn(
400,function(){
// $("#entry > article").css({"margin-top": $(window).scrollTop()+10 - parseInt($("#container").offset().top)});
$("div#loading").fadeOut(500, function() { $(this).remove(); });
$("body").addClass("modal");
$("#entry > article").scroll(function(){
window_action_entry();
});
}
);
}
);
memorize_lastvisit = "entry";
memorize_lastvisit_article_type = "modal";
memorize_lasturl = href;
memorize_lastindex = category_filter;
},
error:
function(XMLHttpRequest, textStatus, errorThrown){
}
});
}
memorize_lastvisit = "index";
memorize_lastvisit_article_type = article_type;
memorize_lasturl = href;
memorize_scrolltop = $(window).scrollTop();
memorize_lastindex = id;
}
}
if( id == "" ){
$( "article.modal" ).parent().fadeOut(
400,function(){
$("body").removeClass("modal");
scroll_action_flag = true;
}
);
$("div#entry").fadeOut(
400,
function(){
$("body").removeClass("modal");
$(this).empty();
}
);
if( memorize_lastvisit_article_type != "modal" ){
var scrollto = 0;
$('html,body').animate({
scrollTop: scrollto
}, 1000, "easeOutQuint",
function(){
scroll_action_flag = true;
});
}
memorize_lastvisit = "root";
memorize_lastvisit_article_type = "";
memorize_lasturl = href;
memorize_scrolltop = 0;
memorize_lastindex = "";
$("#navi nav li").removeClass("active");
$("#navi nav li").removeClass("p_active");
}
if( typeof entry_id == "undefined" ){
$("#navi nav li").removeClass("active");
$("#navi nav li").removeClass("p_active");
var target_nav = $(".class_" + id.replace( "/", "_" ) + " a");
target_nav.parent("li").removeClass("over");
target_nav.parent("li").addClass("active");
target_nav.closest("li.parent").removeClass("over");
target_nav.closest("li.parent").addClass("p_active");
if( $(".class_" + id.replace( "/", "_" ))[0] ){
if( article_type == "ground page" ){
$("#container > article#pagebase nav li > div.btn").removeClass("active");
var target_tabnav = $(".class_" + id.replace( "/", "_" ));
target_tabnav.find("div.btn").addClass("active");
$.each(page_category, function(i) {
if( page_category[i]["url"] == id ){
now_page = i;
return false;
}
});
if( now_page != 0 ){
var prev_url = page_category[now_page-1]["url"];
}else{
var prev_url = page_category[page_category_count]["url"];
}
if( now_page != page_category_count ){
var next_url = page_category[now_page+1]["url"];
}else{
var next_url = page_category[0]["url"];
}
$("a.page_prev").attr("href", "https://www.hokuto-home.co.jp/" + prev_url)
$("a.page_next").attr("href", "https://www.hokuto-home.co.jp/" + next_url)
}
}
}
}else{
if ( href.replace( "https://www.hokuto-home.co.jp/", "" ) == "" ){
$('html,body').animate({
scrollTop: 0
}, 500);
scroll_action_flag = true;
}
}
}
function PJAX_pushState( href, title ) {
if ( window.history.pushState ) {
window.history.pushState( title, null, href );
} else {
}
}
window.onpopstate = function(event){
var onpop = true;
if( history_counter != 0 ){
if (event.state) {
} else {
}
var href = location.href;
if ( window.history.pushState ) {
PJAX_hrefchange( href, onpop );
history_counter++;
} else {
var href = "https://www.hokuto-home.co.jp/#!/" + href.replace( /^.\//, '' );
window.location = href;
history_counter++;
}
}
history_counter++;
}
$(document).on("click", "a.pjax", function(){
var href = $(this).attr("href");
if ( window.history.pushState ) {
PJAX_hrefchange( href );
history_counter++;
} else {
var href = href.replace( "https://www.hokuto-home.co.jp/", "" );
var href = "https://www.hokuto-home.co.jp/#!/" + href.replace( /^.\//, '' );
var past_href = location.href;
if ( href == "https://www.hokuto-home.co.jp/#!/" && past_href == "https://www.hokuto-home.co.jp/#!/" ) {
$('html,body').animate({
scrollTop: 0
}, 1000);
memorize_lastvisit_article_type = "";
}
window.location = href;
history_counter++;
}
return false;
});
$(window).hashchange( function(){
var hash = location.hash;
if( hash.indexOf( "#!/" ) != -1 ){
var href = hash.replace( /^#!\//, '' );
if( href == "" ){
var href = "https://www.hokuto-home.co.jp/";
}
PJAX_hrefchange( href );
}
})
$(window).bind('load', function() {
var hash = location.hash;
if( hash.indexOf( "#!/" ) != -1 ){
var href = hash.replace( /^#!\//, '' );
if ( window.history.pushState ) {
window.location = href;
}else{
PJAX_hrefchange( href );
}
}
});
$(window).scroll(function(){
if( scroll_action_flag === true ){
scroll_action_flag = false;
if( typeof scroll_action_limiter != "undefined" ){
clearTimeout( scroll_action_limiter );
}
scroll_action_limiter = setTimeout(
function(){
var menu_list = [];
var count_i = 0;
$(".ground").each(function(){
if( $(this).attr("id") != null ){
var push_val_id = $(this).attr("id");
var push_val_offset = $("#" + push_val_id).offset().top;
var push_val_height = $("#" + push_val_id).height();
menu_list[count_i] = [];
menu_list[count_i]["id"] = push_val_id;
menu_list[count_i]["offset"] = push_val_offset;
menu_list[count_i]["height"] = push_val_height;
count_i++;
}
});
var scroll_val = $(window).scrollTop();
$.each( menu_list, function(i){
if( scroll_val >= menu_list[i]["offset"] && scroll_val <= menu_list[i]["offset"] + menu_list[i]["height"] -200 ){
if( now_viewing != menu_list[i]["id"] ){
var id = menu_list[i]["id"];
var title = category[id][0];
var url = category[id][4];
var slsh_to_ub = category[id][5];
now_viewing = id;
past_href = "https://www.hokuto-home.co.jp/" + url;
var page_title = title + "|" + root_site_title;
PJAX_pushState( "https://www.hokuto-home.co.jp/" + url, page_title );
document.title = page_title;
$("#navi nav li").removeClass("active");
$("#navi nav li").removeClass("p_active");
var target_nav = $(".class_" + slsh_to_ub + " a");
target_nav.parent("li").removeClass("over");
target_nav.parent("li").addClass("active");
target_nav.closest("li.parent").removeClass("over");
target_nav.closest("li.parent").addClass("p_active");
id = url;
}
}else if( scroll_val < menu_list[0]["offset"] ){
if( now_viewing != "" ){
var id = "";
now_viewing = id;
past_href = "https://www.hokuto-home.co.jp/";
PJAX_pushState( "https://www.hokuto-home.co.jp/", root_site_title );
document.title = root_site_title;
$("#navi nav li").removeClass("active");
$("#navi nav li").removeClass("p_active");
}
}
});
scroll_action_flag = true;
}
, 2000);
}
});
var window_height = window.innerHeight ? window.innerHeight: $(window).height();
function window_action_entry() {
window_height = window.innerHeight ? window.innerHeight: $(window).height();
if( $("div#entry > article.nordetails > div.body > header")[0] ){
var scroll_entry_val = $("#entry > article").scrollTop();
if( scroll_entry_val < window_height ){
$("div#entry > article.nordetails > div.body > header").css({
"opacity": Math.floor((1-scroll_entry_val/(window_height))*1000)/1000
});
$("div#entry > article.nordetails > div.body > header").css({
"transform": "matrix(1, 0, 0, 1, 0, "+ (scroll_entry_val/2) +")"
});
}else{
$("div#entry > article.nordetails > div.body > header").css({
"opacity": 0
});
}
}
}
if( ! $("html.pc.ie")[0] ){
$("#entry > article").scroll(function(){
window_action_entry();
});
}
var iframe_contact_url = 'https://www.hokuto-home.co.jp/form/form_contact';
var iframe_request_url = 'https://www.hokuto-home.co.jp/form/form_request';
// if($("html.pc")[0]){
// iframe_contact_url = 'https://nisor.heteml.net/commits/hokuto_home/home/form/form_contact';
// iframe_request_url = 'https://nisor.heteml.net/commits/hokuto_home/home/form/form_request';
// }
$(document).on("click", "#navi > nav > ul > li.class_contact > a", function(){
$('iframe#form_contact').attr('src',iframe_contact_url);
$("#navi").removeClass("open");
return false;
})
$(document).on("click", "#navi > nav > ul > li.class_request > div", function(){
$('iframe#form_contact').attr('src',iframe_request_url);
$("#navi").removeClass("open");
PJAX_hrefchange( 'https://www.hokuto-home.co.jp/contact' );
})
$(document).on("click", "article#address > dl > dd > a.email", function(){
$('iframe#form_contact').attr('src',iframe_contact_url);
$("#navi").removeClass("open");
return false;
})
});