function chkBtn(frm)
{
  for (var i = 0; i < frm.elements.length; i ++) {
    if (frm.elements[i].type  == 'text'
     && frm.elements[i].value != '') {
      return true
    }
  }
  return false
}

function windowOpen(url, name, style)
{
  w = window.open(url, name, style);
  w.focus()
}

function exMenu(mObj)
{
	menuList = ["btn3","btn4","btn5"];
	btn = getMenu(mObj);
	flag = btn.style.display;
	for (i=0; i<menuList.length; i++)
	{
		if(menuList[i] == mObj){
			btn = getMenu(menuList[i]);
			btn.style.display = "none";
		}
	}
	btn = getMenu(mObj);
	if (flag == "block") btn.style.display = "none"; else btn.style.display = "block";
}

function getMenu(obj)
{
	if (document.all) return document.all(obj);
	if (document.getElementById) return document.getElementById(obj);
	return obj;
}

function getCookie(key,  tmp1, tmp2, xx1, xx2, xx3){
	tmp1 = " " + document.cookie + ";";
	xx1 = xx2 = 0;
	len = tmp1.length;
	while (xx1 < len) {
		xx2 = tmp1.indexOf(";", xx1);
		tmp2 = tmp1.substring(xx1 + 1, xx2);
		xx3 = tmp2.indexOf("=");
		if (tmp2.substring(0, xx3) == key) {
			return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1)));
		}
		xx1 = xx2 + 1;
	}
	return("");
}

function setCookie(key, val, tmp, exp){
//	exp = new Date();
//	exp.setTime(exp.getTime() + 10*60*1000);
//	exp.toGMTString();
	
	tmp = key + "=" + escape(val) + "; ";
//	tmp += "expires=" + exp + "; ";

	document.cookie = tmp;
}

function clearCookie(key){
	document.cookie = key + "=" + "xx; expires=Tue, 1-Jan-1980 00:00:00;";
}

//サブウィンドウを閉じた後、親ウィンドウを前面表示する。
function closefocus(){
	window.close();
	window.opener.focus();
}

//サブウィンドウを閉じた後、親ウィンドウをreloadする。
function closereload(){
  window.close();
  window.opener.location.reload();
}

function keywordSerch(){
	document.form1.action = "series.php";
	document.form1.SIMPLE_UNIT.value="";
	document.form1.submit();
}
function unitSerch(){
	document.form1.action = "series.php";
	document.form1.SIMPLE_KEYWORD.value="";
	document.form1.submit();
}

//ヘッダのデジタルカタログプルダウン（表示・非表示）用
menuList = ["pdMENU1"];
function pulldownmenu(mObj)
{
	pdMENU = getMenuObj(mObj);
	flag = pdMENU.style.visibility;
	for (i=0; i<menuList.length; i++)
	{
		pdMENU = getMenuObj(menuList[i]);
		pdMENU.style.visibility = "hidden";
	}
	pdMENU = getMenuObj(mObj);
	if (flag == "visible") pdMENU.style.visibility = "hidden"; else pdMENU.style.visibility = "visible";
}
function getMenuObj(obj)
{
	if (document.all) return document.all(obj);
	if (document.getElementById) return document.getElementById(obj);
	return obj;
}





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];}
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}