function rechne_p_kuend_date()
{
var inhalt = document.order.p_kuend_date_text.value.split(".");
if (inhalt[2].length<4)
{
inhalt[2]="20"+inhalt[2];
}
document.order.p_kuend_date.value=inhalt[2]+"-"+inhalt[1]+"-"+inhalt[0];
}
function zeige_kontoinh()
{
/*document.order.kontoinh.value=document.order.name2.value+" "+document.order.name1.value;*/
document.order.kontoinh.value=document.order.vorname.value.replace(/(^\s+|\s+$)/g,'')+" "+document.order.nachname.value.replace(/(^\s+|\s+$)/g,'');
document.order.kontoinh_dummy.value=document.order.vorname.value.replace(/(^\s+|\s+$)/g,'')+" "+document.order.nachname.value.replace(/(^\s+|\s+$)/g,'');
}
function uebernehme_vertragsdaten()
{
document.order.b_strasse.value=document.order.strasse.value.replace(/(^\s+|\s+$)/g,'');
document.order.b_haus_nr.value=document.order.haus_nr.value.replace(/(^\s+|\s+$)/g,'');
document.order.b_plz.value=document.order.plz.value.replace(/(^\s+|\s+$)/g,'');
document.order.b_ort.value=document.order.ort.value.replace(/(^\s+|\s+$)/g,'');
}
function zeige_mnp()
{
if (document.getElementById('mnp').checked)
{
document.getElementById('mnp_block').style.display='block';
document.getElementById('tr_aktivierungstermin').style.display='none';
document.getElementById('terminwunsch1').checked='true';
}
else
{
document.getElementById('mnp_block').style.display='none';
document.getElementById('tr_aktivierungstermin').style.display='';
document.getElementById('p_msisdn').value='';
document.getElementById('p_provider').value='';
document.getElementById('p_betreiber').value='';
document.getElementById('p_kundennr').value='';
document.getElementById('mnptag').value='-1';
document.getElementById('mnpmonat').value='-1';
document.getElementById('mnpjahr').value='-1';
}
}
function zeige_mnp_sd()
{
if (document.getElementById('mnp').checked)
{
document.getElementById('mnp_block').style.display='block';
$('#anzahlsimkarten').find('option').remove();
$('#anzahlsimkarten').append('');
$('#anzahlsimkarten').val('1').change();
}
else
{
document.getElementById('mnp_block').style.display='none';
document.getElementById('p_msisdn').value='';
document.getElementById('p_provider').value='';
$('#anzahlsimkarten').find('option').remove();
$('#anzahlsimkarten').append('');
$('#anzahlsimkarten').append('');
$('#anzahlsimkarten').val('1').change();
}
}
function zeige_mnp_anderer_inhaber()
{
if (document.getElementById('mnp_kd_differ').checked)
{
document.getElementById('mnp_inhaber').style.display='block';
}
else
{
document.getElementById('mnp_inhaber').style.display='none';
document.getElementById('p_anrede').value='';
document.getElementById('p_name2').value='';
document.getElementById('p_name1').value='';
document.getElementById('mnp_geburtstag').value='-1';
document.getElementById('mnp_geburtsmonat').value='-1';
document.getElementById('mnp_geburtsjahr').value='-1';
}
}
function zeige_mnp_nicht_gekuendigt()
{
if (document.getElementById('p_kuend_status').checked)
{
document.getElementById('mnp_nicht_gekuendigt').style.display='block';
document.getElementById('ASAP').checked='true';
document.getElementById('VTEN').disabled=true;
document.getElementById('ASAP').disabled=true;
document.getElementById('mnptag').value='-1';
document.getElementById('mnpmonat').value='-1';
document.getElementById('mnpjahr').value='-1';
document.getElementById('mnptag').disabled=true;
document.getElementById('mnpmonat').disabled=true;
document.getElementById('mnpjahr').disabled=true;
}
else
{
document.getElementById('mnp_nicht_gekuendigt').style.display='none';
document.getElementById('VTEN').disabled=false;
document.getElementById('ASAP').disabled=false;
document.getElementById('mnptag').disabled=false;
document.getElementById('mnpmonat').disabled=false;
document.getElementById('mnpjahr').disabled=false;
}
}
function zeige_vertragsart(ele1,ele2)
{
document.getElementById(ele1).style.display='block';
document.getElementById(ele2).style.display='none';
}
function setOp(wert)
{
if (wert.indexOf("D")>-1)
{
for (i = 0; i < document.order.nationality.length; i++)
if (document.order.nationality.options[i].defaultSelected == true)
document.order.nationality.options[i].selected = true;
}
else
{
document.order.nationality.selectedIndex = wert;
}
}
function reset_wunschdatum()
{
document.getElementById('terminhinweis').style.display='none';
document.getElementById('terminwarnung').style.display='none';
}
function set_handyfarbe(ziel,neufarbe)
{
var handytext = document.getElementById('handy').value;
if (!neufarbe)
{
var regex = new RegExp(ziel+" \\(Typ:([^\\)]*)\\)");
document.getElementById('handy').value=handytext.replace(regex, ziel);
}
else if (handytext.indexOf(ziel+" (Typ:") != -1)
{
var regex = new RegExp(ziel+" \\(Typ:([^\\)]*)\\)");
document.getElementById('handy').value=handytext.replace(regex, ziel+" (Typ:"+neufarbe+")");
}
else
{
var regex = ziel;
document.getElementById('handy').value=handytext.replace(regex, ziel+" (Typ:"+neufarbe+")");
}
}
function set_handyoption(neuoption)
{
var handytext = document.getElementById('handy').value;
if (handytext.indexOf(neuoption) != -1)
{
document.getElementById('handy').value=handytext.replace(" +"+neuoption, "");
}
else
{
document.getElementById('handy').value=handytext+" +"+neuoption;
}
}
function set_simformat(simformat,show_simstanzhinweis)
{
var handytext = document.getElementById('handy').value;
var regex = new RegExp(" \\(Sim:.+\\)");
if (!simformat)
{
document.getElementById('handy').value=handytext.replace(regex, "");
}
else if (handytext.indexOf("Sim:") != -1)
{
document.getElementById('handy').value=handytext.replace(regex, " (Sim:"+simformat+")");
}
else
{
document.getElementById('handy').value=handytext+" (Sim:"+simformat+")";
}
if (show_simstanzhinweis.indexOf("1")>-1)
{
document.getElementById('simstanzhinweis').style.display='block';
}
else
{
document.getElementById('simstanzhinweis').style.display='none';
}
}
function show_firma(anredeinhalt)
{
if (anredeinhalt.indexOf("SD")>-1) /*SD Firma*/
{
document.getElementById('vorname_p').style.display='none';
document.getElementById('vorname_c').style.display='block';
document.getElementById('nachname_p').style.display='none';
document.getElementById('nachname_c').style.display='block';
document.getElementById('firma_tr_3').style.display='';
document.getElementById('geburtsdatum_p').style.display='none';
document.getElementById('geburtsdatum_c').style.display='block';
}
else
{
document.getElementById('vorname_c').style.display='none';
document.getElementById('vorname_p').style.display='block';
document.getElementById('nachname_c').style.display='none';
document.getElementById('nachname_p').style.display='block';
document.getElementById('firma_tr_3').style.display='none';
document.getElementById('geburtsdatum_p').style.display='block';
document.getElementById('geburtsdatum_c').style.display='none';
}
}