﻿/**
 *
 *
 *
 *
 *
 */
$(function(){
	//
	//
	// header layer
	//
	$("#headerLayer1").fadeTo("fast", 0.55);//0.75
	//
	//
	// Background gradation line
	//
	var locat = location.href;
	arrayLocat = locat.split("/");
	//
	if(arrayLocat[arrayLocat.length-1]=="index-olive.html"){
		var target=$('#contentsBody');
		target.gradient({
			//オリーブ
			from:      '1E2213',
			to:        '3C4525',
			direction: 'horizontal'
		})
	}else{
		var target=$('#contentsBody');
		target.gradient({
			//ブルー
			from:      '000000',
			to:        '425468',
			direction: 'horizontal'
		})
	}
	//
	//
	// light box show
	//
	$('#gallery a').lightBox({fixedNavigation:true});
	//
	//
	// main navigation
	//
	$("#mainMenuNavi li").hover(
		function(){
			$("div",this).stop(true, true).show();	//show slideDown(10);	//slow normal fast
		},
		function(){
			$("div",this).stop(true, true).hide();		//hide slideUp(10);		//slow normal fast
	});
	//
	$("#imgBanner").hover(
		function(){
			this.src = "images/index/verdure1b.jpg";
		},
		function(){
			this.src = "images/index/verdure1a.jpg";
	});
	//
	//
	// mini slide show move left or right
	//
	$("#right").click(function(){
		var divPosiX = $(".block").position().left;
		var divRigthLimit = 0;
		//
		if (divPosiX >= divRigthLimit){
			return;
		}else {
			$(".block").animate({"left": "+=74px"}, "normal");
		}
	});
	//
	$("#left").click(function(){
		var divPosiX = $(".block").position().left;
		var liCount = ($(".block li").length) - 6;	//隠れている画像数
		var divLeftLimit = (-74) * liCount;
		//
		if (divPosiX <= divLeftLimit){
			return;
		}else {
			$(".block").animate({"left": "-=74px"}, "normal");
		}
	});
	//
	//
	// construction slide show
	//
	$(".tdStyl1 img").click( function() {
		var changeSrc = $(this).attr("src");
		$("#targetImg").fadeOut("fast", function() {
				$(this).attr("src", changeSrc);
				$(this).fadeIn(1000);
		});
		return;
    });
    //
    //
    // P/D Button click show (photo1～photo5)
    //
    $("#galSelectBox li").click( function() {
		var clickBtnId = $(this).attr("id");
		var adrActiveImg = $("#targetImg").attr("src");
		var getUrl = adrActiveImg.substring(0,adrActiveImg.lastIndexOf("/") + 1);
		var setImgUrl = getUrl + clickBtnId + ".jpg";
		//
		$("#targetImg").fadeOut("fast", function() {
				$("#targetImg").css("display","none");
				$(this).attr("src", setImgUrl);
				$(this).fadeIn(1000);
		});
		return;
    });
	//
	//
	// オープンハウスのオンマウス処理
	//
	$("#ohpic").hover(
		function(){
			$("#rightOpenHouse").css("background-image","url('images/index/openhouse/openhouse_bg_b.gif')")
		},
		function(){
			$("#rightOpenHouse").css("background-image","url('images/index/openhouse/openhouse_bg.gif')")
	});
	//
});
//***************************************************************************************
//
//
//***************************************************************************************
//
//
// window resizeing
//
function resizeEvent(){
		var target_wcbi=$('#webContainerBackImage');
		target_wcbi.gradient({
			from:      '800000',
			to:        'FEEA00',
			direction: 'vertical'
		});
}
//
//
//サブウィンドウ
//
// サブウィンドウの大きさと開く位置の指定
l = 60; // 表示するx座標
t = 30; // 表示するy座標
w = 930; // 横幅
h = 625; // 縦幅
// 中央に開く
function openWindow() {
  x = (screen.width - w) / 2;
  y = (screen.height - h) / 3;
  subWin = window.open("kzw-birdview.html","OpenWindow",
    "screenX="+x+",screenY="+y+",left="+x+",top="+y+",width="+w+",height="+h);
}
//
//
//
/*
window.onload = function (){
	var ua = navigator.userAgent;
	var bName = getBrowserName();
	var ver = null;
	var s, e, n;
	ua = ua.toUpperCase();
	if (bName == "IE"){
		s = ua.indexOf("MSIE") + 5;
		ver = ua.charAt(s);
		n = ua.substring(s, s+3);
		if (n == "5.5") ver = "5.5";
	}
	alert("【 お知らせ 】" + "\n" +
		  "お客様がお使いの インターネットエクスプローラー Ver " + 
		  ver + 
		  " は当サイトを正確に表示する事が出来ない可能性がございます。" +  "\n\n" +
		  "マイクロソフトアップデートより ver6.0 以上にアップデートされてご覧いただきますようお願いいたします。" +  "\n\n" +
		  "本日は当サイトにお越しいただき、誠にありがとうございます。" + "\n\n" +
		  "株式会社 クリエイト軽井沢　サイトマスター");
}
*/
//
//
//
/*
function getBrowserName(){
	var ua = navigator.userAgent;
	ua = ua.toUpperCase();
	if (ua.indexOf("MSIE") > -1){
		return "IE";
	}
	return null;
}
*/

