/*
 * モジュール名：common.js
 * 機能　　　　：商品購入画面のJavaScript定義。
 * 作成日　　　：2006/08/25
 * 作成者　　　：竹村　慎吾
 *
 * 更新日　　　：2007/01/11
 * 更新者　　　：竹村　慎吾
 */
<!--
/*
if(document.all || document.getElementById)
{
	document.onmousedown = rightClick;
}
else if(document.layers)
{
	window.captureEvents(Event.MOUSEDOWN);
	window.onmousedown = rightClick;
}

function rightClick(e)
{
	if(document.all || document.getElementById)
	{
		if(event.button & 2) return(false);
	}
	else if(document.layers)
	{
		if(e.which == 3) return(false);
	}
}
*/

function sendAction()
{
	var memb = sendAction.arguments;

/* Mod Start 2007/01/16 asato */
/*
	document.form1.hdnAction.value = memb[1];
	if (memb[2]) document.form1.hdnPage.value = memb[2];
	if (memb[3]) document.form1.hdnFirstPageFlg.value = memb[3];
	if (memb[4]) document.form1.hdnLastPageFlg.value = memb[4];
	nextPage(memb[0]);
*/
	if (document.form1.hdnAction && memb[1]) document.form1.hdnAction.value = memb[1];
	if (document.form1.hdnPage && memb[2]) document.form1.hdnPage.value = memb[2];
	if (document.form1.hdnFirstPageFlg && memb[3]) document.form1.hdnFirstPageFlg.value = memb[3];
	if (document.form1.hdnLastPageFlg && memb[4]) document.form1.hdnLastPageFlg.value = memb[4];

	if (document.form1.hdnAction) nextPage(memb[0]);
/* Mod End   2007/01/16 asato */
}

function nextPage(page)
{
	with(document.form1)
	{
		action = page;
		submit();
	}
}

function newWindowOpen()
{
	var memb = newWindowOpen.arguments;

	var pUrl = '';
	var pName = '';
	var pStatus = '';
	var pWidth = '';
	var pHeight = '';
	var pLeft = '';
	var pTop = '';

	if (memb[0]) pUrl = memb[0];
	if (memb[1]) pName = memb[1];
	if (memb[2]) pStatus = memb[2];
	if (memb[3]) pWidth = memb[3];
	if (memb[4]) pHeight = memb[4];

	if (pWidth != '' && pHeight != '')
	{
		pLeft = (screen.width  - pWidth) / 2;
		pTop = (screen.height - pHeight) / 2;
	}

/* Mod Start 2007/01/11 takemura */
//	window.open(pUrl, pName, pStatus + ',left=' + pLeft + ',top=' + pTop);
	var newWindow = window.open(pUrl, pName, pStatus + ',left=' + pLeft + ',top=' + pTop);
	newWindow.focus();
/* Mod End   2007/01/11 takemura */
}

function MM_preloadImages()
{
	//v3.0
	var d=document;
	if(d.images)
	{
		if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
		for(i=0; i<a.length; i++)
		{
			if (a[i].indexOf("#")!=0)
			{
				d.MM_p[j]=new Image;
				d.MM_p[j++].src=a[i];
			}
		}
	}
}

function MM_swapImgRestore()
{
	//v3.0
	var i,x,a=document.MM_sr;
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
	{
		x.src=x.oSrc;
	}
}

function MM_findObj(n, d)
{
	//v4.01
	var p,i,x;
	if(!d) d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length)
	{
    	d=parent.frames[n.substring(p+1)].document;
    	n=n.substring(0,p);
    }
    if(!(x=d[n])&&d.all) x=d.all[n];
    for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage()
{
	//v3.0
	var i,j=0,x,a=MM_swapImage.arguments;
	document.MM_sr=new Array;
	for(i=0;i<(a.length-2);i+=3)
	{
		if ((x=MM_findObj(a[i]))!=null)
		{
			document.MM_sr[j++]=x;
			if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];
		}
	}
}
//-->