
////////////////////////////////////////////////////////////////////////////////// 
// rolloverスクリプト　2007.11.20
//
////////////////////////////////////////////////////////////////////////////////
overimageClassName = 'rollover';
overimagePostfix = '_on';
Event.observe(window, 'load', RN_setMouseOverImages, false);
function RN_setMouseOverImages() {
    var btns = $A(document.getElementsByClassName(overimageClassName));
    btns.each(function (node){
        node.imagesrc = node.src;
        node.imagesrc_over = node.src.replace('.gif', overimagePostfix+'.gif').replace('.jpg', overimagePostfix+'.jpg');
        node.onmouseover = function() { this.src = this.imagesrc_over; };
        node.onmouseout = function() { this.src = this.imagesrc; };
    });
}



////////////////////////////////////////////////////////////////////////////////// 
// 別ウィンドウを開くスクリプト　2007.11.20
//
////////////////////////////////////////////////////////////////////////////////
var popupOpenWin = {
	
	conf : {
		className : "external",//クラス名
		fileTypes : ["pdf","doc","xls","ppt"]//←これらのファイルも
	},

	main : function(){
		var fileTypesReg = "";
		for(i = 0; i <popupOpenWin.conf.fileTypes.length; i++){
			fileTypesReg += "."+popupOpenWin.conf.fileTypes[i]+"|";
		}
		fileTypesReg=fileTypesReg.slice(0, -1);
	
		var a = document.links;
		for (i = 0; i < a.length; i++) {
			if (new RegExp("\\b" + popupOpenWin.conf.className + "\\b").exec(a[i].className)||
		    	(new RegExp(fileTypesReg).exec(a[i].getAttribute("href")))){
				a[i].onclick = popupOpenWin.openWin;
				a[i].onkeypress = popupOpenWin.openWin;
			}
		}
	},
		
	openWin : function(){
		var uri = this.href;
		window.open(uri, "", "toolbar=yes, location=yes, directories=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes, close=yes");
		this.href = uri;
		return false;
	},
	
	addEvent : function(){
		try {
			window.addEventListener('load', popupOpenWin.main, false);
		} catch (e) {
			window.attachEvent('onload', popupOpenWin.main);
		}
	}
	
}

popupOpenWin.addEvent();