function windowOpen(Obj){
	var url = Obj.href;
	var windowName = "popup";
	var width = "980";
	var height = "600";
	var option = "menubar=no, toolbar=no, location=no, status=no, scrollbars=no, resizable=no";
	popupWindow(url, width, height, option, windowName);
	

};
function popupWindow (url, width, height, option, windowName)
{	
	if (!width) width = window.innerWidth || document.documentElement.clientWidth;
	if (!height) height = window.innerHeight || document.documentElement.clientHeight;
	if (!option) option = 'menubar=yes, toolbar=yes, location=yes, status=yes, scrollbars=yes, resizable=yes';
	if (!windowName) windowName = "popup";
	var x = (screen.availWidth - width)/2;
	var y = (screen.availHeight - height)/3;
	var o = option+', width='+width+', height='+height+', left='+x+', top='+y;
	var blockMessage = "ウィンドウがお使いのブラウザでポップアップブロックされました。\nポップアップブロックを解除してください。";
	var win = window.open(url, windowName, o);
	if (win)
	{
		win.focus();
	} else {
		alert(blockMessage);
	}
};





function getScreenWIDTH(){

    if(document.layers||document.all)

      return screen.width

  }



function getScreenHEIGHT(){

    if(document.layers||document.all)

      return screen.height 

  }



var winHeight =getScreenHEIGHT()/2;

var winWidth =getScreenWIDTH()/2;



function resizeWin(){

 var uName = navigator.userAgent;

 if (uName.indexOf("Safari") > -1) widthPx-=2;heightPx-=1

}



// popupwindow



function popupWin(url){

    widthPx = 980;

    heightPx = 600;

    resizeWin();

    x = (screen.width  - widthPx) / 2;

    y = (screen.height - heightPx) / 2;

	

	if(window.opener != "undefined" && window.opener != null){

		window.opener.close();

	}

	

	var popupW = window.open(url,"popupA","left="+x+",top="+y+",width="+widthPx+",height="+heightPx+",directories=no,resizable=no,menubar=no,toolbar=no,scrollbars=no,status=no");

	popupW.focus();

}



function openCatalog(my_url){

	alert("a");

	myScreenX = screen.width;

	myScreenY = screen.height;

	myOption ="top=0,left=0,screenX=0,screenY=0,width="+myScreenX+",height="+myScreenY+",resizable=yes,scroolbars=yes";

	catalogWindow = window.open(my_url,"catalogWindow",myOption);

}




