function gOb(id){return document.getElementById(id);}

//address scripts
function address_formcheck(form, check_pwd, lang){
	if(lang == "de"){
		var str_salutation = "Anrede";
		var str_firstname = "Vorname";
		var str_surname = "Nachname";
		var str_address = "Strasse";
		var str_zip = "PLZ";
		var str_place = "Ort";
		var str_country = "Land";
		var str_phone = "Telefon";
		var str_password = "Passwort";
		var str_password_repeat = "Password Wiederholung";
	}else if(lang == "en"){
		var str_salutation = "Salutation";
		var str_firstname = "Firstname";
		var str_surname = "Surname";
		var str_address = "Address";
		var str_zip = "Postcode";
		var str_place = "City";
		var str_country = "Country";
		var str_phone = "Telephone";
		var str_password = "Password";
		var str_password_repeat = "Password repeat";
		nex_check_texts.msg_pre = 'Please fill in the following fields:\n\n';
	}
	
  	var achievement_taker = true;
  	var pwd_str = check_pwd ? ',password:'+str_password+':min=5,password_repeat:'+str_password_repeat+':equal=password' : '';
  	var billing = nex_check_form(form, 'salutation:'+str_salutation+',firstname:'+str_firstname+',surname:'+str_surname+',address:'+str_address+',zip:'+str_zip+',place:'+str_place+',country:'+str_country+',email:E-Mail:email,phone:'+str_phone+''+pwd_str, false);
  	var use_billing = nex_get_value(form.elements.use_billing_address);
	
  	if (billing && !use_billing){
    	achievement_taker = nex_check_form(form, 'd_salutation:'+str_salutation+',d_firstname:'+str_firstname+',d_surname:'+str_surname+',d_address:'+str_address+',d_zip:'+str_zip+',d_place:'+str_place+',country:'+str_country+',d_email:E-Mail:email,d_phone:'+str_phone+'', false);
  		return (billing && achievement_taker);
	}else{
		return billing;
	}
}

function disable_achievement_taker_address(d){
	nex_set_disabled(d,'d_salutation','d_title','d_firstname','d_surname','d_company','d_address'
	,'d_address_nr','d_zip','d_place','d_country','d_email','d_phone','d_fax','d_mobile','d_website');
}

function toggle_achievement_taker_address(id, hide){
	var obj = gOb(id);
  	if (obj){
    	var disp = obj.style.display;
    	if (disp=="none" && !hide){
      		obj.style.display = "block";
		}else if (hide){
      		obj.style.display = "none";
		}
    }
}




function check_agb_status(id,lang){
	
		var checkbox = document.getElementById("confirm_agb");
		var checkbox_status = document.getElementById("id_checkbox_status");
		
		if(lang=="de"){
			var msg_wait = "Bitte warten...";
			var msg_confirm = "Bitte bestätigen Sie, dass Sie die Allgemeinen Geschäftsbedingungen gelesen und sich damit einverstanden erklärt haben.";
		}else if(lang=="en"){
			var msg_wait = "Please Wait...";
			var msg_confirm = "please confirm that you have read and accepted the terms and conditions.";
		}
		
		var status = checkbox.checked;
		if(status){
			checkbox_status.value = "on";
			checkbox.disabled = "disabled";
			id.value = msg_wait;
			id.disabled="disabled";
			document.getElementById('billing_wait_box').style.display='block';
			id.form.submit();
		}else{
			alert(msg_confirm);
		}
}


function switch_button_login(id,lang){
	if(lang=="de"){
		var msg_wait = "Bitte warten...";
	}else if(lang=="en"){
		var msg_wait = "Please Wait...";
	}
	document.loginform.submit_login.value = msg_wait;
	document.loginform.submit_login.disabled="disabled";
	id.form.submit();
}



function show_cv_info(status){
	if(status=='show'){
		document.getElementById('cvInfo').style.display='block';
	}else{
		document.getElementById('cvInfo').style.display='none';
	}
}