﻿/**
 *
 *
 *
 *
 *
 */
//
// Gradient gradation
//
function backGroundGradation(){
	/* site gradation */
	var siteStartCollor = "#AA0000";
	var siteEndCollor   = "#F0F000";
	/* contents body gradation */
	//var startCollor     = "#000000";
	//var endCollor       = "#192533";
	// get browser name
	var browserName     = getBrowserName();
	
	if (browserName == "IE"){
		//document.getElementById("contentsBody").style.filter          = "progid:DXImageTransform.Microsoft.Gradient( GradientType=0,StartColorStr=" + startCollor + ",EndColorStr=" + endCollor + ")";
		document.getElementById("webContainerBackImage").style.filter = "progid:DXImageTransform.Microsoft.Gradient( GradientType=1,StartColorStr=" + siteStartCollor + ",EndColorStr=" + siteEndCollor + ")";
	}else{
		/* id=contentsBody */
		/* olive */
		//setGradient('contentsBody','#090a06','#1E2213',0);// オリーブ
		/* Blue */
		//setGradient('contentsBody', startCollor, endCollor, 0);
		//
		/* id=webContainerBackImage */
		setGradient('webContainerBackImage', siteStartCollor, siteEndCollor, 1);
	}
}
//*************************************************************************************************
//
//
//show dropline menu and dropdown Bloc
//
$(document).ready(function(){
	//
	//
	// main Navigation dropdown menu
	//
	$("#mainMenuNavi li div").css({"display" : "block"});
	var aHeight  = parseInt($("#mainMenuNavi li div a").css("height"));
	var liHeight = parseInt($("#mainMenuNavi li").css("height"));
	$("#mainMenuNavi li").hover(
		function(){
			var linkName = $(this).attr("id");
			if (linkName != "nav5"){
				if (linkName == "nav2"){
					var	animateHeight = parseInt($("div a",this).css("height"))+ parseInt($("div a",this).css("padding-top"));// + 30
				}else{
					var childAcount = $("div",this).children("a");
					var animateHeight = childAcount.length * aHeight;// + liHeight
				}
				$("div",this).css({"height": animateHeight});
				animateHeight = animateHeight + aHeight + 1;
				$(this).stop(true, false).animate({height: animateHeight}, "normal");//slow normal fast
			}
		},
		function(){
			var linkName = $(this).attr("id");
			if (linkName != "nav5"){
				$(this).stop(true, false).animate({height: "30px"}, "normal");	//hide slideUp(10);		//slow normal fast
			}
	});
	//
	//定休日設定
	$(".regularHoliday").html("■水曜定休日　※GW(4/29～5/7),７月～８月は無休");
	//
});
//
//***************************************************************************************
// スクリーン スクロールアップ
//
//***************************************************************************************
function propertyNoSearch(fmObj){
	// 入力チェック
	var inputStr = fmObj.lookBangou.value;
	if (inputStr == "create"){
		alert("暫定メッセージ\nここで営業担当を表示したページにジャンプします。");
		location.href = "../service/service.html";
	}else{
		document.forms[fmObj.name].submit();
	}
}
//
//***************************************************************************************
// スクリーン スクロールアップ
//
//***************************************************************************************
function scrollUp(){
	var x1 = x2 = x3 = 0;
	var y1 = y2 = y3 = 0;
	if (document.documentElement){
		x1 = document.documentElement.scrollLeft || 0;
		y1 = document.documentElement.scrollTop || 0;
		}
	if (document.body){
		x2 = document.body.scrollLeft || 0;
		y2 = document.body.scrollTop || 0;
		}
	x3 = window.scrollX || 0;
	y3 = window.scrollY || 0;
	var x = Math.max(x1, Math.max(x2, x3));
	var y = Math.max(y1, Math.max(y2, y3));
	window.scrollTo(Math.floor(x / 2), Math.floor(y / 2));
	if (x > 0 || y > 0){
		window.setTimeout("scrollUp()", 25);
		}
}
//
//***************************************************************************************
// ｉｅブラウザーバージョンチェック
//
//***************************************************************************************
function ieVersionCheck(){
	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" +
		  "株式会社 クリエイト軽井沢　サイトマスター");
	*/
	return ver;
}
//
// ブラウザー名の取得
//
function getBrowserName(){
	var ua = navigator.userAgent;
	ua = ua.toUpperCase();
	if (ua.indexOf("MSIE") > -1){
		return "IE";
	}
	return null;
}





