//-----------------------------------------------------------------------
//	ロールオーバーで画像を変更
//-----------------------------------------------------------------------
	
function initRollOverImages() {
	//プリロード用オブジェクトを定義
	var image_cache = new Object();
 	$("#globalnav > li > a > img").each(function(i) {
		//src属性を取得
		var imgsrc = this.src;
		
		//拡張子前の「.」間での文字数を取得
		var dot = this.src.lastIndexOf('.');
		
		//「.」前までの文字列に「_ov」を付加して、最後に拡張子を足して変数に格納
		//(ロールオーバー後の画像のsrc属性を生成)
		
		var img_ov_or_not = imgsrc.match("\-ov");
		
		if(img_ov_or_not == null){
			var imgsrc_on = this.src.substr(0, dot) + '-ov' + this.src.substr(dot, 4);
		}else{
			var imgsrc_on = this.src;
		}
		
		image_cache[this.src] = new Image();
		image_cache[this.src].src = imgsrc_on;
		
		//ロールオーバー処理
		$(this).hover(
			function() { this.src = imgsrc_on; },
			function() { this.src = imgsrc; });
		});
}

$(document).ready(initRollOverImages);

//-----------------------------------------------------------------------
//	ポップアップウィンドウ用スクリプト
//-----------------------------------------------------------------------
var popUpWin=0;
function popUpWindow(URLStr, $title, width, height){
	if($title){
		$title = encodeURIComponent($title);
		URLStr = URLStr + "?" + $title;
	}
	if(popUpWin){
	  	if(!popUpWin.closed) popUpWin.close();
	}
	popUpWin = window.open(URLStr, 'popUpWin', "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width="+width+",height="+height);
}
