/**
*
*/


//给地区父控件设置选中值
function SetSelectedValueType( objName,varValue )
{
	for( var i=0; i < document.all(objName).length; i ++ )
	{
	if( document.all(objName).options[i].value == varValue )
	{
		document.all(objName).selectedIndex = i;  
		break;
	}
	}
}
//给地区子控件设置选中值
function SetSelectedValueList( objName,varValue )
{
	var strCity = objName;
	var strState = strCity.replace('City','State');
	changeChildList(document.all[strState],document.all[strCity]) //选中当前父控件的子项目（调用onchange）
	for( var i=0; i < document.all(objName).length; i ++ )
	{
		if( document.all(objName).options[i].value == varValue )
		{
		document.all(objName).selectedIndex = i;  
		break;
		}
	}
}	


function showMoreContact()
{
	if(document.all['contact2']!=null)
		document.all['contact2'].style.display="block";
	if(document.all['contact3']!=null)
		document.all['contact3'].style.display="block";
		
	if(document.all['href_showMoreContact']!=null)
		document.all['href_showMoreContact'].style.display="none";
	
}
		
function DisplayOtherCity(pObject,pOther)
{
	if (pObject.options[pObject.options.selectedIndex].value == 252)
	{
		var o = document.all['TB_STU_HuKouOther'] ;
		if(o!=null)
		{
			if(o.value=="_default")
			    o.value="" ;
		}
    	
		pOther.style.display = "";
	}
	else
	{		    
			var o = document.all['TB_STU_HuKouOther'] ;			    
		if(o!=null)
		{
		
		    if(o.value==null||o.value=='')
		    {
			    o.value="_default" ;
			}
		}
		
		pOther.style.display = "none";
	}
}



function ChangeContactType()
{
    var contt1 = document.all['Contact_type1'] ;
    if(contt1==null)
        return ;
    var vm = document.all['valid_mobile'] ;
    if(vm==null)
        return ;
        
    if (contt1.selectedIndex==0)  //手机
    {
        vm.enabled = true;
    }
    else
    {
        vm.enabled = false;
        //document.all['RegularexpressionContactNo1'].enabled = false;
    }
}
function ChangeIDType()
{
	if (document.all['Indentit'].selectedIndex==0) //身份证
	{
		if(document.all['_not_hidden_valid_Paper']!=null)
			document.all['_not_hidden_valid_Paper'].enabled = true;
	}
	else
	{
		if(document.all['_not_hidden_valid_Paper']!=null)
			document.all['_not_hidden_valid_Paper'].enabled = false;
		//document.all['RegularExpressionValidator1'].innerHTML = '';    
	}
}       

//验证是否选择期望从事职业
function expectCareerClientValidate(source,arguments)
{        
	if (expectCareerObj.length>0)
	{
		arguments.IsValid=true;
	}
	else
	{
		arguments.IsValid=false;
	}
}
//验证期望工作地区
function areaCityClientValidate(source,arguments)
{         
	if (expectCityObj.length>0)
	{
		arguments.IsValid=true;
	}
	else
	{
		arguments.IsValid=false;
	}
} 

//验证是否选择期望从事行业
function ExpectWorkIndustryClientValidate(source,arguments)
{        
	if (expectCareerObj.length>0)
	{
		arguments.IsValid=true;
	}
	else
	{
		arguments.IsValid=false;
	}
}  

function ExpectTradeClientValidate(source,arguments)
{        
	if (expectTradeObj.length>0)
	{
		arguments.IsValid=true;
	}
	else
	{
		arguments.IsValid=false;
	}
} 
function ExpectWorkKindClientValidate(source,arguments)
{    
	for(var i=0;i<4;i++)
	{
		if(workKindObjs[i]!=null && workKindObjs[i].checked) 
		{
			arguments.IsValid=true;
			return;
		}
	}
	arguments.IsValid=false;
}
//显示错误信息<div>
function ShowValidMessage()
{
    if(!Page_IsValid)
    {
        document.all['ValidMsg'].style.display="block";
        return false;
    }
    MyAddSubmit();
    
    if(isSubmit)
        return false ;
    
    isSubmit = true ;
    
    return true;
    
}

function MyAddSubmit()//if(typeof(document.all['NextStep1'])=="object") document.all['NextStep1'].onclick=function()
{
	if(expectCityObj != null)    
	selectAll(expectCityObj);
	if(expectCareerObj !=null)
	selectAllOccupations(expectCareerObj);
	if(expectTradeObj != null)
	selectAll(expectTradeObj);  
	return true;
}
        
function InitSet()
{

        initParentList(document.all['ResidenceState']);

        changeChildList(document.all['ResidenceState'],document.all['ResidenceCity']);     
        //初始化联系信息
        ChangeContactType() ;
} 
function InitSet11()
{      
        initParentList(document.all['ResidenceState']);
        initParentList(document.all['HuKouState']);
        changeChildList(document.all['ResidenceState'],document.all['ResidenceCity']);       
        //初始化联系信息
        ChangeContactType() ;

} 

function InitSet22()
{
        //初始化联系信息
        ChangeContactType() ;		
} 
function InitSet33()
{
        initParentList(document.all['ResidenceState']);

        changeChildList(document.all['ResidenceState'],document.all['ResidenceCity']);
        
        //初始化联系信息
        ChangeContactType() ;
} 


 function InitSea()
{
	    ChangeIDType();        
        
        initParentList(document.all['ResidenceState']);

        changeChildList(document.all['ResidenceState'],document.all['ResidenceCity']);
        
        //初始化联系信息
        ChangeContactType() ;


		
}        
function InitSeb()
{

        
        initParentList(document.all['ResidenceState']);

        changeChildList(document.all['ResidenceState'],document.all['ResidenceCity']);
        
        //初始化联系信息
        ChangeContactType() ;


		
} 
        
