//ウインドウオープン
function Popup(sitepath, url, img_w, img_h) {
	if(url != ""){
		var Popup;
		var win_w = img_w + 50;
		var win_h = img_h + 70;
		var scroll = 0;
		var resize = 0;
		if(win_w > screen.width - 100){
			win_w = screen.width - 100;
			scroll = 1;
			resize = 1;
		}
		if(win_h > screen.height - 170){
			win_h = screen.height - 170;
			scroll = 1;
			resize = 1;
		}
		var x = (screen.width  - (win_w + 50)) / 2;
		var y = (screen.height  - (win_h + 100 )) / 2;
		if(x < 0) x = 0;
		if(y < 0) y = 0;
		Popup=window.open(sitepath+'local/common/controls/popup/popup.aspx?url='+url+'&w='+img_w+'&h='+img_h,'Popup','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=' + scroll + ',resizable=' + resize + ',left=' + x + ',top=' + y + ',width=' + win_w + ',height=' + win_h);
		Popup.focus();
		return;
	}
}

//右クリック禁止ウインドウオープン
function Popup2(sitepath, url, img_w, img_h) {
	if(url != ""){
		var Popup;
		var win_w = img_w + 50;
		var win_h = img_h + 70;
		var scroll = 0;
		var resize = 0;
		if(win_w > screen.width - 100){
			win_w = screen.width - 100;
			scroll = 1;
			resize = 1;
		}
		if(win_h > screen.height - 170){
			win_h = screen.height - 170;
			scroll = 1;
			resize = 1;
		}
		var x = (screen.width  - (win_w + 50)) / 2;
		var y = (screen.height  - (win_h + 100 )) / 2;
		if(x < 0) x = 0;
		if(y < 0) y = 0;
		Popup=window.open(sitepath+'local/common/controls/popup/popup.aspx?url='+url+'&w='+img_w+'&h='+img_h+'&r=1','Popup','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=' + scroll + ',resizable=' + resize + ',left=' + x + ',top=' + y + ',width=' + win_w + ',height=' + win_h);
		Popup.focus();
		return;
	}
}

