function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function chkId()
{
  var f = document.iRegMember;
  var uid = f.uid.value
  if( uid.length == 0 )
    {
     alert("請先輸入欲申請之帳號");
     f.uid.focus();
     return;
    }

  if( uid.length < 4 || uid.length > 12 )
    {
     alert("帳號長度只能 4 至 12 個字元 !" );
     f.uid.focus();
     return;
    }

  if ( !(uid.charAt(0)>= 'a' && uid.charAt(0) <= 'z') )
    {
     alert("帳號第一字元只能為小寫字母 !" );
     f.uid.focus();
     return;	 
    }
  for( idx = 0 ; idx < uid.length ; idx++ )
    {
  if( uid.charAt(idx)>= 'A' && uid.charAt(idx) <= 'Z' )
    {
     alert("帳號不可以含有大寫字元 !" );
     f.uid.focus();
     return;	 
    }
  if( !( ( uid.charAt(idx)>= 'a' && uid.charAt(idx) <= 'z' ) || ( uid.charAt(idx)>= '0' && uid.charAt(idx) <= '9' ) || ( uid.charAt(idx) == '_' ) ) )
    {
     alert("帳號只能是數字,英文字母及「_」等符號,其他的符號都不能使用 !\n" );	
     f.uid.focus();
     return;
	}

  if( uid.charAt(idx) == '_' && uid.charAt(idx-1) == '_' )
    {
     alert("「_」符號不可相連 !\n" );  
     f.uid.focus();
     return;
    }

    }
  if( !( ( uid.charAt(uid.length - 1 )>= 'a' && uid.charAt(uid.length - 1 ) <= 'z' ) || ( uid.charAt(uid.length - 1 )>= '0' && uid.charAt(uid.length - 1 ) <= '9' ) ) )
   {
     alert("帳號的最後只能是數字及英文字母 !\n" );
     f.uid.focus();
     return;
   }
   mainCallBack();
//w = window.open("index.asp?Mods=CheckAll&File=CheckUid&Uid="+f.uid.value,"chkid","width=600,height=200,toolbar=0");
 //self.location.href='index.asp?Mods=CheckAll&File=CheckUids&Uid='+f.uid.value;
//w.focus();
}

function CheckstepAll()
{
  var thisForm = document.iRegMember;
  var alertStr = check_uid( thisForm.uid.value );  
      alertStr += check_passwd( thisForm.pass.value, thisForm.chkpass.value, thisForm.uid.value );  
      alertStr += check_null( thisForm.m_name.value, "真實姓名");  
      alertStr += check_null( thisForm.m_sname.value, "暱稱"); 
      alertStr += check_null( thisForm.m_year.value, "出生年份"); 
      alertStr += check_year( thisForm.m_year.value, "出生年份"); 
      alertStr += check_select( thisForm.m_month, "出生月份"); 
      alertStr += check_select( thisForm.m_day, "出生日期"); 	
      alertStr += check_radio( thisForm.m_sex, "性別"); 	    	  	  	    
      //alertStr += check_identity( thisForm.m_sn.value); 	  
      alertStr += check_select( thisForm.county_no, "所在縣市"); 
      alertStr += check_select( thisForm.area_no, "所在地區"); 
      alertStr += check_null( thisForm.m_address.value, "聯絡地址");
      alertStr += check_telephonenumber( thisForm.m_tel.value, "聯絡電話");
      //alertStr += check_mobilephone( thisForm.m_mobile.value, "行動電話");	  
      alertStr += check_radio( thisForm.m_marriage, "婚姻狀況"); 
      alertStr += check_select( thisForm.m_edu, "學歷"); 
      alertStr += check_select( thisForm.m_job, "行業別"); 
      alertStr += check_select( thisForm.m_income, "收入狀況"); 
      alertStr += check_radio( thisForm.m_sons, "有無子女"); 	  	  	  
      alertStr += check_email( thisForm.m_email.value); 	  	  	  	  
      alertStr += check_radio( thisForm.m_know, "如何得知"); 
      alertStr += check_radio( thisForm.m_epaper, "訂閱電子報"); 	  	  	  	  	  	  
      alertStr += check_radio( thisForm.m_dewllstate, "目前居住狀況");   
      alertStr += check_radio( thisForm.m_nextpurchase, "未來購屋規劃"); 
      alertStr += check_radio( thisForm.m_loan, "是否有房貸需求"); 
      alertStr += check_box( thisForm.m_county_no, "所在縣市");  	  	  	    
      alertStr += check_box( thisForm.m_object_no, "建案類型"); 
      alertStr += check_box( thisForm.m_kind_no, "房屋類型"); 
      alertStr += check_rrboxmax ( thisForm.m_aspect_no,3, "座向");  	  	  
      alertStr += check_num( thisForm.m_minsell.value, "銷售坪數(最小)");
      alertStr += check_num( thisForm.m_maxsell.value, "銷售坪數(最大)");
      alertStr += check_num( thisForm.m_minprice.value, "每坪單價(最小)");
      alertStr += check_num( thisForm.m_maxprice.value, "每坪單價(最大)");	  
      alertStr += check_num( thisForm.m_minamount.value, "總價(最小)");
      alertStr += check_num( thisForm.m_maxamount.value, "總價(最大)");	  
      alertStr += check_num( thisForm.m_minroom.value, "房間規劃(最低)");
      alertStr += check_num( thisForm.m_maxroom.value, "房間規劃(最高)");	 	  	  	  	  
      alertStr += check_box ( thisForm.m_dnstyle_no, "我喜歡的設計風格");  	  	  	  	  	  	  
      alertStr += check_null( thisForm.m_a_budget.value, "我的設計裝潢預算"); 
      alertStr += check_num( thisForm.m_a_budget.value, "我的設計裝潢預算");
					  
	  
  if( alertStr != '' ) {
    alert( alertStr );
	return ;
}
thisForm.submit();
}



function Checkstep1()
{
  var thisForm = document.iRegMember;
  var alertStr = check_uid( thisForm.uid.value );  
      alertStr += check_passwd( thisForm.pass.value, thisForm.chkpass.value, thisForm.uid.value );  
  if( alertStr != '' ) {
    alert( alertStr );
	return ;
}
showtab(subtab1);
}

function Checkstep2()
{
  var thisForm = document.iRegMember;
  var alertStr = check_null( thisForm.m_name.value, "真實姓名");  
      alertStr += check_null( thisForm.m_sname.value, "暱稱"); 
      alertStr += check_null( thisForm.m_year.value, "出生年份"); 
      alertStr += check_year( thisForm.m_year.value, "出生年份"); 
      alertStr += check_select( thisForm.m_month, "出生月份"); 
      alertStr += check_select( thisForm.m_day, "出生日期"); 	
      alertStr += check_radio( thisForm.m_sex, "性別"); 	    	  	  	    
      //alertStr += check_identity( thisForm.m_sn.value); 	  
      alertStr += check_select( thisForm.county_no, "所在縣市"); 
      alertStr += check_select( thisForm.area_no, "所在地區"); 
      alertStr += check_null( thisForm.m_address.value, "聯絡地址");
      alertStr += check_telephonenumber( thisForm.m_tel.value, "聯絡電話");
      //alertStr += check_mobilephone( thisForm.m_mobile.value, "行動電話");	  
      alertStr += check_radio( thisForm.m_marriage, "婚姻狀況"); 
      alertStr += check_select( thisForm.m_edu, "學歷"); 
      alertStr += check_select( thisForm.m_job, "行業別"); 
      alertStr += check_select( thisForm.m_income, "收入狀況"); 
      alertStr += check_radio( thisForm.m_sons, "有無子女"); 	  	  	  
      alertStr += check_email( thisForm.m_email.value); 	  	  	  	  
      alertStr += check_radio( thisForm.m_know, "如何得知"); 
      alertStr += check_radio( thisForm.m_epaper, "訂閱電子報"); 	  	  	  	  	  	  
      alertStr += check_radio( thisForm.m_dewllstate, "目前居住狀況");   
      alertStr += check_radio( thisForm.m_nextpurchase, "未來購屋規劃"); 
      alertStr += check_radio( thisForm.m_loan, "是否有房貸需求"); 
      alertStr += check_box( thisForm.m_county_no, "所在縣市");  	  	  	    
      alertStr += check_box( thisForm.m_object_no, "建案類型"); 
      alertStr += check_box( thisForm.m_kind_no, "房屋類型"); 
      alertStr += check_rrboxmax ( thisForm.m_aspect_no,3, "座向");  	  	  
      alertStr += check_num( thisForm.m_minsell.value, "銷售坪數(最小)");
      alertStr += check_num( thisForm.m_maxsell.value, "銷售坪數(最大)");
      alertStr += check_num( thisForm.m_minprice.value, "每坪單價(最小)");
      alertStr += check_num( thisForm.m_maxprice.value, "每坪單價(最大)");	  
      alertStr += check_num( thisForm.m_minamount.value, "總價(最小)");
      alertStr += check_num( thisForm.m_maxamount.value, "總價(最大)");	  
      alertStr += check_num( thisForm.m_minroom.value, "房間規劃(最低)");
      alertStr += check_num( thisForm.m_maxroom.value, "房間規劃(最高)");	 	  	  	  	  
      alertStr += check_box ( thisForm.m_dnstyle_no, "我喜歡的設計風格");  	  	  	  	  	  	  
      alertStr += check_null( thisForm.m_a_budget.value, "我的設計裝潢預算"); 
      alertStr += check_num( thisForm.m_a_budget.value, "我的設計裝潢預算");
					  
					  
  if( alertStr != '' ) {
    alert( alertStr );
	return ;
}
showtab(subtab2);
}



function Checkstep3()
{
  var thisForm = document.iRegMember;
  var alertStr = check_radio( thisForm.m_dewllstate, "目前居住狀況");   
      alertStr += check_radio( thisForm.m_nextpurchase, "未來購屋規劃"); 
      alertStr += check_radio( thisForm.m_loan, "是否有房貸需求"); 
      alertStr += check_box( thisForm.m_county_no, "所在縣市");  	  	  	    
      alertStr += check_box( thisForm.m_object_no, "建案類型"); 
      alertStr += check_box( thisForm.m_kind_no, "房屋類型"); 
      alertStr += check_rrboxmax ( thisForm.m_aspect_no,3, "座向");  	  	  
      alertStr += check_num( thisForm.m_minsell.value, "銷售坪數(最小)");
      alertStr += check_num( thisForm.m_maxsell.value, "銷售坪數(最大)");
      alertStr += check_num( thisForm.m_minprice.value, "每坪單價(最小)");
      alertStr += check_num( thisForm.m_maxprice.value, "每坪單價(最大)");	  
      alertStr += check_num( thisForm.m_minamount.value, "總價(最小)");
      alertStr += check_num( thisForm.m_maxamount.value, "總價(最大)");	  
      alertStr += check_num( thisForm.m_minroom.value, "房間規劃(最低)");
      alertStr += check_num( thisForm.m_maxroom.value, "房間規劃(最高)");	 	  	  	  	  
      alertStr += check_box ( thisForm.m_dnstyle_no, "我喜歡的設計風格");  	  	  	  	  	  	  
      alertStr += check_null( thisForm.m_a_budget.value, "我的設計裝潢預算"); 
      alertStr += check_num( thisForm.m_a_budget.value, "我的設計裝潢預算");
					  
  if( alertStr != '' ) {
    alert( alertStr );
	return ;
}
thisForm.submit();
}



function chkpastId()
{
  var f = document.iPastMember;
  var uid = f.uid.value
  if( uid.length == 0 )
    {
     alert("請先輸入欲申請之帳號");
     f.uid.focus();
     return;
    }

  if( uid.length < 4 || uid.length > 12 )
    {
     alert("帳號長度只能 4 至 12 個字元 !" );
     f.uid.focus();
     return;
    }

  if ( !(uid.charAt(0)>= 'a' && uid.charAt(0) <= 'z') )
    {
     alert("帳號第一字元只能為小寫字母 !" );
     f.uid.focus();
     return;	 
    }
  for( idx = 0 ; idx < uid.length ; idx++ )
    {
  if( uid.charAt(idx)>= 'A' && uid.charAt(idx) <= 'Z' )
    {
     alert("帳號不可以含有大寫字元 !" );
     f.uid.focus();
     return;	 
    }
  if( !( ( uid.charAt(idx)>= 'a' && uid.charAt(idx) <= 'z' ) || ( uid.charAt(idx)>= '0' && uid.charAt(idx) <= '9' ) || ( uid.charAt(idx) == '_' ) ) )
    {
     alert("帳號只能是數字,英文字母及「_」等符號,其他的符號都不能使用 !\n" );	
     f.uid.focus();
     return;
	}

  if( uid.charAt(idx) == '_' && uid.charAt(idx-1) == '_' )
    {
     alert("「_」符號不可相連 !\n" );  
     f.uid.focus();
     return;
    }

    }
  if( !( ( uid.charAt(uid.length - 1 )>= 'a' && uid.charAt(uid.length - 1 ) <= 'z' ) || ( uid.charAt(uid.length - 1 )>= '0' && uid.charAt(uid.length - 1 ) <= '9' ) ) )
   {
     alert("帳號的最後只能是數字及英文字母 !\n" );
     f.uid.focus();
     return;
   }
w = window.open("index.asp?Mods=CheckAll&File=ChecksUid&Uid="+f.uid.value+"&Sno="+f.sno.value,"chkid","width=600,height=200,toolbar=0");
w.focus();
}






function CheckPast()

{
  var thisForm = document.iPastMember;
  var alertStr = check_uid( thisForm.uid.value );  
      alertStr += check_passwd( thisForm.pass.value, thisForm.chkpass.value, thisForm.uid.value );    
      alertStr += check_null( thisForm.m_name.value, "真實姓名");  
      alertStr += check_null( thisForm.m_sname.value, "暱稱"); 
      alertStr += check_null( thisForm.m_year.value, "出生年份"); 
      alertStr += check_year( thisForm.m_year.value, "出生年份"); 
      alertStr += check_select( thisForm.m_month, "出生月份"); 
      alertStr += check_select( thisForm.m_day, "出生日期"); 	
      alertStr += check_radio( thisForm.m_sex, "性別"); 	    	  	  	    
      //alertStr += check_identity( thisForm.m_sn.value); 	  
      alertStr += check_select( thisForm.county_no, "所在縣市"); 
      alertStr += check_select( thisForm.area_no, "所在地區"); 
      alertStr += check_null( thisForm.m_address.value, "聯絡地址");
      alertStr += check_telephonenumber( thisForm.m_tel.value, "聯絡電話");
      //alertStr += check_mobilephone( thisForm.m_mobile.value, "行動電話");	  
      alertStr += check_radio( thisForm.m_marriage, "婚姻狀況"); 
      alertStr += check_select( thisForm.m_edu, "學歷"); 
      alertStr += check_select( thisForm.m_job, "行業別"); 
      alertStr += check_select( thisForm.m_income, "收入狀況"); 
      alertStr += check_radio( thisForm.m_sons, "有無子女"); 	  	  	  
      alertStr += check_email( thisForm.m_email.value); 	  	  	  	  
      alertStr += check_radio( thisForm.m_know, "如何得知"); 
      alertStr += check_radio( thisForm.m_epaper, "訂閱電子報"); 
      alertStr += check_radio( thisForm.m_dewllstate, "目前居住狀況");   
      alertStr += check_radio( thisForm.m_nextpurchase, "未來購屋規劃"); 
      alertStr += check_radio( thisForm.m_loan, "是否有房貸需求"); 
      alertStr += check_box( thisForm.m_county_no, "所在縣市");  	  	  	    
      alertStr += check_box( thisForm.m_object_no, "建案類型"); 
      alertStr += check_box( thisForm.m_kind_no, "房屋類型"); 
      alertStr += check_rrboxmax ( thisForm.m_aspect_no,3, "座向");  	  	  
      alertStr += check_num( thisForm.m_minsell.value, "銷售坪數(最小)");
      alertStr += check_num( thisForm.m_maxsell.value, "銷售坪數(最大)");
      alertStr += check_num( thisForm.m_minprice.value, "每坪單價(最小)");
      alertStr += check_num( thisForm.m_maxprice.value, "每坪單價(最大)");	  
      alertStr += check_num( thisForm.m_minamount.value, "總價(最小)");
      alertStr += check_num( thisForm.m_maxamount.value, "總價(最大)");	  
      alertStr += check_num( thisForm.m_minroom.value, "房間規劃(最低)");
      alertStr += check_num( thisForm.m_maxroom.value, "房間規劃(最高)");	 	  	  	  	  
      alertStr += check_box ( thisForm.m_dnstyle_no, "我喜歡的設計風格");  	  	  	  	  	  	  
      alertStr += check_null( thisForm.m_a_budget.value, "我的設計裝潢預算"); 
      alertStr += check_num( thisForm.m_a_budget.value, "我的設計裝潢預算");
					  
  if( alertStr != '' ) {
    alert( alertStr );
	return ;
}
thisForm.submit();
}








function FrmCheckPass()
{
  var thisForm = document.iMemberPass;
  var alertStr = check_editpasswd( thisForm.OPass.value, thisForm.NPass.value, thisForm.ChkPass.value, thisForm.Uid.value);  
  if( alertStr != '' ) {
    alert( alertStr );
	return ;
}
thisForm.submit();
}


function FrmCheckEdit()
{
  var thisForm = document.iMemberEditInfo;
  var alertStr = check_null( thisForm.M_SName.value, "暱稱"); 
      alertStr += check_null( thisForm.M_Year.value, "出生年份"); 
      alertStr += check_year( thisForm.M_Year.value, "出生年份"); 
      alertStr += check_select( thisForm.M_Month, "出生月份"); 
      alertStr += check_select( thisForm.M_Day, "出生日期"); 		    	  	  	    	  
      alertStr += check_select( thisForm.County_No, "所在縣市"); 
      alertStr += check_select( thisForm.Area_No, "所在地區"); 
      alertStr += check_null( thisForm.M_Address.value, "聯絡地址");
      alertStr += check_telephonenumber( thisForm.M_Tel.value, "聯絡電話");	  
      alertStr += check_radio( thisForm.M_Marriage, "婚姻狀況"); 
      alertStr += check_select( thisForm.M_Edu, "學歷"); 
      alertStr += check_select( thisForm.M_Job, "行業別"); 
      alertStr += check_select( thisForm.M_Income, "收入狀況"); 
      alertStr += check_radio( thisForm.M_Sons, "有無子女"); 	  	  	  	  	  	  	  
      alertStr += check_radio( thisForm.M_Know, "如何得知"); 
      alertStr += check_radio( thisForm.M_Epaper, "訂閱電子報"); 	  	  	  	  	  	  

					  
					  
  if( alertStr != '' ) {
    alert( alertStr );
	return ;
}
thisForm.submit();
}


function FrmCheckEditLife()
{
  var thisForm = document.iMemberLife;
  var alertStr = check_box ( thisForm.m_dnstyle_no, "我喜歡的設計風格");  	  	  	  	  	  	  
      alertStr += check_null( thisForm.m_a_budget.value, "我的設計裝潢預算"); 
      alertStr += check_num( thisForm.m_a_budget.value, "我的設計裝潢預算");	  	  	  	  	  	  

					  
					  
  if( alertStr != '' ) {
    alert( alertStr );
	return ;
}
thisForm.submit();
}



function FrmCheckEditVrhouse()
{
  var thisForm = document.iMemberVrhouse;
  var alertStr = check_radio( thisForm.m_dewllstate, "目前居住狀況");   
      alertStr += check_radio( thisForm.m_nextpurchase, "未來購屋規劃"); 
      alertStr += check_radio( thisForm.m_loan, "是否有房貸需求"); 
      alertStr += check_box( thisForm.m_county_no, "所在縣市");  	  	  	    
      alertStr += check_box( thisForm.m_object_no, "建案類型"); 
      alertStr += check_box( thisForm.m_kind_no, "房屋類型"); 
      alertStr += check_rrboxmax ( thisForm.m_aspect_no,3, "座向");  	  	  
      alertStr += check_num( thisForm.m_minsell.value, "銷售坪數(最小)");
      alertStr += check_num( thisForm.m_maxsell.value, "銷售坪數(最大)");
      alertStr += check_num( thisForm.m_minprice.value, "每坪單價(最小)");
      alertStr += check_num( thisForm.m_maxprice.value, "每坪單價(最大)");	  
      alertStr += check_num( thisForm.m_minamount.value, "總價(最小)");
      alertStr += check_num( thisForm.m_maxamount.value, "總價(最大)");	  
      alertStr += check_num( thisForm.m_minroom.value, "房間規劃(最低)");
      alertStr += check_num( thisForm.m_maxroom.value, "房間規劃(最高)");	 	  	  	  	  
					  
  if( alertStr != '' ) {
    alert( alertStr );
	return ;
}
thisForm.submit();
}








function FrmSendPassWord()
{
  var thisForm = document.iMemberSendPass;
  var alertStr = check_null( thisForm.Uid.value, "帳號");  
      alertStr += check_email( thisForm.M_Email.value); 	  	  	  	  
					  
  if( alertStr != '' ) {
    alert( alertStr );
	return ;
}
thisForm.submit();
}




function FrmApoAdd ()
{
  var thisForm = document.iFrmApo;
  
  var alertStr = check_null( thisForm.A_MinPrice.value, "最低購屋預算");
      alertStr += check_num( thisForm.A_MinPrice.value, "最低購屋預算");	  	  
      alertStr += check_null( thisForm.A_MaxPrice.value, "最高購屋預算");
      alertStr += check_num( thisForm.A_MaxPrice.value, "最高購屋預算");
      alertStr += check_null( thisForm.A_MinSize.value, "最低需求坪數");
      alertStr += check_num( thisForm.A_MinSize.value, "最低需求坪數");
      alertStr += check_null( thisForm.A_MaxSize.value, "最高需求坪數");
      alertStr += check_num( thisForm.A_MaxSize.value, "最高需求坪數");	  	  
      alertStr += check_radio( thisForm.A_Stall, "車位需求");	 
      alertStr += check_radio( thisForm.A_Time, "欲購屋時間");	 	   	  
      alertStr += check_null( thisForm.A_Year.value, "希望看屋時間年份");
      alertStr += check_null( thisForm.A_Month.value, "希望看屋時間月份");	  	  
      alertStr += check_null( thisForm.A_Day.value, "希望看屋時間日期");
      alertStr += check_null( thisForm.A_Hour.value, "希望看屋時間小時");
      alertStr += check_radio( thisForm.A_Effect, "購屋用途");	 	  
      alertStr += check_null( thisForm.A_RealName.value, "真實姓名");	  
      alertStr += check_null( thisForm.A_RealTel.value, "聯絡電話");	
      alertStr += check_null( thisForm.A_RealEmail.value, "電子信箱");		    	  	   
      alertStr += check_useremail( thisForm.A_RealEmail.value, "電子信箱");  		   
      alertStr += check_radio( thisForm.A_Notify, "提醒通知");		     
	  	  	  

  if( alertStr != '' ) {
    alert( alertStr );
	return ;
}
thisForm.submit()
}




function FrmManageSendEmail ()
{
  var thisForm = document.iFrmSendEmail;

  var alertStr = check_null(thisForm.Sno.value, "收件者編號");  
      alertStr += check_null(thisForm.M_Subject.value, "信件主旨");
      alertStr += check_null(thisForm.M_Msg.value, "信件內容"); 
   
  if( alertStr != '' ) {
    alert( alertStr );
	return ;
}
thisForm.submit()
}


function FrmDelOutbox ()
{
  var thisForm = document.iMemberList;

  var alertStr = check_box(thisForm.Check_No, "所要刪除的信件");  
   
  if( alertStr != '' ) {
    alert( alertStr );
	return ;
}
thisForm.submit()
}


function FrmDelInbox ()
{
 var thisForm = document.iMemberList;
 var alertStr = check_box(thisForm.Check_No, "所要刪除的信件");  
   
  if( alertStr != '' ) {
    alert( alertStr );
	return ;
}
thisForm.submit()
}




function ComradeMatch ()
{
  var thisForm = document.iMemberList;
  
  var alertStr = check_matchbox( thisForm.Check_No);

  if( alertStr != '' ) {
    alert( alertStr );
	return ;
}
thisForm.action="http://www.vrhouse.com.tw/index1.asp?Mods=Match";
thisForm.submit()
}