function en_obj(id) {
	var obj = document.getElementById(id);
	obj.disabled = false;	
}
function di_obj(id) {
	var obj = document.getElementById(id);
	obj.disabled = true;
}
function req_obj(id,v) {	
	var obj = document.getElementById(id);
	if(document.all) {// ie
		if(obj) {
			obj.required = v;
		} else {
			alert(id)	
		}
	} else {// dom
		if(obj) {
			obj.setAttribute("required",v);
		} else {
			alert(id);	
		}
	}
}
function switch_obj(id,v,val,temp) {
	var obj = document.getElementById(id);//alert(val);	
	obj.disabled = v;
	if(val >2 ) {
		obj.value = -1;
		
	} else if(val <=2 ){
		obj.value = temp;//alert(temp);	
		selected="selected";
	}

}
function show_obj(id,v) {
	var obj = document.getElementById(id);
	if(v) {
		obj.style.display = "";	
	} else {
		obj.style.display = "none";
	}
}

function switch_obj2(me) {
me.value=-1;
}

function switch_obj_experience(me) {
	if(me.value>0) {
		for(i=1;i<=6;i++) {
			show_obj('company_1_'+i,true);	
		}
		req_obj('rm_company_1',1);
		req_obj('rm_company_job_1',1);
		req_obj('rm_company_start_1_Year',1);
		req_obj('rm_company_start_1_Month',1);
		req_obj('rm_company_salary_1',1);
	} else {
		for(j=1;j<=3;j++) {
			for(i=1;i<=6;i++) {
				show_obj('company_1_'+i,false);	
			}
		}
		req_obj('rm_company_1',0);
		req_obj('rm_company_job_1',0);
		req_obj('rm_company_start_1_Year',0);
		req_obj('rm_company_start_1_Month',0);
		req_obj('rm_company_salary_1',0);
	}
}

function textarea_size(id,height,min,max) {
	var obj = document.getElementById(id);
	
	if(document.all) {
		if(height>0 && obj.style.posHeight < max ) obj.style.posHeight+=height;			
		if(height<0 && obj.style.posHeight > min ) obj.style.posHeight+=height;			
	} else {
		//alert(parseInt(obj.style.height));
		if(height>0 && parseInt(obj.style.height) < max ) obj.style.height=parseInt(obj.style.height)+height;
		if(height<0 && parseInt(obj.style.height) > min ) obj.style.height=parseInt(obj.style.height)+height;
	}
	
}
