// JavaScript Document

// ロールオーバー
function initRollOverImages() {
  var image_cache = new Object();
  $("img.rover").each(function(i) {
    var imgsrc = this.src;
    var dot = this.src.lastIndexOf('.');
    var imgsrc_ro = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
    image_cache[this.src] = new Image();
    image_cache[this.src].src = imgsrc_ro;
    $(this).hover(
      function() { this.src = imgsrc_ro; },
      function() { this.src = imgsrc; });
  });
}

$(document).ready(initRollOverImages);


//メニューアクティブ化
//画面ロード時にimgタグを_onの付いた画像に張り替える
function Menu_active(id){
	
	var target_img = "img#"+id;	
	$(target_img).each(function(i) {								
								
		var dot = this.src.lastIndexOf('.');
    	var imgsrc_ro = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
		this.src = imgsrc_ro;
		
		//既に割り当てられているロールオーバー関数を上書き
		$(this).hover(
		  function() { this.src = imgsrc_ro; },
		  function() { this.src = imgsrc_ro; });
		
	});
	
}

//ローカルナビアクティブ化
// liタグに「hear」クラスを付加
function localMenu_active(id){
	
	var target_img = "li#"+id;	
	$(target_img).each(function(i) {
		
		$(this).addClass("here");
	});
	
}

//デジタルパンフレット用
function panph(){
	var wo1;
	wo1=window.open("", "panph", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=1010,height=650");
	wo1.focus();
}

//オープンキャンパス用
function campus(){
	var wo1;
	wo1=window.open("open/index.html", "campus", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=750,height=560");
	wo1.focus();
}

//ポップアップ
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

