function addMarsh() {
 nd=document.createElement('div');
 nd.innerHTML="<br><input type='text' value='страна (регион)' style='width:205px; margin-bottom:4px;' name='m_con[]' onClick=Cl(this,'mars') onBlur=Ch(this,'mars') class='tex'><input type='text' value='%' style='width:44px' name='m_per[]' class='per tex' onClick=Cl(this,'per')  onBlur=Ch(this,'per')>";
 document.getElementById('marshrut').appendChild(nd);
}

function addAuto() {
 nd=document.createElement('div');
 nd.innerHTML="<br><input type='text' value='марка (модель)' style='width:205px; margin-bottom:4px;' name='с_mar[]' onClick=Cl(this,'auto')  onBlur=Ch(this,'auto') class='tex'><input type='text' value='количество' style='width:80px' name='c_cou[]' class='cou tex' onClick=Cl(this,'coun')  onBlur=Ch(this,'coun')>";
 document.getElementById('autocount').appendChild(nd);
}

function Cl(el,type){
 if (type=='auto') text="марка (модель)";
 if (type=='coun') text="количество";
 if (type=='mars') text="страна (регион)";
 if (type=='per') text="%";
 if (type=='oth') text="иное";
 if (el.value==text) {
 	el.value="";
    el.className=el.className.replace(/tex/,'');
 }
}

function Ch(el,type){
 if (type=='auto') text="марка (модель)";
 if (type=='coun') text="количество";
 if (type=='mars') text="страна (регион)";
 if (type=='per') text="%";
 if (type=='oth') text="иное";
 if (!el.value.length) {
 	el.value=text;
    el.className+=" tex";
 }
}
