if (window.location.pathname.indexOf("index.html") < 0 &&
window.location.search.indexOf("o=i") < 0) {
window.location.assign("index.html");
}
$(document).ready(function() {
$('body').jpreLoader({splashID: "#jSplash",loaderVPos: '41%',autoClose: true},function(){});
$(window).resize(toResize);
toResize();
if ($("#pc").css("display") !== "none") {
$(".furn img").on("mouseenter", function(e) {
if ($(".show1,.show2,.show3,.show4").filter(".on:visible").length == 0 &&
$(".popup:visible").length == 0) {
$(".show1,.show2,.show3,.show4").filter(":visible").hide();
$($(this).attr("data-show")).show();
}
});
$(".show1,.show2,.show3,.show4").on("mouseleave", function(e) {
var $this = $(this);
if (!$this.hasClass("on")) {
$this.hide();
}
}).on("click", function(e) {
var $this = $(this);
if ($this.hasClass("on")) {
$this.removeClass("on");
} else {
$this.addClass("on");
}
});
$(".but1 > a").on("click", function(e) {
var $show = $(".show1,.show2,.show3,.show4").filter(".on:visible");
if ($show.length > 0) {
window.location.assign("result" + $show.attr("data-result") + ".html?o=i");
} else {
$(".show1,.show2,.show3,.show4").hide();
$(".popup").show();
}
});
} else {
$(".furn img").on("click", function(e) {
if ($(".popup:visible").length == 0) {
$(".show1,.show2,.show3,.show4").filter(":visible").hide();
$($(this).attr("data-show")).show();
}
});
$(".show1,.show2,.show3,.show4").on("click", function(e) {
$(this).hide();
});
$(".but1 > a").on("click", function(e) {
var $show = $(".show1,.show2,.show3,.show4").filter(":visible");
if ($show.length > 0) {
window.location.assign("result" + $show.attr("data-result") + ".html?o=i");
} else {
$(".show1,.show2,.show3,.show4").hide();
$(".popup").show();
}
});
}
/*$(".result1,.result2,.result3,.result4").hide();
var search = window.location.search;
var index = search.indexOf("result=");
if (index >= 0) {
$(".result" + search.substr(index + 7, 1)).show();
}*/
$(".close").on("click", function(e) {
$(".popup").hide();
});
});
function toResize() {
if ($(window).width() <= 940 || $(window).height() <= 650) {
$("h1").css("top", "32px");
$("h2").css("top", "126px");
$(".show1,.show2,.show3,.show4").css("top", "200px");
$(".furn").css("top", "227px");
$(".but1,.link").css("bottom", "auto");
$(".but1").css("top", "550px");
$(".link").css("top", "570px");
} else {
$("h1").css("top", "5%");
$("h2").css("top", "20%");
$(".show1,.show2,.show3,.show4").css("top", "33%");
$(".furn").css("top", "35%");
$(".but1,.link").css("top", "auto");
$(".but1").css("bottom", "10%");
$(".link").css("bottom", "2%");
}
}
function fbs_click() {
var u = location.origin + location.pathname;
var t = document.title;
window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,width=575,height=420');
return false;
}