///////////////////////////////////////////////////
/*
■Image Roll ver1.0
マウスオーバーで画像を入れ替えることができます。
htmlソース側の記述例：
<a href="#" onmouseover="imgRoll(this.firstChild,1);" onmouseout="imgRoll(this.firstChild,0);"><img src="/images/hoge_def.gif" width="154" height="54" alt=""></a>
※ポイント
○ファイル名に必ず含めなくてはならない文字列があります。
デフォルトの画像：_def
ロールオーバーの画像：_ovr
○第二引数はステータスです
0：マウスオーバー
1：マウスアウト
//////////////////////////////////////////////////
*/
function imgRoll(obj,flag) {
	var pathsrc = obj.getAttribute("src");
	var path = pathsrc.slice(0,pathsrc.lastIndexOf("/")+1);
	var imgname = pathsrc.slice(pathsrc.lastIndexOf("/")+1,pathsrc.length);
	if(flag) {
		var imgname = imgname.replace(/_def/i,"_ovr");
	} else {
		var imgname = imgname.replace(/_ovr/i,"_def");
	}
	obj.setAttribute("src",path + imgname);
}


function AlternateWindow() {
	/* function object */
}



/**
 *  ATTRIBUTES
 */
AlternateWindow.prototype.attributeString = "";
AlternateWindow.prototype.attributes = new Object();
AlternateWindow.prototype.attributes.width = "width=500";
AlternateWindow.prototype.attributes.height = "height=490";
AlternateWindow.prototype.attributes.resizable = "resizable=yes";
AlternateWindow.prototype.attributes.scrollbars = "scrollbars=yes";
AlternateWindow.prototype.attributes.left = "20";
AlternateWindow.prototype.attributes.top = "10";



/**
 * METHODS
 */
AlternateWindow.prototype.setValue = function(attr,value) {
	if( !!attr && !!value ) {
		this.attributes[ attr ] = attr+"="+value;
	}
}
AlternateWindow.prototype.setAttributeString = function() {
	for( var item in this.attributes ) {
		this.attributeString = this.attributeString + this.attributes[ item ] + ",";
	}
}
AlternateWindow.prototype.setWindow = function(windowName) {
	if( !!!windowName ) windowName = "";
	this.setAttributeString();
	window.open( "", windowName, this.attributeString );
}

/**
 * ini.js
 */
var altWindow;
var onLoadReceiver = function() {
}
window.onload = function() {
	onLoadReceiver();
	altWindow = new AlternateWindow();
//	altWindow.setValue( "width","300" );
	this.focus();
}

