//////////////////////////////
// function
////////////////////////////

//////////////
// スクロール
//////////////
$(function(){
	$("a").easingScroll();
	$("a").easingScroll({
		easing:"easeInQuad",
		duration:700
	});
});

// 自動スクロール
auto_time = 1;
sc_px=0;
sc_px_ret=3000;
scrollFlag = true;
scrollFlagRet = true;

function scroller(exec){
	if(exec){
		if(scrollFlag){
			sc_px+=100;
			scrollTo(sc_px,0);
			if(sc_px<3000){	setTimeout("scroller(1)",auto_time);}
			else{ scrollFlag=false;	}
		}
	}else{
		scrollTo(3000,0);
	}
}

function initScrollerRet(){
sc_px_ret=3000;
scrollFlagRet = true;
scrollerRet(1);
}
function scrollerRet(exec){
	if(exec){
		if(scrollFlagRet){
			sc_px_ret-=100;
			scrollTo(sc_px_ret,0);
			if(sc_px_ret>0){	setTimeout("scrollerRet(1)",auto_time);}
			else{ scrollFlagRet=false;	}
		}
	}else{
		scrollTo(3000,0);
	}
}

// loading
$(window).load(function(){
	 scroller(1);
});

// scrolling
$(window).scroll(function(){
//	boxAllClear();
//	alert("scrool");
	// ブラックアウト中⇒全削除
//	if(isBlackout() == 1){	boxAllClear();	}
});

// ブラウザの判定
function getBrowser(){
	var ua = "";
	var blowser = "";
	ua = navigator.userAgent.toLowerCase();
	
	if(ua.indexOf("safari") != -1){ blowser = "Safari";}
	else if(ua.indexOf("firefox") != -1){ blowser = "Firefox";}
	else if(ua.indexOf("opera") != -1){ blowser = "Opera";}
	else if(ua.indexOf("netscape") != -1){blowser = "Netscape";}
	else if(ua.indexOf("msie") != -1){ blowser = "Internet Explorer";}
	else if(ua.indexOf("mozilla/4") != -1){ blowser = "Netscape.4";}
	return blowser;
}

// BoxID Boxの幅  Boxの縦幅 
function setBoxView(objId,width,height){
	// windowの半分値
	var w_width =  document.documentElement.clientWidth;
	var w_height = document.documentElement.clientHeight;
	w_width = w_width/2;
	w_height = w_height/2;
	
//	alert(w_width+" "+w_height);
	document.getElementById(objId).style.position='fixed';
	document.getElementById(objId).style.left=w_width-(width/2)+'px';
//	document.getElementById(objId).style.top=w_height-(height/2)+'px';
	document.getElementById(objId).style.top='100px';
	document.getElementById(objId).style.width=width+'px';
	document.getElementById(objId).style.height=height+'px';
//	alert(document.getElementById(objId).style.left);
}

// 
function setButtonView(objId,width,height,rl,tb,style){
	var w_width =  document.documentElement.clientWidth;
	var w_height = document.documentElement.clientHeight;
	w_width = w_width/2;	w_height = w_height/2;
	document.getElementById(objId).style.position='fixed';
	document.getElementById(objId).style.left=w_width-(width/2)+(rl)+'px';
	document.getElementById(objId).style.top=w_height-(height/2)+(tb)+'px';
	document.getElementById(objId).style.width=width+'px';
	document.getElementById(objId).style.height=height+'px';
	if(style!=null && style!=""){
		var topArray = {request:'400',close:'105',map:'390'};
		var _t = topArray[style];
		if(_t!=null && _t!="")	document.getElementById(objId).style.top=_t+'px';
		else{	alert("値を見直して下さい:"+style);}
	}
}

/////////////////////// 問い合わせアニメーション(name書き換え)/////////////////////////////////////
///// sec1
// TF001
function req_sec1box001_Over(){	document.SEC_1_BOX_REQ_001.src="images/ask_btn_001_on.gif";}
function req_sec1box001_Out() {	document.SEC_1_BOX_REQ_001.src="images/ask_btn_001.gif";	}
// TF002
function req_sec1box002_Over(){	document.SEC_1_BOX_REQ_002.src="images/ask_btn_002_on.gif";}
function req_sec1box002_Out() {	document.SEC_1_BOX_REQ_002.src="images/ask_btn_002.gif";	}
// TF003
function req_sec1box003_Over(){	document.SEC_1_BOX_REQ_003.src="images/ask_btn_003_on.gif";}
function req_sec1box003_Out() {	document.SEC_1_BOX_REQ_003.src="images/ask_btn_003.gif";	}

///// sec2

// TF004
function req_sec2box004_Over(){	document.SEC_2_BOX_REQ_004.src="images/ask_btn_004_on.gif";}
function req_sec2box004_Out() {	document.SEC_2_BOX_REQ_004.src="images/ask_btn_004.gif";	}
// TF005
function req_sec2box005_Over(){	document.SEC_2_BOX_REQ_005.src="images/ask_btn_005_on.gif";}
function req_sec2box005_Out() {	document.SEC_2_BOX_REQ_005.src="images/ask_btn_005.gif";	}

// TF006
function req_sec2box006_Over(){	document.SEC_2_BOX_REQ_006.src="images/ask_btn_006_on.gif";}
function req_sec2box006_Out() {	document.SEC_2_BOX_REQ_006.src="images/ask_btn_006.gif";	}

///// sec3
// TF007
function req_sec3box007_Over(){	document.SEC_3_BOX_REQ_007.src="images/ask_btn_007_on.gif";}
function req_sec3box007_Out() {	document.SEC_3_BOX_REQ_007.src="images/ask_btn_007.gif";	}
// TF008
function req_sec3box008_Over(){	document.SEC_3_BOX_REQ_008.src="images/ask_btn_008_on.gif";}
function req_sec3box008_Out() {	document.SEC_3_BOX_REQ_008.src="images/ask_btn_008.gif";	}

////// sec4

// TF009
function req_sec4box009_Over(){	document.SEC_4_BOX_REQ_009.src="images/ask_btn_ex_on.gif";}
function req_sec4box009_Out() {	document.SEC_4_BOX_REQ_009.src="images/ask_btn_ex.gif";	}

// TF010
function req_sec4box010_Over(){	document.SEC_4_BOX_REQ_010.src="images/ask_btn_mes_on.gif";}
function req_sec4box010_Out() {	document.SEC_4_BOX_REQ_010.src="images/ask_btn_mes.gif";	}

// TF011_MAP
function map_sec4_MAP_A_Over(){	document.SEC_4_BOX_MAP_A.src="images/access_btn_on.gif";}
function map_sec4_MAP_A_Out() {	document.SEC_4_BOX_MAP_A.src="images/access_btn.gif";	}

// TF012
function req_sec4box012_Over(){	document.SEC_4_BOX_REQ_012.src="images/ask_btn_rec_on.gif";}
function req_sec4box012_Out() {	document.SEC_4_BOX_REQ_012.src="images/ask_btn_rec.gif";	}
// TF013
function req_sec2box013_Over(){	document.SEC_2_BOX_REQ_013.src="images/ask_btn_sho_on.gif";}
function req_sec2box013_Out() {	document.SEC_2_BOX_REQ_013.src="images/ask_btn_sho.gif";	}
// TF014
function req_sec4box014_Over(){	document.SEC_4_BOX_REQ_014.src="images/ask_btn_on.gif";}
function req_sec4box014_Out() {	document.SEC_4_BOX_REQ_014.src="images/ask_btn.gif";	}

///////////////////////////////////////////////////////////////////////////////
