function area_change1(pref){
	if(pref == "13")
	{
		window.location.reload("/bukken/area/0.html");
	}
	else if(pref == "14")
	{
		window.location.reload("/bukken/area/1.html");
	}
	else if(pref == "11")
	{
		window.location.reload("/bukken/area/2.html");
	}
	else if(pref == "12")
	{
		window.location.reload("/bukken/area/3.html");
	}
	else if(pref == "88")
	{
		window.location.reload("/bukken/area/4.html");
	}
	else if(pref == "99")
	{
		window.location.reload("/bukken/area/5.html");
	}
//	document.form_area.action	= "/sch/sch_area_2.php?pref=" + pref;
//	document.form_area.submit();
}

function area_change1_kt(pref){
	if(pref == "13")
	{
		window.location.reload("/bukken/area_kt/0.html");
	}
	else if(pref == "14")
	{
		window.location.reload("/bukken/area_kt/1.html");
	}
	else if(pref == "11")
	{
		window.location.reload("/bukken/area_kt/2.html");
	}
	else if(pref == "12")
	{
		window.location.reload("/bukken/area_kt/3.html");
	}
	else if(pref == "88")
	{
		window.location.reload("/bukken/area_kt/4.html");
	}
	else if(pref == "99")
	{
		window.location.reload("/bukken/area_kt/5.html");
	}
//	document.form_area.action	= "/sch/sch_area_2.php?pref=" + pref;
//	document.form_area.submit();
}

function area_change2(area,pref){
	window.location.reload("/bkn/bkn_ich.php/area=" + area + "/pref=" + pref);
}

function area_change3(area,pref,city){
	window.location.reload("/bkn/bkn_ich.php/area=" + area + "/pref=" + pref + "/city=" + city);
}

function area_change2_kt(area,pref){
	window.location.reload("/bkn/bkn_ich.php/area=" + area + "/pref=" + pref + "/m_kt_flg=" + "kt");
}

function area_change3_kt(area,pref,city){
	window.location.reload("/bkn/bkn_ich.php/area=" + area + "/pref=" + pref + "/city=" + city + "/m_kt_flg=" + "kt");
}

function line_change1(line0){
	document.form_line.action	= "/sch/sch_line_1.php/line0=" + line0;
	document.form_line.submit();
}

function line_change2(line){
	document.form_line.action	= "/sch/sch_line_2.php/line=" + line;
	document.form_line.submit();
}

function line_change3(line,traf){
	window.location.reload("/bkn/bkn_ich.php/line=" + line + "/traf=" + traf);
}

function line_change4(line,traf,stat){
	window.location.reload("/bkn/bkn_ich.php/line=" + line + "/traf=" + traf + "/stat=" + stat);
}

function comp_change1(comp){
	if(comp == "1")
	{
		window.location.reload("/bukken/kaisya/0.html");
	}
	else if(comp == "2")
	{
		window.location.reload("/bukken/kaisya/1.html");
	}
	else if(comp == "3")
	{
		window.location.reload("/bukken/kaisya/2.html");
	}
	else if(comp == "4")
	{
		window.location.reload("/bukken/kaisya/3.html");
	}
	else if(comp == "5")
	{
		window.location.reload("/bukken/kaisya/4.html");
	}
	else if(comp == "6")
	{
		window.location.reload("/bukken/kaisya/5.html");
	}
	else if(comp == "7")
	{
		window.location.reload("/bukken/kaisya/6.html");
	}
	else if(comp == "8")
	{
		window.location.reload("/bukken/kaisya/7.html");
	}
	else if(comp == "9")
	{
		window.location.reload("/bukken/kaisya/8.html");
	}
	else if(comp == "10")
	{
		window.location.reload("/bukken/kaisya/9.html");
	}
//	document.form_comp.action	= "/sch/sch_comp_2.php?comp=" + comp;
//	document.form_comp.submit();
}

function comp_change1_kt(comp){
	if(comp == "1")
	{
		window.location.reload("/bukken/kaisya_kt/0.html");
	}
	else if(comp == "2")
	{
		window.location.reload("/bukken/kaisya_kt/1.html");
	}
	else if(comp == "3")
	{
		window.location.reload("/bukken/kaisya_kt/2.html");
	}
	else if(comp == "4")
	{
		window.location.reload("/bukken/kaisya_kt/3.html");
	}
	else if(comp == "5")
	{
		window.location.reload("/bukken/kaisya_kt/4.html");
	}
	else if(comp == "6")
	{
		window.location.reload("/bukken/kaisya_kt/5.html");
	}
	else if(comp == "7")
	{
		window.location.reload("/bukken/kaisya_kt/6.html");
	}
	else if(comp == "8")
	{
		window.location.reload("/bukken/kaisya_kt/7.html");
	}
	else if(comp == "9")
	{
		window.location.reload("/bukken/kaisya_kt/8.html");
	}
	else if(comp == "10")
	{
		window.location.reload("/bukken/kaisya_kt/9.html");
	}
//	document.form_comp.action	= "/sch/sch_comp_2.php?comp=" + comp;
//	document.form_comp.submit();
}

function comp_change2(comp,client,client_eda,pref){
	window.location.reload("/bkn/bkn_ich.php/comp=" + comp + "/client=" + client + "/client_eda=" + client_eda + "/pref=" + pref);
}

function comp_change3(comp,client,client_eda,pref,city){
	window.location.reload("/bkn/bkn_ich.php/comp=" + comp + "/client=" + client + "/client_eda=" + client_eda + "/pref=" + pref + "/city=" + city);
}

function comp_change2_kt(comp,client,client_eda,pref){
	window.location.reload("/bkn/bkn_ich.php/comp=" + comp + "/client=" + client + "/client_eda=" + client_eda + "/pref=" + pref + "/m_kt_flg=" + "kt");
}

function comp_change3_kt(comp,client,client_eda,pref,city){
	window.location.reload("/bkn/bkn_ich.php/comp=" + comp + "/client=" + client + "/client_eda=" + client_eda + "/pref=" + pref + "/city=" + city + "/m_kt_flg=" + "kt");
}

function map_change(map){
	if(map == "88")
	{
		document.form_map.action	= "/sch/sch_map_1.php?pref=" + map;
	}
	else if(map == "99")
	{
		document.form_map.action	= "/sch/sch_map_1.php";
	}
	else
	{
		document.form_map.action	= "/sch/sch_map_2.php?Code=" + map + "&nAreaCode_group=04";
	}
	document.form_map.submit();
}

function key_change(key){
	document.form_key.method		= "GET";
//	document.form_key.action		= "/bkn/bkn_ich.php";
	document.form_key.submit();
}

function key_change_kt(key){
	document.form_key_kt.method		= "GET";
//	document.form_key_kt.action		= "/bkn/bkn_ich.php";
	document.form_key_kt.submit();
}

function area_kt_change1(pref){
	document.form_area_kt.action	= "/bkn/bkn_ich.php/pref=" + pref + "/area_kt=1";
	document.form_area_kt.submit();
}

function mail_change(form){
	form.action	= "/myp/myp_mail_3.php";
	form.submit();
}

function area_hit(area,pref,city,price,layout,size,time){
	document.form_hit.action	= "/myp/myp_mail_1.php?mail_hit2=1&area=" + area + "&pref=" + pref + "&city=" + city + "&price=" + price + "&layout=" + layout + "&size=" + size + "&time=" + time;
	document.form_hit.target	= "_blank";
	document.form_hit.submit();
}

function line_hit(line0,line,traf,stat,price,layout,size,time){
	document.form_hit.action	= "/myp/myp_mail_1.php?mail_hit2=2&line0=" + line0 + "&line=" + line + "&traf=" + traf + "&stat=" + stat + "&price=" + price + "&layout=" + layout + "&size=" + size + "&time=" + time;
	document.form_hit.target	= "_blank";
	document.form_hit.submit();
}

function comp_hit(comp,client,client_eda,pref,city,price,layout,size,time){
	document.form_hit.action	= "/myp/myp_mail_1.php?mail_hit2=3&comp=" + comp + "&client=" + client + "&client_eda=" + client_eda + "&pref=" + pref + "&city=" + city + "&price=" + price + "&layout=" + layout + "&size=" + size + "&time=" + time;
	document.form_hit.target	= "_blank";
	document.form_hit.submit();
}

function type_hit(price,layout,size,time,pref){
	document.form_hit.action	= "/myp/myp_mail_1.php?mail_hit2=5&price=" + price + "&layout=" + layout + "&size=" + size + "&time=" + time + "&pref=" + pref + "&area=99";
	document.form_hit.target	= "_blank";
	document.form_hit.submit();
}






function type_search(get,price,layout,size){
	document.form_type.action		= "/bkn/bkn_ich.php/price=" + price + "/layout=" + layout + "/size=" + size + get;
	document.form_type.submit();
}

function type_search_top(price,layout,size,pref){
	document.form_type.action		= "/bkn/bkn_ich.php/price=" + price + "/layout=" + layout + "/size=" + size + "/pref=" + pref + "/area=99";
	document.form_type.submit();
}
/*
function type_search(get,price,layout,size,time){
	document.form_type.action		= "/bkn/bkn_ich.php/price=" + price + "/layout=" + layout + "/size=" + size + "/time=" + time + get;
	document.form_type.submit();
}

function type_search_top(price,layout,size,time,pref){
	document.form_type.action		= "/bkn/bkn_ich.php/price=" + price + "/layout=" + layout + "/size=" + size + "/time=" + time + "/pref=" + pref + "/area=99";
	document.form_type.submit();
}
*/

// 物件一覧・タイプ一覧
function change_image(name,flg,image_flg){
	if(flg == "over" || flg == "over_web")
	{
		if(document.form1[image_flg].value == "")
		{
			if(flg == "over")
			{
				document.images[name].src	= "/images/btn_list_over.gif";
			}
			else if(flg == "over_web")
			{
				document.images[name].src	= "/images/btn_list_webp_over.gif";
			}
		}
		else
		{
			if(flg == "over")
			{
				document.images[name].src	= "/images/btn_list_on.gif";
			}
			else if(flg == "over_web")
			{
				document.images[name].src	= "/images/btn_list_webp_on.gif";
			}
		}
	}
	else if(flg == "out" || flg == "out_web")
	{
		if(document.form1[image_flg].value == "")
		{
			if(flg == "out")
			{
				document.images[name].src	= "/images/btn_list.gif";
			}
			else if(flg == "out_web")
			{
				document.images[name].src	= "/images/btn_list_webp.gif";
			}
		}
		else
		{
			if(flg == "out")
			{
				document.images[name].src	= "/images/btn_list_on.gif";
			}
			else if(flg == "out_web")
			{
				document.images[name].src	= "/images/btn_list_webp_on.gif";
			}
		}
	}
	else if(flg == "click" || flg == "click_web")
	{
		if(flg == "click")
		{
			document.images[name].src	= "/images/btn_list_on.gif";
		}
		else if(flg == "click_web")
		{
			document.images[name].src	= "/images/btn_list_webp_on.gif";
		}
		document.form1[image_flg].value	= "1";
	}
}

// エリアメール・ネッチラ
function change_image2(name,flg,image_flg){
	if(flg == "over" || flg == "over_web")
	{
		if(document.form1[image_flg].value == "")
		{
			if(flg == "over")
			{
				document.images[name].src	= "/images/btn_myp_list_over.gif";
			}
			else if(flg == "over_web")
			{
				document.images[name].src	= "/images/btn_myp_webp_over.gif";
			}
		}
		else
		{
			if(flg == "over")
			{
				document.images[name].src	= "/images/btn_myp_list_on.gif";
			}
			else if(flg == "over_web")
			{
				document.images[name].src	= "/images/btn_myp_webp_on.gif";
			}
		}
	}
	else if(flg == "out" || flg == "out_web")
	{
		if(document.form1[image_flg].value == "")
		{
			if(flg == "out")
			{
				document.images[name].src	= "/images/btn_myp_list.gif";
			}
			else if(flg == "out_web")
			{
				document.images[name].src	= "/images/btn_myp_list_webp.gif";
			}
		}
		else
		{
			if(flg == "out")
			{
				document.images[name].src	= "/images/btn_myp_list_on.gif";
			}
			else if(flg == "out_web")
			{
				document.images[name].src	= "/images/btn_myp_list_webp_on.gif";
			}
		}
	}
	else if(flg == "click" || flg == "click_web")
	{
		if(flg == "click")
		{
			document.images[name].src	= "/images/btn_myp_list_on.gif";
		}
		else if(flg == "click_web")
		{
			document.images[name].src	= "/images/btn_myp_list_webp_on.gif";
		}
		document.form1[image_flg].value	= "1";
	}
}


function cust_mail_enter(mail) {
	document.form_cust_mail.action	= "https://www.l1-crm.com/mm/index.php";
	document.form_cust_mail.submit();
}



//==================================
//　外部クリック（エリアメール特枠用）
//==================================
function jump_url(jump_link,c_number_link,c_number_p_link,comp_cd_link,comp_cd_eda_link)
{
	document.form1.c_number_link.value=c_number_link;
	document.form1.comp_cd_link.value=comp_cd_link;
	document.form1.comp_cd_eda_link.value=comp_cd_eda_link;
	document.form1.c_number_p_link.value=c_number_p_link;
	document.form1.jump_link.value=jump_link;
	document.form1.method= "post";
	document.form1.target="_blank";
	document.form1.action="/inc/clickrate3.php";
	document.form1.submit();
}

//==================================
//　外部クリック（資料請求用）
//==================================
function jump_url_siryou(jump_link,c_number_link,c_number_p_link,comp_cd_link,comp_cd_eda_link)
{
	document.form1.c_number_link.value=c_number_link;
	document.form1.comp_cd_link.value=comp_cd_link;
	document.form1.comp_cd_eda_link.value=comp_cd_eda_link;
	document.form1.c_number_p_link.value=c_number_p_link;
	document.form1.jump_link.value=jump_link;
	document.form1.method= "post";
	document.form1.target="_blank";
	document.form1.action="/inc/clickrate4.php";
	document.form1.submit();
}



//==============================
// err_check_limit	入力項目チェック(チェック数制限つき)
// 引数:
// frmObj		(in)フォーム名
// CntCheck		(in)最大チェック数
// errormsg		(in)エラーメッセージ
// 戻り値:
// なし
//==============================
function err_check_limit(frmObj,CntCheck,errormsg){

	chk_flg = 0;
	for (i=0 ; i< frmObj.length ; i++)	{
		if(frmObj[i].checked) {
			chk_flg ++;
		}
	}
	if (chk_flg > CntCheck) {
		alert (errormsg);
		frmObj[0].focus();
		return false;
	}
	return true;
}



//++++++++++++++++++++++++++++++++++++++
// 名前：
// 概要：入力項目チェック(暦日の存在チェック)
// パラメータ
//++++++++++++++++++++++++++++++++++++++
function check_date(kaku_yyyy,kaku_mm,kaku_dd) {
	var v_yyyy;
	var v_mm;
	var v_dd;
	v_yyyy = parseInt(kaku_yyyy,10);
	v_mm   = parseInt(kaku_mm,10);
	v_dd   = parseInt(kaku_dd,10);

	if ((v_mm < 01) || (v_mm > 12)) { return false;	}		// 月数チェック
	if ((v_mm == 01) || (v_mm == 03) || (v_mm == 05) || (v_mm == 07) || (v_mm == 08) || (v_mm == 10) || (v_mm == 12)) {
	if ((v_dd < 01) || (v_dd > 31)) { return false;	}		// ３１日チェック
	} else {
	if ((v_dd < 01) || (v_dd > 30)) { return false; }		// ３０日チェック
	}

	if (v_mm == 02) {										// 閏年チェック
		if ((v_yyyy % 400 == 0) || ((v_yyyy % 4 == 0) && (v_yyyy % 100 != 0))) {
			if (v_dd > 29) { return false; }
		} else {
			if (v_dd > 28) { return false; }
		}
	}
	return true;
}


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_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_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.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);
}


//==============================
// send_to_login	ログイン、ログオフ
// 引数 :
// flg	: (IN) ログインのとき=1、ログオフのとき=空
// 戻り値:なし
//==============================
function send_to_login(flg){

	if(flg == "1")
	{
	// ログインのとき
		if(document.login.v_mail.value == "")
		{
			document.login.v_mail.focus();
			alert("メールアドレスを入力して下さい。");
			return false;
		}

		if(document.login.v_password.value == "")
		{
			document.login.v_password.focus();
			alert("パスワードを入力して下さい。");
			return false;
		}

		document.login.action = "https://www.l1-crm.com/myp/login.php";

	}
	else 
	{
		// ログオフのとき
		document.login.action = "https://www.l1-crm.com/myp/logout_do.php";

	}

	document.login.submit();
}

//==============================
// send_to_login_test	ログイン、ログオフ
// 引数 :
// flg	: (IN) ログインのとき=1、ログオフのとき=空
// 戻り値:なし
//==============================
function send_to_login_test(flg){

	if(flg == "1")
	{
	// ログインのとき
		if(document.login.v_mail.value == "")
		{
			document.login.v_mail.focus();
			alert("メールアドレスを入力して下さい。");
			return false;
		}

		if(document.login.v_password.value == "")
		{
			document.login.v_password.focus();
			alert("パスワードを入力して下さい。");
			return false;
		}

		document.login.action = "https://www.l1-crm.com/myp/login_test.php";

	}
	else 
	{
		// ログオフのとき
		document.login.action = "https://www.l1-crm.com/myp/logout_do_test.php";

	}

	document.login.submit();
}


// まとめて資料請求
function siryou_all(){

	chk_flg = 99;
	chk_cnt = 0;
	var i;
	for(i = 0; i < document.form1.elements.length; i ++)
	{
		var e			= document.form1.elements[i];
		var e_name		= e.name;
		var ele_name	= e_name.substring(0,7);

		if((ele_name == 'web_pam') && (e.type=='checkbox'))
		{
			if(e.checked == true)
			{
				chk_flg = i;
				chk_cnt ++;
			}
		}
	}

	if(chk_flg == 99)
	{
		alert ("資料請求をする物件にチェックが入っていません");
	}
	else
	{
		document.form1.action		= "https://www.l1-crm.com/myp/req.php";
		document.form1.method		= "get";
		document.form1.target		= "_blank";
		document.form1.submit();
	}
}

// 資料請求
function siryou(){
	document.form1.action		= "https://www.l1-crm.com/myp/req.php";
	document.form1.method		= "get";
	document.form1.target		= "_blank";
	document.form1.submit();
}

// ShowHide
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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}