function Wopen(url,w,h,n) {
	var winName = n;
	var Width   = 'width='   + w;
	var Height  = ',height=' + h;
	var Left    = ',left='   + ((screen.width - w) / 2);
	var Top     = ',top='    + ((screen.height- h) / 2);
	var Option = ',status=1,menubar=0,scrollbars=1,resizable=0';
	var features = Width + Height + Left + Top + Option;
	winName = window.open(url,winName,features);
	if (window.focus) {
		winName.focus();
	}
}

function WopenScroll(url,w,h,n) {
	var winName = n;
	var Width   = 'width='   + w;
	var Height  = ',height=' + h;
	var Left    = ',left='   + ((screen.width - w) / 2);
	var Top     = ',top='    + ((screen.height- h) / 2);
	var Option = ',status=1,menubar=0,scrollbars=1,resizable=0';
	var features = Width + Height + Left + Top + Option;
	winName = window.open(url,winName,features);
	if (window.focus) {
		winName.focus();
	}
}

function openModalDialog( page, dialogHeight, dialogWidth, resizable ) {

	//ブラウザのキャッシュで再読み込みされないケースがあるため、URLにダミー変数を付与する
	if(page.indexOf("?") == -1){
		page += "?dummy=" + new Date().getTime();
	}else{
		page += "&dummy=" + new Date().getTime();
	}

	var returnValue = "";

	if( resizable == null || resizable == '' ) {
		resizable = 'no';
	}

	returnValue = showModalDialog(page, '', 'dialogHeight:' + dialogHeight + ';dialogWidth:' + dialogWidth + ';resizable:' + resizable);
	if( null == returnValue || '' == returnValue ) {
		returnValue = window.returnValue;
		window.returnValue = null;
	}

	return returnValue;
}

