//QZC 070104.
//仮想ディレクトリ化.
//	'パス置き換え.
//	'「"/」 → 「RealUrl + "/」.
//	'「'/」 → 「RealUrl + '/」.
//	' 「"https://" + location.hostname + "/」 → 「"https://" + location.hostname + RealDirectory + "/」
var RealUrl = "/editorial";
var RealDirectory = "/editorial";

var PopUpWindow_Account = null;

function Js_Account_OnLoad_CreateModify()
{
    var strVal_PageMode = document.forms[0].hddn_PageMode.value;
    var strVal_Address_PrefectureHandle = document.forms[0].hddn_Address_PrefectureHandle.value;
    
    switch ( strVal_PageMode )
    {
        case "create":
            if ( strVal_PageMode != "" )
            {
                Js_Account_Select_DropDown( document.forms[0].slct_Address_Prefecture, strVal_Address_PrefectureHandle );
            }
            break;
        case "modify":
            if ( strVal_PageMode != "" )
            {
                Js_Account_Select_DropDown( document.forms[0].slct_Address_Prefecture, strVal_Address_PrefectureHandle );
            }
            break;
    }
}

function Js_Account_Select_DropDown( obj_DropDown, str_ValueToMatch )
{
    var i = 0;
    var tmp_Value = "";
    
    for ( i = 0; i < obj_DropDown.options.length; i++ )
    {
        tmp_Value = obj_DropDown.options[ i ].value;
        if ( tmp_Value == str_ValueToMatch )
        {
            obj_DropDown.selectedindex = i;
            obj_DropDown.options[ i ].selected = true;
        }
        else
        {
            obj_DropDown.options[ i ].selected = false;
        }
    }
}

function Js_AccountForm_Password_Check(mode)
{
	if ( mode == "modify" )
	{
    var obj_Form = document.forms[0];

		if ( obj_Form.hdn_UserHandle.value == obj_Form.txt_UserPassword.value)
		{
				alert( "ユーザIDとパスワードは、同一設定を避けてご登録ください。" );
				obj_Form.txt_UserPassword.value = "";
				obj_Form.txt_UserPassword_Confirm.value = "";
				obj_Form.txt_UserPassword.focus();
				return false;
		}
	}

}
function Js_AccountForm_CreateModify_Verify(mode)
{
    var obj_Form = document.forms[0];
    var strVal_PageMode = document.forms[0].hddn_PageMode.value;
    var errMsg_NumbersOnly = "数値を入力してください";
    
	//2007/02/13 kuramochi Add
	var strVal_IndustrySuper = ""
 
    if ( obj_Form.txt_Name_Shi.value == "" )
    {
        alert( "お名前（氏）を入力して下さい。" );
        obj_Form.txt_Name_Shi.focus();
        return false;
    }
    if ( obj_Form.txt_Name_Mei.value == "" )
    {
        alert( "お名前（名）を入力して下さい。" );
        obj_Form.txt_Name_Mei.focus();
        return false;
    }
    if ( obj_Form.txt_Name_Shi_Kana.value == "" )
    {
        alert( "フリガナ（氏）を入力して下さい。" );
        obj_Form.txt_Name_Shi_Kana.focus();
        return false;
    }
    if ( obj_Form.txt_Name_Mei_Kana.value == "" )
    {
        alert( "フリガナ（名）を入力して下さい。" );
        obj_Form.txt_Name_Mei.focus();
        return false;
    }
    if ( obj_Form.txt_CompanyName.value == "" )
    {
        alert( "会社名を入力して下さい。" );
        obj_Form.txt_Name_Shi.focus();
        return false;
    }
    if ( mode == "create")
    {
	    if ( obj_Form.txt_PostalCode_Prefix.value == "" )
		{
			alert( "郵便番号入力して下さい。" );
			obj_Form.txt_PostalCode_Prefix.focus();
			return false;
		}
		else
		{
			if ( obj_Form.txt_PostalCode_Suffix.value == "" )
			{
				alert( "郵便番号入力して下さい。" );
				obj_Form.txt_PostalCode_Suffix.focus();
				return false;
			}
	        if ( Js_AccountForm_VerifyNumber( obj_Form.txt_PostalCode_Prefix, errMsg_NumbersOnly ) == false )
			{
	            obj_Form.txt_PostalCode_Prefix.select();
				return false;
			}
			if ( obj_Form.txt_PostalCode_Suffix.value != "" )
			{
	            if ( Js_AccountForm_VerifyNumber( obj_Form.txt_PostalCode_Suffix, errMsg_NumbersOnly ) == false )
				{
	                obj_Form.txt_PostalCode_Suffix.select();
					return false;
				}
			}
		}
	}
	else
	{
	    if ( obj_Form.txt_PostalCode.value == "" )
		{
			alert( "郵便番号入力して下さい。" );
			obj_Form.txt_PostalCode.focus();
			return false;
		}
	}
    //alert( obj_Form.slct_Address_Prefecture.options[ obj_Form.slct_Address_Prefecture.selectedIndex ].value );
    //if ( obj_Form.slct_Address_Prefecture.options[ obj_Form.slct_Address_Prefecture.selectedIndex ].value == "都道府県" )
    if ( obj_Form.slct_Address_Prefecture.options[ obj_Form.slct_Address_Prefecture.selectedIndex ].value == 0 )
    {
        alert( "都道府県を選択して下さい。" );
        obj_Form.slct_Address_Prefecture.focus();
        return false;
    }
    if ( obj_Form.txt_Address_Street.value == "" )
    {
        alert( "住所を入力して下さい。" );
        obj_Form.txt_Address_Street.focus();
        return false;
    }
    if ( mode == "create")
    {
	    if ( ( obj_Form.txt_Phone_1.value != "" ) && ( obj_Form.txt_Phone_2.value != "" ) && ( obj_Form.txt_Phone_3.value != "" ) )
	    {
			if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Phone_1, errMsg_NumbersOnly ) == false )
			{
	            obj_Form.txt_Phone_1.select();
				return false;
			}
			if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Phone_2, errMsg_NumbersOnly ) == false )
			{
	            obj_Form.txt_Phone_2.select();
				return false;
			}
			if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Phone_3, errMsg_NumbersOnly ) == false )
			{
	            obj_Form.txt_Phone_3.select();
				return false;
			}
		}
		else
		{
	        if ( obj_Form.txt_Phone_1.value == "" )
			{
	            alert( "電話番号を入力して下さい。" );
				obj_Form.txt_Phone_1.focus();
				return false;
			}
			else
			{
	            if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Phone_1, errMsg_NumbersOnly ) == false )
				{
	                obj_Form.txt_Phone_1.select();
					return false;
				}
			}
			if ( obj_Form.txt_Phone_2.value == "" )
			{
	            alert( "電話番号を入力して下さい。" );
				obj_Form.txt_Phone_2.focus();
				return false;
			}
			else
			{
				if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Phone_2, errMsg_NumbersOnly ) == false )
				{
	                obj_Form.txt_Phone_2.select();
					return false;
				}
			}
			if ( obj_Form.txt_Phone_3.value == "" )
			{
	            alert( "電話番号を入力して下さい。" );
				obj_Form.txt_Phone_3.focus();
				return false;
			}
			else
			{
	            if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Phone_3, errMsg_NumbersOnly ) == false )
				{
	                obj_Form.txt_Phone_3.select();
					return false;
				}
			}       
		}
	}
	else
	{
	    if ( obj_Form.txt_Phone.value == "" )
	    {
	        alert( "電話番号を入力して下さい。" );
			obj_Form.txt_Phone.focus();
			return false;
		}
	}
    if ( mode == "create")
    {
	    if ( ( obj_Form.txt_Fax_1.value != "" ) && ( obj_Form.txt_Fax_2.value != "" ) && ( obj_Form.txt_Fax_3.value != "" ) )
	    {
			if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Fax_1, errMsg_NumbersOnly ) == false )
			{
	            obj_Form.txt_Fax_1.select();
				return false;
			}
			if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Fax_2, errMsg_NumbersOnly ) == false )
			{
	            obj_Form.txt_Fax_2.select();
				return false;
			}
			if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Fax_3, errMsg_NumbersOnly ) == false )
			{
	            obj_Form.txt_Fax_3.select();
				return false;
			}
		}
		else
		{
	        if ( ( obj_Form.txt_Fax_1.value == "" ) && ( obj_Form.txt_Fax_2.value == "" ) && ( obj_Form.txt_Fax_3.value == "" ) )
			{
			}
			else        
			{
	            if ( obj_Form.txt_Fax_1.value == "" )
				{
	                alert( "fax番号を入力して下さい。" );
					obj_Form.txt_Fax_1.focus();
					return false;
				}
				else
				{
	                if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Fax_1, errMsg_NumbersOnly ) == false )
					{
	                    obj_Form.txt_Fax_1.select();
						return false;
					}
				}
	            
				if ( obj_Form.txt_Fax_2.value == "" )
				{
	                alert( "fax番号を入力して下さい。" );
					obj_Form.txt_Fax_2.focus();
					return false;
				}
				else
				{
	                if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Fax_2, errMsg_NumbersOnly ) == false )
	                {
						obj_Form.txt_Fax_2.select();
						return false;
					}
				}
				if ( obj_Form.txt_Fax_3.value == "" )
				{
	                alert( "fax番号を入力して下さい。" );
					obj_Form.txt_Fax_3.focus();
					return false;
				}
				else
				{
	                if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Fax_3, errMsg_NumbersOnly ) == false )
					{
	                    obj_Form.txt_Fax_3.select();
						return false;
					}
				}            
			}   
		}
	}
    if ( obj_Form.txt_Email.value == "" )
    {
        alert( "メールアドレスを入力して下さい。" );
        obj_Form.txt_Email.focus();
        return false;
    }

	//2007/04/24 kuramochi メールFormatチェック追加    
	if (CheckText("メールアドレス", obj_Form.txt_Email.value, true, 0, 50, "E-mail") == false) {
		obj_Form.txt_Email.focus();
		return false;
	}

    if ( obj_Form.ddl_IndustrySuper.selectedIndex == -1 ) {
        alert( "業種を選択して下さい。" );
        obj_Form.ddl_IndustrySuper.focus();
        return false;
    }
    if ( obj_Form.ddl_IndustrySuper.options[ obj_Form.ddl_IndustrySuper.selectedIndex ].value == "業種を選択してください。" )
    {
        alert( "業種を選択して下さい。" );
        obj_Form.ddl_IndustrySuper.focus();
        return false;
    }
    if ( obj_Form.ddl_IndustrySub.selectedIndex == -1 ) {
        alert( "業種を選択して下さい。" );
        obj_Form.ddl_IndustrySub.focus();
        return false;
    }
    if ( obj_Form.ddl_IndustrySub.options[ obj_Form.ddl_IndustrySub.selectedIndex ].value == "業種を選択してください。" )
    {
        alert( "業種を選択して下さい。" );
        obj_Form.ddl_IndustrySub.focus();
        return false;
    }
    
    //2007/02/13 kuramochi Start
	strVal_IndustrySuper = obj_Form.ddl_IndustrySuper.selectedIndex
	
	if ( ( strVal_IndustrySuper != 1 ) && ( strVal_IndustrySuper != 2 ) && ( strVal_IndustrySuper != 3 ) && ( strVal_IndustrySuper != 4 ) && ( strVal_IndustrySuper != 5 ) )
	{
	//alert( strVal_IndustrySuper + "あいうえお" );
		if ( obj_Form.ddl_IndustryLow.selectedIndex == -1 ) {
			alert( "業種を選択して下さい。" );
			obj_Form.ddl_IndustryLow.focus();
			return false;
		}
		if ( obj_Form.ddl_IndustryLow.options[ obj_Form.ddl_IndustryLow.selectedIndex ].value == "業種を選択してください。" )
		{
			alert( "業種を選択して下さい。" );
			obj_Form.ddl_IndustryLow.focus();
			return false;
		}
	}
//
//    if ( obj_Form.ddl_IndustryLow.selectedIndex == -1 ) {
//        alert( "業種を選択して下さい。" );
//        obj_Form.ddl_IndustryLow.focus();
//        return false;
//    }
//    if ( obj_Form.ddl_IndustryLow.options[ obj_Form.ddl_IndustryLow.selectedIndex ].value == "業種を選択してください。" )
//    {
//        alert( "業種を選択して下さい。" );
//        obj_Form.ddl_IndustryLow.focus();
//        return false;
//    }
//    2007/02/13 kuramochi End
//

    if ( obj_Form.ddl_JobTop.selectedIndex == -1 ) {
        alert( "職種を選択して下さい。" );
        obj_Form.ddl_JobTop.focus();
        return false;
    }
    if ( obj_Form.ddl_JobTop.options[ obj_Form.ddl_JobTop.selectedIndex ].value == "職種を選択してください。" )
    {
        alert( "職種を選択して下さい。" );
        obj_Form.ddl_JobTop.focus();
        return false;
    }
    if ( obj_Form.ddl_JobLow.selectedIndex == -1 ) {
        alert( "職種を選択して下さい。" );
        obj_Form.ddl_JobLow.focus();
        return false;
    }
    if ( obj_Form.ddl_JobLow.options[ obj_Form.ddl_JobLow.selectedIndex ].value == "職種を選択してください。" )
    {
        alert( "職種を選択して下さい。" );
        obj_Form.ddl_JobLow.focus();
        return false;
    }
	
/*
	//kawashima Editorial
   if ( obj_Form.txt_Baitai.value == "" )
    {
        alert( "媒体名を入力して下さい。" );
        obj_Form.txt_Baitai.focus();
        return false;
    }
    if ( obj_Form.txt_Busuu.value == "" )
    {
        alert( "発行部数を入力して下さい。" );
        obj_Form.txt_Busuu.focus();
        return false;
    }
    if ( obj_Form.txt_Hatsubai.value == "" )
    {
        alert( "発売日を入力して下さい。" );
        obj_Form.txt_Hatsubai.focus();
        return false;
    }
*/

/*
    if ( mode == "create")
    {
	    if ( ( obj_Form.txt_Keitai_1.value != "" ) && ( obj_Form.txt_Keitai_2.value != "" ) && ( obj_Form.txt_Keitai_3.value != "" ) )
	    {
			if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Keitai_1, errMsg_NumbersOnly ) == false )
			{
	            obj_Form.txt_Keitai_1.select();
				return false;
			}
			if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Keitai_2, errMsg_NumbersOnly ) == false )
			{
	            obj_Form.txt_Keitai_2.select();
				return false;
			}
			if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Keitai_3, errMsg_NumbersOnly ) == false )
			{
	            obj_Form.txt_Keitai_3.select();
				return false;
			}
		}
		else
		{
	        if ( obj_Form.txt_Keitai_1.value == "" )
			{
	            alert( "担当者携帯電話番号を入力して下さい。" );
				obj_Form.txt_Keitai_1.focus();
				return false;
			}
			else
			{
	            if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Keitai_1, errMsg_NumbersOnly ) == false )
				{
	                obj_Form.txt_Keitai_1.select();
					return false;
				}
			}
			if ( obj_Form.txt_Keitai_2.value == "" )
			{
	            alert( "担当者携帯電話番号を入力して下さい。" );
				obj_Form.txt_Keitai_2.focus();
				return false;
			}
			else
			{
				if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Keitai_2, errMsg_NumbersOnly ) == false )
				{
	                obj_Form.txt_Keitai_2.select();
					return false;
				}
			}
			if ( obj_Form.txt_Keitai_3.value == "" )
			{
	            alert( "担当者携帯電話番号を入力して下さい。" );
				obj_Form.txt_Keitai_3.focus();
				return false;
			}
			else
			{
	            if ( Js_AccountForm_VerifyNumber( obj_Form.txt_Keitai_3, errMsg_NumbersOnly ) == false )
				{
	                obj_Form.txt_Keitai_3.select();
					return false;
				}
			}       
		}
	}
	else
	{
	    if ( obj_Form.txt_Keitai.value == "" )
	    {
	        alert( "担当者携帯電話番号を入力して下さい。" );
			obj_Form.txt_Keitai.focus();
			return false;
		}
	}
*/

    if ( strVal_PageMode == "create" )
    {
        if ( obj_Form.txt_UserHandle.value == "" )
        {
            alert( "ユーザIDを入力して下さい。" );
            obj_Form.txt_UserHandle.focus();
            return false;
        }
        else
        {
			if ( obj_Form.txt_UserHandle.value == obj_Form.txt_UserPassword.value)
			{
					alert( "ユーザIDとパスワードは、同一設定を避けてご登録ください。" );
					obj_Form.txt_UserPassword.value = "";
					obj_Form.txt_UserPassword_Confirm.value = "";
					obj_Form.txt_UserPassword.focus();
					return false;
			}
            if ( obj_Form.txt_UserHandle.value.length < 4 || obj_Form.txt_UserHandle.value.length > 12 )
            {
                alert( "ユーザIDは、半角英数4文字以上12文字以内で入力してください。" );
                obj_Form.txt_UserHandle.focus();
                return false;
            }
            else
            {
				//2010/12/27 ユーザーIDに"@"､"-"､"_"の3文字を許可する対応
                if ( Js_AccountForm_VerifyAlphaNumberPlus3Chars( obj_Form.txt_UserHandle ) == false )
                {
                    alert( "ユーザIDは、半角12文字を使用してください。" );
                    obj_Form.txt_UserHandle.focus();
                    return false;
                }
            }
        }
    }

    if ( ( obj_Form.txt_UserPassword.value != "" ) && ( obj_Form.txt_UserPassword_Confirm.value != "" ) )
    {
        if ( obj_Form.txt_UserPassword.value.length < 4 || obj_Form.txt_UserPassword.value.length > 12 )
        {
            //alert( "パスワードは、半角英数8文字以上12文字以内で入力してください。" );
            alert( "パスワードは、半角英数4文字以上12文字以内で入力してください。" );
            obj_Form.txt_UserPassword.focus();
            return false;
        }
        //if ( Js_AccountForm_VerifyAlphaNumberMix( obj_Form.txt_UserPassword ) == false )
        if ( Js_AccountForm_VerifyAlphaNumber( obj_Form.txt_UserPassword ) == false )
        {
            //alert( "パスワードは、半角英数文字を混在で使用してください。" );
            alert( "パスワードは、半角英数4文字以上12文字以内で入力してください。" );
            obj_Form.txt_UserPassword.focus();
            return false;
        }
        if ( obj_Form.txt_UserPassword.value != obj_Form.txt_UserPassword_Confirm.value )
        {
            alert( "パスワードを再度入力して下さい。" );
            obj_Form.txt_UserPassword_Confirm.value = "";
            obj_Form.txt_UserPassword.select();
            return false;
        }        
    }
    else
    {
        if ( obj_Form.txt_UserPassword.value == "" )
        {
            alert( "パスワードを入力して下さい。" );
            obj_Form.txt_UserPassword.select();
            return false;
        }
        if ( obj_Form.txt_UserPassword_Confirm.value == "" )
        {
            alert( "パスワードを再入力して下さい。" );
            obj_Form.txt_UserPassword_Confirm.select();
            return false;
        }
    }
    
    
    if ( document.getElementById("okyakusamaFormArea2").style.display != "none" ) {
    
		// お客様カード登録情報
	
		// 会社名
		if(trim(obj_Form.txt_sCompanyName_okyakusama.value) == "")
		{
			alert( "会社名を入力して下さい。" );
			obj_Form.txt_sCompanyName_okyakusama.focus();
			return false;	
		}
	
		// 会社名フリガナ
		if(trim(obj_Form.txt_sCompanyName_Kana_okyakusama.value) == "")
		{
			alert( "会社名フリガナを入力して下さい。" );
			obj_Form.txt_sCompanyName_Kana_okyakusama.focus();
			return false;	
		}
	
		// 郵便番号	
		if(trim(obj_Form.txt_sZIPCD1_okyakusama.value) == "" )
		{
			alert( "郵便番号を入力して下さい。" );
			obj_Form.txt_sZIPCD1_okyakusama.focus();
			return false;	
		}else
		{	
			if(obj_Form.txt_sZIPCD1_okyakusama.value.match(/[^0-9]/g))
			{
				alert( "郵便番号は数値で入力して下さい。" );
				obj_Form.txt_sZIPCD1_okyakusama.focus();
				return false;			
			}
		}	
		if(trim(obj_Form.txt_sZIPCD2_okyakusama.value) == "" )
		{
			alert( "郵便番号を入力して下さい。" );
			obj_Form.txt_sZIPCD2_okyakusama.focus();
			return false;	
		}else
		{	
			if(obj_Form.txt_sZIPCD2_okyakusama.value.match(/[^0-9]/g))
			{
				alert( "郵便番号は数値で入力して下さい。" );
				obj_Form.txt_sZIPCD2_okyakusama.focus();
				return false;			
			}
		}	
	
	
		// ご住所
		if ( obj_Form.slct_CompanyAddress_Prefecture_okyakusama.options[ obj_Form.slct_CompanyAddress_Prefecture_okyakusama.selectedIndex ].value == 0 )    
		{
			alert( "都道府県を選択して下さい。" );
	        obj_Form.slct_CompanyAddress_Prefecture_okyakusama.focus();
		    return false;
	    }
		if(trim(obj_Form.txt_CompanyAddress_Street_okyakusama.value) == "")
		{
			alert( "住所を入力して下さい。" );
			obj_Form.txt_CompanyAddress_Street_okyakusama.focus();
			return false;	
		}
	
		// 電話番号
		if(trim(obj_Form.txt_Phone_2_okyakusama.value) == "")
		{
			alert( "電話番号を入力して下さい。" );
			obj_Form.txt_Phone_2_okyakusama.focus();
			return false;	
		}else{
			if(trim(obj_Form.txt_Phone_2_okyakusama.value).match(/[^0123456789-]+/)){ 
	 		// 数字以外が入力された場合は警告ダイアログを表示 
 			alert("半角数字または半角ハイフンのみ入力してください");
 			obj_Form.txt_Phone_2_okyakusama.focus();
	  		return false;
  			}
		}
	
		// FAX番号
		if(trim(obj_Form.txt_Fax_2_okyakusama.value) == "")
		{
		}else{
			if(trim(obj_Form.txt_Fax_2_okyakusama.value).match(/[^0123456789-]+/)){ 
 			// 数字以外が入力された場合は警告ダイアログを表示 
	 		alert("半角数字または半角ハイフンのみ入力してください");
 			obj_Form.txt_Fax_2_okyakusama.focus();
  			return false;
	  		}
		}
			
		// 設立年月日（西暦）	
	    var vYear = obj_Form.Setsuritsu_YY_okyakusama.value -0;
		var vMonth = obj_Form.Setsuritsu_MM_okyakusama.value - 1;
		var	vDay = obj_Form.Setsuritsu_DD_okyakusama.value - 0;
	    // 月,日の妥当性チェック 
		if( vYear >=1000 && vYear <= 2100 && vMonth >= 0 && vMonth <= 11 && vDay >= 1 && vDay <= 31){ 
			var vDt = new Date(vYear, vMonth, vDay); 
	        if(isNaN(vDt)){
				alert( "設立年月日を入力して下さい。" );
			    return false; 
	        }else if(vDt.getFullYear() == vYear && vDt.getMonth() == vMonth && vDt.getDate() == vDay){ 
		    }else{ 
				alert( "設立年月日を入力して下さい。" );
		        return false; 
			} 
	    }else{
			alert( "設立年月日を入力して下さい。" ); 
	        return false; 
		} 
		
		// 会社登録区分
	    if ( obj_Form.Touroku_Kubun_okyakusama.options[ obj_Form.Touroku_Kubun_okyakusama.selectedIndex ].value == "" )  {
		    alert( "会社登録区分を選択してください。" ); 
		    obj_Form.Touroku_Kubun_okyakusama.focus();
			return false;
	    }

		// 従業員数	
		if(obj_Form.Jyugyouin_Su_okyakusama.value == "")
		{
			alert( "従業員数入力して下さい。" );
			obj_Form.Jyugyouin_Su_okyakusama.focus();
			return false;	
		}else
		{	
			if(obj_Form.Jyugyouin_Su_okyakusama.value.match(/[^0-9]/g))
			{
				alert( "従業員数は数値で入力して下さい。" );
				obj_Form.Jyugyouin_Su_okyakusama.focus();
				return false;			
			}
		}
			
		// 年商
		if(trim(obj_Form.Nensho_okyakusama.value) == "")
		{
			alert( "年商入力して下さい。" );
			obj_Form.Nensho_okyakusama.focus();
			return false;	
		}
		
		// 業種
		if ( obj_Form.slct_Gyoshu_okyakusama.options[ obj_Form.slct_Gyoshu_okyakusama.selectedIndex ].value == "" )  {
	        alert( "業種を選択してください。" ); 
	        obj_Form.Nensho_okyakusama.focus();
		    return false;
		}
	
		// 経理担当者連絡先
		if(trim(obj_Form.txt_Phone_3_okyakusama.value) == "")
		{
		}else{
			if(trim(obj_Form.txt_Phone_3_okyakusama.value).match(/[^0123456789-]+/)){ 
	 		// 数字以外が入力された場合は警告ダイアログを表示 
 			alert("半角数字または半角ハイフンのみ入力してください");
 			obj_Form.txt_Phone_3_okyakusama.focus();
	  		return false;
  			}
		}
		
		// 会社代表者名
		if(trim(obj_Form.txt_cDaihyo_Name_Shi_okyakusama.value) == "")
		{
			alert( "会社代表者名（氏）を入力して下さい。" );
			obj_Form.txt_cDaihyo_Name_Shi_okyakusama.focus();
			return false;	
		}
		if(trim(obj_Form.txt_cDaihyo_Name_Mei_okyakusama.value) == "")
		{
			alert( "会社代表者名（名）を入力して下さい。" );
			obj_Form.txt_cDaihyo_Name_Mei_okyakusama.focus();
			return false;	
		}	
		
		// 会社代表者名フリガナ
		if(trim(obj_Form.txt_Daihyo_Name_Shi_Kana_okyakusama.value) == "")
		{
			alert( "会社代表者名フリガナ（氏）を入力して下さい。" );
			obj_Form.txt_Daihyo_Name_Shi_Kana_okyakusama.focus();
			return false;	
		}
		if(trim(obj_Form.txt_Daihyo_Name_Mei_Kana_okyakusama.value) == "")
		{
			alert( "会社代表者名フリガナ（名）を入力して下さい。" );
			obj_Form.txt_Daihyo_Name_Mei_Kana_okyakusama.focus();
			return false;	
		}	
	
		if(obj_Form.txt_dZIPCD1_okyakusama.value.match(/[^0-9]/g))
		{
			alert( "郵便番号は数値で入力して下さい。" );
			obj_Form.txt_dZIPCD1_okyakusama.focus();
			return false;			
		}
		if(obj_Form.txt_dZIPCD2_okyakusama.value.match(/[^0-9]/g))
		{
			alert( "郵便番号は数値で入力して下さい。" );
			obj_Form.txt_dZIPCD2_okyakusama.focus();
			return false;			
		}
	
		// 会社代表者電話番号
		if(trim(obj_Form.txt_Phone_4_okyakusama.value) == "")
		{
		}else{
			if(trim(obj_Form.txt_Phone_4.value).match(/[^0123456789-]+/)){ 
 			// 数字以外が入力された場合は警告ダイアログを表示 
	 		alert("半角数字または半角ハイフンのみ入力してください");
 			obj_Form.txt_Phone_4_okyakusama.focus();
  			return false;
	  		}
		}

		// 会社代表者FAX番号
		if(trim(obj_Form.txt_Fax_3_okyakusama.value) == "")
		{
		}else{
			if(trim(obj_Form.txt_Fax_3_okyakusama.value).match(/[^0123456789-]+/)){ 
	 		// 数字以外が入力された場合は警告ダイアログを表示 
 			alert("半角数字または半角ハイフンのみ入力してください");
 			obj_Form.txt_Fax_3_okyakusama.focus();
	  		return false;
  			}
		}
	}
	
    if ( Js_HtmlObject_Exists( "chck_Deactivate" ) )
    {
        if ( obj_Form.chck_Deactivate.checked == true )
        {
            if ( confirm("メンバーを脱退します。よろしいですか？") )
            {
            }
            else
            {
                return false;
            }
        }
        else
        {
        }
    }
    return true;
}

function Js_HtmlObject_Exists( str_ObjectHandle )
{
    var bln_ToReturn = false;
    
	for (var i = 0; i < document.forms[0].elements.length; i++)
	{
		currentObj = document.forms[0].elements[i];
	    currentObjName = currentObj.name;
		if ( currentObjName == str_ObjectHandle )
		{
			return true;
		}
	}
	return false;
}


function Js_AccountForm_VerifyNumber( objFormInput, strAlertMsg )
{
    var blnToReturn = true;
    
    if ( ! objFormInput.value.match(/^[0-9]+$/) )
	{
	    if ( strAlertMsg != "" )
	    {
	        alert( strAlertMsg );
	    }		
		objFormInput.focus();
		blnToReturn = false;
	}
	return blnToReturn;	
}

function Js_AccountForm_VerifyAlphaNumber( objFormInput, strAlertMsg )
{
    var blnToReturn = true;
    
    if ( ! objFormInput.value.match(/^[A-Za-z0-9]+$/) )
	{
	    if ( strAlertMsg != "" )
	    {
	        alert( strAlertMsg );
	    }		
		objFormInput.focus();
		blnToReturn = false;
	}
	return blnToReturn;	
}

function Js_AccountForm_VerifyAlphaNumberMix( objFormInput, strAlertMsg )
{
    var blnToReturn = true;
    
    if ( ! objFormInput.value.match(/^[A-Za-z0-9]+$/) )
	{
		
	    if ( typeof strAlertMsg != "undefined" && strAlertMsg != "" )
	    {
	        alert( strAlertMsg );
	    }		
		objFormInput.focus();
		blnToReturn = false;
	}
	else if ( objFormInput.value.match(/^[A-Za-z]+$/) ) {
		if ( typeof strAlertMsg != "undefined" && strAlertMsg != "" )
	    {
	        alert( strAlertMsg );
	    }		
		objFormInput.focus();
		blnToReturn = false;
	}
	else if ( objFormInput.value.match(/^[0-9]+$/) ) {
		if ( typeof strAlertMsg != "undefined" && strAlertMsg != "" )
	    {
	        alert( strAlertMsg );
	    }		
		objFormInput.focus();
		blnToReturn = false;
	}
	return blnToReturn;	
}
//2010/12/27 ユーザーIDに"@"､"-"､"_"の3文字を許可する対応
function Js_AccountForm_VerifyAlphaNumberPlus3Chars( objFormInput, strAlertMsg )
{
    var blnToReturn = true;
    
    if ( ! objFormInput.value.match(/^[\w\@\-]+$/) )
	{
	    if ( typeof strAlertMsg != "undefined" && strAlertMsg != "" )
	    {
	        alert( strAlertMsg );
	    }		
		objFormInput.focus();
		blnToReturn = false;
	}
	return blnToReturn;	
}

function Js_AccountForm_VerifyHankaku( strValueToCheck )
{
	if (Js_Account_GetByte(strValueToCheck) != Js_Account_GetLength(strValueToCheck)) 
	{
		return false;
	}
	else
	{
		return true;
	}
}

function Js_Account_GetByte(str)
{
	if (str=="" || !str || str==null) return 0;
	str=Js_Account_trashGomi(str);
	var strS=str.replace(/[^0-9a-zｱ-ﾝ\!\"\#\$\%\&\'\(\)\-\=\^\~\\\|\@\`\[\{\;\+\:\*\]\}\,\<\.\>\/\?\_]/ig,"##");
	return strS.length;
}

function Js_Account_GetLength(str)
{
	if (str=="" || !str || str==null) return 0;
	str=Js_Account_trashGomi(str);
	var strS=str.replace(/[^0-9a-zｱ-ﾝ\!\"\#\$\%\&\'\(\)\-\=\^\~\\\|\@\`\[\{\;\+\:\*\]\}\,\<\.\>\/\?\_]/ig,"#");
	return strS.length;
}

function Js_Account_trashGomi(s) {
	s=unescape(escape(s).split("%00")[0]);
	return s;
}

// -------------------------------------------------------------------------------------------------------------------------------------------------------------------

function JsAccount_FormVerify_FrameDown_SignIn()
{
    var obj_Form = document.forms[0];
        var str_FrameBodyDetails = JsAccount_Get_FrameBodyDetails( "Down" );
    
    if ( obj_Form.txt_UserHandle.value == "" )
    {
        obj_Form.txt_UserHandle.select();
        return false;
    }
    /*
    if ( Js_AccountForm_VerifyAlphaNumber( obj_Form.txt_UserHandle, "半角文字を使用してください" ) == false )
    {
        obj_Form.txt_UserHandle.select();
        return false;
    }
    */
    if ( obj_Form.txt_Password.value == "" )
    {
        obj_Form.txt_Password.select();
        return false;
    }
    obj_Form.hddn_FrameBodyLocation.value = str_FrameBodyDetails;
    return true;
}

function JsAccount_Get_FrameBodyDetails( strClickSource )
{
    var obj_Url_Top;
    var obj_FrameBody;
    var int_FramesCount = 0;
    var str_FrameBody_Url = "";
    var arr_FrameBodyPath;

    switch ( strClickSource )
    {
        case "Body":
            obj_Url_Top = self.parent.top;
            break;
        case "Down":
            obj_Url_Top = self.parent.top;
            break;
        case "Body_PopUp":
            obj_Url_Top = self.opener.parent.top;
            break;
        case "Down_PopUp":
            obj_Url_Top = self.opener.parent.top;
            break;
    }
    int_FramesCount = obj_Url_Top.frames.length;
    if ( int_FramesCount == 2 )
    {
		try {
	        obj_FrameBody = obj_Url_Top.frames[ 0 ];
		    if ( obj_FrameBody.name == "body" )
			{
				str_FrameBody_Url = obj_FrameBody.location;
			}
		}catch(e){}
    }
    return str_FrameBody_Url;
}

function Js_Controller_Account( strProcessType, strParameter1 )
{
    var str_Url = RealUrl + "/account";
    var str_PopUpHandle_Name = "PopUpHandle_Account";
    var bln_ToReturn = false;

    switch ( strProcessType )
    {
        case "AccountCreateAgree":
            PopUpWindow_Account = Js_Reload_PopUp( PopUpWindow_Account );
            //str_Url = str_Url + "/TermsAgreement.aspx";
            str_Url = "https://" + location.hostname + RealDirectory + "/account/TermsAgreement.aspx";
            PopUpWindow_Account = Js_AccountPopupWindow( str_Url, 489, 860, "yes", "yes", "yes", str_PopUpHandle_Name );
            PopUpWindow_Account.focus();
            break;
        case "AccountCreate":
            PopUpWindow_Account = Js_Reload_PopUp( PopUpWindow_Account );
            //str_Url = str_Url + "/CreateModify.aspx?mode=create&UsrHndle=";
            str_Url = "https://" + location.hostname + RealDirectory + "/account/CreateModify.aspx?mode=create&UsrHndle=";
            PopUpWindow_Account = Js_AccountPopupWindow( str_Url, 489, 860, "yes", "yes", "yes", str_PopUpHandle_Name );
            PopUpWindow_Account.focus();
            break;
        case "AccountModify":
            PopUpWindow_Account = Js_Reload_PopUp( PopUpWindow_Account );
//QZC kawashima 070117 テストのため https → http
            //str_Url = "http://" + location.hostname + RealDirectory + "/account/CreateModify.aspx?mode=modify&UsrHndle=" + strParameter1;
            str_Url = "https://" + location.hostname + RealDirectory + "/account/CreateModify.aspx?mode=modify&UsrHndle=" + strParameter1;

//            str_Url = "http://" + location.hostname + "/account/CreateModify.aspx?mode=modify&UsrHndle=" + strParameter1;
            PopUpWindow_Account = Js_AccountPopupWindow( str_Url, 489, 860, "yes", "yes", "yes", str_PopUpHandle_Name );
            PopUpWindow_Account.focus();
            break;
        case "AccountPasswordRetrieve":
            PopUpWindow_Account = Js_Reload_PopUp( PopUpWindow_Account );
            /*---------*/
            /* HTTPS化 */
            /*---------*/
            //str_Url = str_Url + "/PasswordRetrieve.aspx";
            str_Url = "https://" + location.hostname + RealDirectory + "/account/PasswordRetrieve.aspx";
            PopUpWindow_Account = Js_AccountPopupWindow( str_Url, 472, 600, "yes", "yes", "yes", str_PopUpHandle_Name );
            PopUpWindow_Account.focus();
            break;
    }
    return bln_ToReturn;
}
function Js_Controller_Account_new( strProcessType, strParameter1 )
{
    var str_Url = RealUrl + "/account";
    var str_PopUpHandle_Name = "PopUpHandle_Account";

    switch ( strProcessType )
    {
        case "AccountCreateAgree":
            PopUpWindow_Account = Js_Reload_PopUp( PopUpWindow_Account );
            //str_Url = str_Url + "/TermsAgreement.aspx";
            str_Url = "https://" + location.hostname + RealDirectory + "/account/TermsAgreement.aspx";
            PopUpWindow_Account = Js_AccountPopupWindow( str_Url, 489, 860, "yes", "yes", "yes", str_PopUpHandle_Name );
            PopUpWindow_Account.focus();
            break;
        case "AccountCreate":
            PopUpWindow_Account = Js_Reload_PopUp( PopUpWindow_Account );
            //str_Url = str_Url + "/CreateModify.aspx?mode=create&UsrHndle=";
            str_Url = "https://" + location.hostname + RealDirectory + "/account/CreateModify.aspx?mode=create&UsrHndle=";
            PopUpWindow_Account = Js_AccountPopupWindow( str_Url, 489, 860, "yes", "yes", "yes", str_PopUpHandle_Name );
            PopUpWindow_Account.focus();
            break;
        case "AccountModify":
            PopUpWindow_Account = Js_Reload_PopUp( PopUpWindow_Account );
//QZC kawashima 070117 テストのため https → http
            //str_Url = "http://" + location.hostname + RealDirectory + "/account/CreateModify.aspx?mode=modify&UsrHndle=" + strParameter1;
            str_Url = "https://" + location.hostname + RealDirectory + "/account/CreateModify.aspx?mode=modify&UsrHndle=" + strParameter1;

//            str_Url = "http://" + location.hostname + "/account/CreateModify.aspx?mode=modify&UsrHndle=" + strParameter1;
            PopUpWindow_Account = Js_AccountPopupWindow( str_Url, 489, 860, "yes", "yes", "yes", str_PopUpHandle_Name );
            PopUpWindow_Account.focus();
            break;
        case "AccountPasswordRetrieve":
            PopUpWindow_Account = Js_Reload_PopUp( PopUpWindow_Account );
            //str_Url = str_Url + "/PasswordRetrieve.aspx";
            str_Url = "https://" + location.hostname + RealDirectory + "/account/PasswordRetrieve.aspx";
            PopUpWindow_Account = Js_AccountPopupWindow( str_Url, 472, 600, "yes", "yes", "yes", str_PopUpHandle_Name );
            PopUpWindow_Account.focus();
            break;
    }
}


function Js_Reload_PopUp( objPopUp )
{
    if ( objPopUp )
    {
        objPopUp.close();
        objPopUp = null;
    }
    else
    {        
    }
    return objPopUp;
}

function Js_AccountPopupWindow(url, w, h, st, sc, rs, name)
{
	// 中央座標
	var left = Math.floor((screen.width - w) / 2);
	var top  = Math.floor((screen.height - h) / 2);
	var win = null;

	// ウインドウを開く
	if (document.all) 
	{
		win = window.open(url, name, "width="+w+",height="+h+",status="+st+",scrollbars="+sc+",resizable="+rs+",left="+left+",top="+top);
	}
	else
	{
		win = window.open(url, name, "width="+w+",height="+h+",status="+st+",scrollbars="+sc+",resizable="+rs+",screenX="+left+",screenY="+top);
	}
	// ウインドウを前面に移動
	return win;
}

function JsAccount_HtmlFrames_Exists( obj_Document, str_ObjectHandle )
{
    var bln_ToReturn = false;

	for ( var i = 0; i < obj_Document.frames.length; i++ )
	{
		try {
			currentObj = obj_Document.frames[i];
		    currentObjName = currentObj.name;
			if ( currentObjName == str_ObjectHandle )
			{
				return true;
			}
		}catch(e) {}
	}
	return false;
}

//2007/12/06 kuramochi Start
function JsAccount_SignIn_ReloadClose()
{
    var obj_WindowOpener = window.opener.parent;
	obj_WindowOpener.focus();
	window.opener.location.reload();
	window.close();
}
//2007/12/06 kuramochi End

function JsAccount_SignIn_ed_result()
{
	window.opener.location.reload();
	//window.close();
}



function JsAccount_SignIn_ReloadFrames()
{
    var bln_FrameBody_Exists = false;
    var bln_FrameDown_Exists = false;
    var str_Url_Body = "";
    var str_Url_Down = "";
    var obj_WindowOpener = window.opener.parent;
    
    if ( obj_WindowOpener )
    {
        bln_FrameBody_Exists = JsAccount_HtmlFrames_Exists( obj_WindowOpener, "body" );
        bln_FrameDown_Exists = JsAccount_HtmlFrames_Exists( obj_WindowOpener, "down" );
        if ( ( bln_FrameBody_Exists ) && ( bln_FrameDown_Exists ) )
        {
            str_Url_Body = obj_WindowOpener.body.location;
            str_Url_Down = obj_WindowOpener.down.location;
            obj_WindowOpener.body.location.reload();

            var StrObj_Url_Down_1 = new String( str_Url_Down );
            var StrObj_Url_Down_2 = StrObj_Url_Down_1.toLowerCase();

            if ( StrObj_Url_Down_2.indexOf( RealUrl + "/lightbox/guest/accountguest_", 0 ) != -1 )
            {
                obj_WindowOpener.down.location.replace( ( StrObj_Url_Down_2 ).replace( "accountguest_viewm", "AccountMember_ViewM" ) );
            }
            else
            {
                obj_WindowOpener.down.location.reload();
            }
        }
        else if(bln_FrameBody_Exists == true && bln_FrameDown_Exists == false)
        {
        
        	if(obj_WindowOpener){			
				obj_WindowOpener.location.reload();
			}					
        }
		else{
			try{
				var obj_WindowOpenerOpener = window.opener.opener.parent;
				if ( obj_WindowOpenerOpener )
				{
					bln_FrameBody_Exists = JsAccount_HtmlFrames_Exists( obj_WindowOpenerOpener, "body" );
					bln_FrameDown_Exists = JsAccount_HtmlFrames_Exists( obj_WindowOpenerOpener, "down" );
					if ( ( bln_FrameBody_Exists ) && ( bln_FrameDown_Exists ) )
					{
						str_Url_Body = obj_WindowOpenerOpener.body.location;
						str_Url_Down = obj_WindowOpenerOpener.down.location;
						obj_WindowOpenerOpener.body.location.reload();

						var StrObj_Url_Down_1 = new String( str_Url_Down );
						var StrObj_Url_Down_2 = StrObj_Url_Down_1.toLowerCase();

						if ( StrObj_Url_Down_2.indexOf( RealUrl + "/guest/lightbox/accountguest_", 0 ) != -1 )
						{
							obj_WindowOpenerOpener.down.location.replace( ( StrObj_Url_Down_2 ).replace( "accountguest_viewm", "AccountMember_ViewM" ) );
						}
						else
						{
							obj_WindowOpenerOpener.down.location.reload();
						}
						window.opener.location.reload();
					}
				}
			}catch(e){
				obj_WindowOpener.location.reload();
			}
		}
    }
	obj_WindowOpener.focus();
	window.close();
}

function Js_PasswordRetrieval()
{
    var str_Url = "https://" + location.hostname + RealDirectory + "/account/PasswordRetrieve.aspx";
    //var str_Url = "http://" + location.hostname + RealDirectory + "/account/PasswordRetrieve.aspx";
    
    PopUpWindow_Account = Js_AccountPopupWindow( str_Url, 472, 600, "yes", "yes", "yes", "PopUpHandle_Account" );
    PopUpWindow_Account.focus();
}

function JsAccount_SignInReload( strUrlFrameBody, strUrlFrameDown )
{
	var obj_Opener;
	var int_Index = 0;
	var str_ToPopUp = "";
	var str_Url_Top = "";
	var str_Url_FrameBody = "";
	var str_Url_FrameDown = "";
	
	obj_Opener = window.opener;
	if ( obj_Opener )
	{
	    if ( obj_Opener.parent.frames.length > 0 )
	    {
	        str_ToPopUp = obj_Opener.document.location + "\n";
	        str_ToPopUp = str_ToPopUp + obj_Opener.parent.document.location + "\n";
	        str_ToPopUp = str_ToPopUp + obj_Opener.parent.frames[0].document.location + "\n";
	        str_ToPopUp = str_ToPopUp + obj_Opener.parent.frames[1].document.location + "\n";
	        str_Url_Top = obj_Opener.parent.document.location;
	        str_Url_Top = JsAccount_RemoveFrom_QueryString( str_Url_Top, "BoxMode" );
	        str_Url_Top = JsAccount_RemoveFrom_QueryString( str_Url_Top, "BoxSize" );
	        str_Url_Top = JsAccount_RemoveFrom_QueryString( str_Url_Top, "BoxType" );
	        if ( str_Url_Top.split( '?' ).length > 1 )
	        {
	            str_Url_Top = str_Url_Top + "&BoxMode=0";
	        }
	        else
	        {
	            str_Url_Top = str_Url_Top + "?BoxMode=0";
	        }
	        obj_Opener.parent.document.location = str_Url_Top;
	        window.close();
	    }
	    else
	    {
	    }
	}
	else
	{
	    window.close();
	}
}

function JsAccount_PopUp_ReloadAfterSignIn_BoxModeNoChange()
{
    var obj_Top;
    var obj_FrameBody;
    var obj_FrameDown;
    var obj_FrameDown_Form;

    obj_Top = self.opener.parent.top;
    if ( obj_Top.frames.length == 2 )
    {
        obj_FrameBody = obj_Top.frames[ 0 ]
        obj_FrameDown = obj_Top.frames[ 1 ];
        obj_FrameBody.location.reload();
        obj_FrameDown.location.reload();
    }
}

function JsAccount_ReloadFrames_ViaMemberCreate()
{
    var bln_FrameBody_Exists = false;
    var bln_FrameDown_Exists = false;
    
    var str_Url_Body = "";
    var str_Url_Down = "";

    var obj_WindowOpener = window.opener.parent;
    
    if ( obj_WindowOpener )
    {

        bln_FrameBody_Exists = JsAccount_HtmlFrames_Exists( obj_WindowOpener, "body" );
        bln_FrameDown_Exists = JsAccount_HtmlFrames_Exists( obj_WindowOpener, "down" );
        
        if ( ( bln_FrameBody_Exists ) && ( bln_FrameDown_Exists ) )
        {
            str_Url_Body = obj_WindowOpener.body.location;
            str_Url_Down = obj_WindowOpener.down.location;
            
            obj_WindowOpener.body.location.reload();
            // obj_WindowOpener.down.location.reload();
            obj_WindowOpener.down.location.replace( RealUrl + '/account/navigation.aspx' );
        }
    }
    
    obj_WindowOpener.focus();
	window.close();
}

function JsAccount_ReloadFrames_ViaMemberDeactivate()
{
    var bln_FrameBody_Exists = false;
    var bln_FrameDown_Exists = false;
    var str_Url_Top = "";
    var str_Url_Body = "";
    var str_Url_Down = "";
    var obj_StrUrlTop;
    var obj_StrUrlBody;
    var obj_StrUrlDown;
    var str_TopLocationPathName = "";
    var str_TopLocationSearch = "";
    var str_FrameBodyLocation_Path = "";
    var str_FrameBodyLocation_Query = "";
    var str_RedirectUrl = "";
    var str_JsAlert = "";
    var obj_WindowOpener = window.opener.parent;
    
    if ( obj_WindowOpener )
    {
        str_Url_Top = obj_WindowOpener.top.location;
        
        str_Url_Top = JsAccount_RemoveFrom_QueryString( str_Url_Top, 'BoxMode' );
        str_Url_Top = JsAccount_RemoveFrom_QueryString( str_Url_Top, 'BoxSize' );
        str_Url_Top = JsAccount_RemoveFrom_QueryString( str_Url_Top, 'BxMd' );
        str_Url_Top = JsAccount_RemoveFrom_QueryString( str_Url_Top, 'BxSz' );
        str_Url_Top = JsAccount_RemoveFrom_QueryString( str_Url_Top, 'BxHndl' );
        str_Url_Top = JsAccount_RemoveFrom_QueryString( str_Url_Top, 'BxLbl' );
        obj_StrUrlTop = new String( str_Url_Top );
        if ( obj_StrUrlTop.indexOf( '?' ) > 0 )
        {
            str_TopLocationPathName = obj_StrUrlTop.split( '?' )[ 0 ];
            str_TopLocationSearch = obj_StrUrlTop.split( '?' )[ 1 ];
        }
        else
        {
            str_TopLocationPathName = obj_StrUrlTop;
            str_TopLocationSearch = "";
        }
        bln_FrameBody_Exists = JsAccount_HtmlFrames_Exists( obj_WindowOpener, "body" );
        bln_FrameDown_Exists = JsAccount_HtmlFrames_Exists( obj_WindowOpener, "down" );
        if ( ( bln_FrameBody_Exists ) && ( bln_FrameDown_Exists ) )
        {
            str_Url_Body = obj_WindowOpener.body.location;
            str_Url_Body = JsAccount_RemoveFrom_QueryString( str_Url_Body, 'BoxMode' );
            str_Url_Body = JsAccount_RemoveFrom_QueryString( str_Url_Body, 'BoxSize' );
            str_Url_Body = JsAccount_RemoveFrom_QueryString( str_Url_Body, 'BxMd' );
            str_Url_Body = JsAccount_RemoveFrom_QueryString( str_Url_Body, 'BxSz' );
            str_Url_Body = JsAccount_RemoveFrom_QueryString( str_Url_Body, 'BxHndl' );
            str_Url_Body = JsAccount_RemoveFrom_QueryString( str_Url_Body, 'BxLbl' );
            obj_StrUrlBody = new String( str_Url_Body );
            if ( obj_StrUrlBody.indexOf( '?' ) > 0 )
            {
                str_FrameBodyLocation_Path = obj_StrUrlBody.split( '?' )[ 0 ];
                str_FrameBodyLocation_Query = obj_StrUrlBody.split( '?' )[ 1 ];
            }
            else
            {
                str_FrameBodyLocation_Path = obj_StrUrlBody;
                str_FrameBodyLocation_Query = "";
            }
            str_Url_Down = obj_WindowOpener.down.location;
            obj_StrUrlDown = new String( str_Url_Down );
            str_JsAlert = str_JsAlert + str_TopLocationPathName + "\n";
            str_JsAlert = str_JsAlert + str_TopLocationSearch + "\n";
            str_JsAlert = str_JsAlert + str_FrameBodyLocation_Path + "\n";
            str_JsAlert = str_JsAlert + str_FrameBodyLocation_Query + "\n";
            str_RedirectUrl = "https://" + location.hostname + RealUrl + "/account/login.aspx";
//            str_RedirectUrl = "/common/LaunchFrame.aspx?TpPth=" + escape(str_TopLocationPathName) + "&TpQry=" + escape(str_TopLocationSearch);
//            str_RedirectUrl = str_RedirectUrl + "&FrmBdyPth=" + escape( str_FrameBodyLocation_Path );
//            str_RedirectUrl = str_RedirectUrl + "&FrmBdyQry=" + escape( str_FrameBodyLocation_Query );
//            str_RedirectUrl = str_RedirectUrl + "&FrmDwnDtls=" + escape( '0.SignIn' );
            obj_WindowOpener.top.location.replace( str_RedirectUrl );
        }
    }
    obj_WindowOpener.focus();
	window.close();
}

function Js_AccountForm_PasswordRetrieval_Verify()
{
    var obj_Form = document.forms[0];
    
    if ( obj_Form.txt_UserEmail.value == "" )
    {
        alert( "メールアドレスを入力して下さい。" );
        obj_Form.txt_UserEmail.focus();
        return false;
    }
    else if ( obj_Form.txt_UserTel1.value == "" )
    {
        alert( "電話番号が正しく入力されていません。" );
        obj_Form.txt_UserTel1.focus();
        return false;
    }
    else if ( obj_Form.txt_UserTel2.value == "" )
    {
        alert( "電話番号が正しく入力されていません。" );
        obj_Form.txt_UserTel2.focus();
        return false;
    }
    else if ( obj_Form.txt_UserTel3.value == "" )
    {
        alert( "電話番号が正しく入力されていません。" );
        obj_Form.txt_UserTel3.focus();
        return false;
    }
    return true;
}

function JsAccount_RemoveFrom_QueryString( strUrl, strName )
{
	var str_PathUrl = "";
	var str_Query = "";
	var str_Temp = "";
	var obj_Url;
	var ObjStr_Temp = new String( strUrl );
	var int_Index = 0;
	
	obj_Url = ObjStr_Temp.split("?");
	if ( obj_Url.length == 1 )
	{
	    str_PathUrl = obj_Url[0];
		str_Query = "";
	}
	else if ( obj_Url.length == 2 )
	{
	    str_PathUrl = obj_Url[0];
		str_Query = obj_Url[1];
	}

	// name=xxxを削除
	if ( str_Query.replace( " ", "" ) != "" )
	{
	    var obj_Temp = new String( str_Query );
		var arr_Query = obj_Temp.split("&");
		str_Query = "";
		for ( int_Index = 0; int_Index < arr_Query.length; int_Index++ )
		{
		    str_Temp = arr_Query[int_Index];
		    if ( arr_Query[int_Index].indexOf( strName + "=" ) == 0 )
		    {
		        // あり
		    }
		    else
		    {
		        str_Query = JsAccount_AddTo_StringList( str_Query, arr_Query[int_Index], "&" );
		    }
		}
	}
	else
	{
	    // alert( "catch 1" );
	}
	if ( str_Query != "" )
	{
	    str_PathUrl = str_PathUrl + "?" + str_Query;
	}
	return str_PathUrl;
}

//2007/07/05 kuramochi Start
function Enquete_MarketResearch()
{
    if((document.forms[0].Txt_Opinion.value.length > 50)&&(document.forms[0].Txt_Opinion.value.length != 0))
    {
        alert( "当サイトご利用のご意見ご感想は50文字以内で入力してください。" );
		document.forms[0].Txt_Opinion.focus();
        return false;
    }
    
    if((document.forms[0].Txt_CompanyNm.value.length > 30)&&(document.forms[0].Txt_CompanyNm.value.length != 0))
    {
        alert( "30文字以内で入力してください。" );
		document.forms[0].Txt_CompanyNm.focus();
        return false;
    }    
}
//2007/07/05 kuramochi End

function trim(str){
	if( str == null ) return null;
	if( str == undefined ) return undefined;
	return str.replace(/(^\s*)|(\s*$)/g, "");
}

