// ■STR windowオープン
function MM_openBrWindow(theURL,winName,features) { //v2.0
  	window.open(theURL,winName,features);
}

// ■STR 二度押し防止
var set=0;

function nidoosi() {
	if(set==0) {
		set=1;
	}else{
		alert("処理中です。\nもう少々お待ちください。");
		return false;
	}
}


// ■テーブルハイライト【マウスが乗ったとき】
function highlightOver(obj){
	obj.style.backgroundColor = "#fff2ed";
//	obj.style.color = "#ff0066";
//	obj.style.fontWeight = "bold";
	
}

// ■テーブルハイライト【マウスが去ったとき】
function highlightOut(obj){
	obj.style.backgroundColor = "transparent";
//	obj.style.color = "black";
//	obj.style.fontWeight = "normal";
}

// ■ページトップへスクロールする
$(function(){
	try {
		$("a[href^=#]").click(function(){
			var Hash = $(this.hash);
			var HashOffset = $(Hash).offset().top;
			$("html,body").animate({ scrollTop: HashOffset }, 1000);
			return false;
		});
	} catch( e ) {}
});

// ■IE6.0以下を排除
$(function () {
	if ( $.browser.msie && $.browser.version <= 6 ) {
		$('body').prepend('<div class="error">あなたは旧式ブラウザをご利用中です。このウェブサイトを快適に閲覧するにはブラウザをアップグレードしてください。</div>');
    }
});

// ■Enterキー制御
$(document).ready( function () {
	$(":input").keydown(function (event) {
		
		var eventObject = event;
		
		if(window.event) {
			eventObject = window.event;
		}
		if(eventObject.keyCode == 13) {	
			inputlist = $(":input:enabled");
			currentindex = inputlist.index($(this));
			
			if(eventObject.shiftKey) {
				if(currentindex > 0) {
					currentindex -= 1;
				}
			} else {
				if(currentindex < inputlist.length -1) {
					currentindex += 1;
				}
			}
			$(":input:enabled:eq(" + currentindex + ")").focus();
			return false;
		}
	});
});


// ■ブラウザ取得
var gBrowserType = 0;

$(function() {

	// ブラウザ取得
	if(jQuery.browser.msie && parseInt(jQuery.browser.version) == 7)		{ gBrowserType = 7;
	}else if(jQuery.browser.msie && parseInt(jQuery.browser.version) == 6)	{ gBrowserType = 6;
	}else if(jQuery.browser.msie && parseInt(jQuery.browser.version) == 8)	{ gBrowserType = 8;
	}else																	{ gBrowserType = 0;
	}		   
		   
});

/* 画像リンク切れ対応
$(function () {
     $('img').error(function(){
          $(this).attr({ src:'/00_lib/img/common/noimage.gif',alt:'日本 旅行'} );
     });
});
*/


// ■画像遅延読み込みを
function lazyloadImage() {
	switch (gBrowserType) {
	case 0 : $('img').lazyload({ effect : "fadeIn",placeholder : "/00_lib/img/common/blank.gif"});
	default : }	
}

// ■画像遅延読み込み
$(function () {
	lazyloadImage();
});


