

function CheckForFreelanceLimit(fBasketValue, fFreelanceLimit, sDiv){
    if (fBasketValue > fFreelanceLimit){
        $("#"+sDiv).show();
    }
}
    
function setDefDelCountry(){
	$("#del_country_select option[value='a7c40f631fc920687.20179984']").attr('selected',true);
}
$(document).ready(function(){
    checkUstId();

    $('#Land').change(function(){
       checkUstId();
    });
	
	if ( $('#Anrede option:selected').val() == 'Company' ) {
		$('#SrIsCompany').val(1);
	} else {
		$('#SrIsCompany').val(0);
	}
	if ( $('#Anrede option:selected').val() != 'Company'  ) {
		$('#Company').val('');
	}
    
    var company = '';
    var ustid = '';
    $('#Anrede').change(function() {
        if ( $('#Land option:selected').val() == 'a7c40f631fc920687.20179984' ) {
            $('#ustid').val('');
            ustid = '';
        }
        if ( $(this).val() == 'Company' ) {
            $("#srindustry option[value='0']").attr('selected',true);
            $('#SrIsCompany').val(1);
            $('#Company').val(company);
            $('#ustid').val(ustid);
            $('.companyFieldset').show();
        } else {
            $('.companyFieldset').hide();
            $('#SrIsCompany').val(0);
            company = $('#Company').val();
            ustid = $('#ustid').val();
            $('#Company').val('');
            $('#ustid').val('');
            $("#srindustry option[value='1']").attr('selected',true);
        }
    });

    var companyDel = '';
    $('#AnredeDel').change(function() {
        if ( $(this).val() == 'Company' ) {
            $('#CompanyDel').val(companyDel);
            $('.companyFieldDel').show();
        } else {
            $('.companyFieldDel').hide();
            companyDel = $('#CompanyDel').val();
            $('#CompanyDel').val('');
        }
    });
});
        
            
function checkUstId() {
    if ( $('#Land option:selected').val() != 'a7c40f631fc920687.20179984' ) {
        $('#ustidfield').show();
    } else {
        $('#ustid').val('');
        ustid = '';
        $('#ustidfield').hide();
    }
}

	
