$(document).ready(function(){
//rollover	
	$("a img[src*='_on']").addClass("current");
	
	$("a img").mouseover(function(){
		if ($(this).attr("src").match(/_off./)){
			$(this).attr("src",$(this).attr("src").replace("_off.", "_on."));
			return;
		}else if($(this).attr("src").match(/btn-/) || $(this).attr("src").match(/bnr-/) ){
			$(this).fadeTo("50",0.6);
			return;
		}
	});

	$("a img[class!='current']").mouseout(function(){
		if ($(this).attr("src").match(/_on./)){
			$(this).attr("src",$(this).attr("src").replace("_on.", "_off."));
			return;
		}else if($(this).attr("src").match(/btn-/) || $(this).attr("src").match(/bnr-/) ){
			$(this).fadeTo("50",1);
			return;		
		}
	});
		
// target _blank
	var domains = [document.domain,'www.haec.ac.jp',];
	var domain_selector = "",left_str= ":not([href^=http://",left_str_https= ":not([href^=https://",right_str = "])";

	domain_selector = left_str+domains.join(right_str+left_str)+right_str;
	domain_selector+= left_str_https+domains.join(right_str+left_str_https)+right_str;
	$("a[href^='http'][class!^='popup']"+domain_selector+",area[href^='http'][class!^='popup']"+domain_selector).click(function(){
		window.open(this.href,"_blank");
		return false;
	});
	
	$("a.external").click(function(){
		window.open(this.href,"_blank");
		return false;
	});
	
});


