
/* イメージオブジェクト */
/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
*/

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_o'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = initRollovers;


/* ウィンドウ&ロケーション */
function win_open(){
	if(arguments[0]){
		var url = arguments[0];
		var tgt = (arguments[1] ? arguments[1] : '_self');
		var prp = '';
		if(arguments.length > 3){
			var scroll = (arguments[2] ? 1 : 0);
			var resize = (arguments[3] ? 1 : 0);
			var width = (arguments[4] > 100 ? arguments[4] : 100);
			var height = (arguments[5] > 100 ? arguments[5] : 100);
			prp = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=' + scroll + ',resizable=' + resize + ',width=' + width + ',height=' + height;
		}
		else if(arguments[2] != null){
			prp = arguments[2];
		}
		
		(arguments[2] ? arguments[2] : '');
		var newWin = new Object();
		if(prp) newWin = window.open(url,tgt,prp);
		else newWin = window.open(url,tgt);
		newWin.focus();
	}
}

function topicWindow(image){
	var topimage = image;
window.open(topimage, "topic", "width=480,height=680,directories=no,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no");
}

function liveWindow(){
	window.open("http://202.210.152.59/mukomachi/inbc/live.php","kld","width=994,height=689,directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no");
}
function posterOpen(image){
	var topimage = image;
win=window.open(topimage, "poster", "width=450,height=680,directories=no,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no");
win.moveTo(0,0);
}
function clsWin(){
    window.opener = window;
    var win = window.open(location.href,"_self");
    win.close();
}
