
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;
}
