// Roll Over //
function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}

//prototype.jsとのバッティング回避
jQuery.noConflict();

/* ===============================================
	#検索
=============================================== */
jQuery(document).ready(function() {
	jQuery(".accordion div.open").hover(function(){
		jQuery(this).css("cursor","pointer");
	},function(){
		jQuery(this).css("cursor","default");
		});
	jQuery(".accordion div.open-search").css("display","none");
	jQuery(".accordion div.open").click(function(){
		jQuery(this).next().slideToggle("fast");
		jQuery(this).toggleClass("title2");
		});
});

/* ===============================================
	#検索条件
=============================================== */
jQuery(document).ready(function() {
	jQuery(".accordion div.shut").hover(function(){
		jQuery(this).css("cursor","pointer");
	},function(){
		jQuery(this).css("cursor","default");
	});
//	$(".accordion div.shut-condition").css("display","none");
	jQuery(".accordion div.shut").click(function(){
		jQuery(".accordion div.shut-condition").slideToggle("fast");
//		$(".accordion div.shut-condition").toggleClass("title2");
	});
});
/* ===============================================
	#スタッフ
=============================================== */
jQuery(document).ready(function() {
	jQuery(".accordion div.staff-open").hover(function(){
		jQuery(this).css("cursor","pointer");
	},function(){
		jQuery(this).css("cursor","default");
		});
	jQuery(".accordion div.open-staff").css("display","none");
	jQuery(".accordion div.staff-open").click(function(){
		jQuery(this).next().slideToggle("fast");
		jQuery(this).toggleClass("title2");
		});
});
/* ===============================================
	#ポップアップ
=============================================== */
function open_win01(){
window.open("/mypage/favorite/type/divingsite/","","width=520,height=500,menubar=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=no");
}
function open_win02(){
window.open("/mypage/favorite/type/shop/","","width=520,height=500,menubar=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=no");
}
function open_win03(){
window.open("point_item.html","","width=520,height=500,menubar=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=no");
}
function open_win04(){
window.open("point_change.html","","width=520,height=500,menubar=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=no");
}
function open_win05(id){
window.open("/divingsite/popup/id/" + id + "/","","width=520,height=710,menubar=no,toolbar=no,location=no,status=no,scrollbars=yes,resizable=no");
}

/* ===============================================
	#コラム一覧
=============================================== */
jQuery(document).ready(function() {
	jQuery(".accordion div.more").hover(function(){
		jQuery(this).css("cursor","pointer");
	},function(){
		jQuery(this).css("cursor","default");
		});
	jQuery(".accordion div.more-list").css("display","none");
	jQuery(".accordion div.more").click(function(){
		jQuery(this).next().slideToggle("fast");
		jQuery(this).toggleClass("title2");
		});
});
