// 別ウィンドウ表示
function SWindow(Aurl,Aname,Awidth,Aheight,Atoolbar,Alocation,Astatus,Ascroll,Amenu,Aresize){
	Astr = "width=" + Awidth;
	Astr+= ",height=" + Aheight;
	if(Atoolbar)Astr+= ",toolbar";
	if(Alocation)Astr+= ",location";
	if(Astatus)Astr+= ",status";
	if(Ascroll)Astr+= ",scrollbars";
	if(Amenu)Astr+= ",menubar";
	if(Aresize)Astr+= ",resizable";
	window.open(Aurl,Aname,Astr);
}

// オンマウス画像切換え
(function(onLoad) {
	try {
		window.addEventListener('load', onLoad, false);
	} catch (e) {
		window.attachEvent('onload', onLoad);
	}
})(function() {
	var tags = ["img","input"];
	for( var i=0, len=tags.length; i<len; i++ ) {
		var over = function() { this.src = this.src.replace('_d.', '_h.'); };
		var out  = function() { this.src = this.src.replace('_h.', '_d.'); };
		var el = document.getElementsByTagName(tags[i]);
		for (var j=0, len2=el.length; j<len2; j++) {
			var attr = el[j].getAttribute('src');
			if (!el[j].src.match(/_d\./)&&attr) continue;
			el[j].onmouseover = over;
			el[j].onmouseout  = out;
		}
	}
});

// ファイルアップロード系
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function postfileDelete(Id,No,Mode){
	if(confirm("本当に削除してもよろしいですか？")){
		if(Mode == 1){
			document.getElementById("postfile_list_id_"+ No).value = "";
			document.getElementById("postfile_edit_"+ No).innerHTML = "+ ファイルの指定";
			document.getElementById("postfile_delete_"+ No).innerHTML = "";
			document.getElementById("postfile_field_"+ No).innerHTML = "";
			parent.delete_iframe.location.href="postfile_delete.php?postfile_list_id="+ Id;
		} else if (Mode == 2) {
			parent.delete_iframe.location.href="file_delete.php?mode=reload&postfile_list_id="+ Id;
			setTimeout("location.reload()",3000);
		}
	}
}

