<!--
var ext=0;var photoc=1;function fulltime(){var time=new Date();document.clock.date.value=time.toLocaleString();setTimeout('fulltime()',500)}
function mark_select(mark){if(mark!='0'){document.location=mark;}}
function c_model_o(model_id,name_year){year='1990';yearArray=yearArrayStr.split('/');yearOpt=document.all.item(name_year);yearOpt.length=0;i=0;while(i<yearArray.length){oneModel=yearArray[i].split(':');if(oneModel[0]==model_id){yearPair=oneModel[1].split(';');for(j=0;j<yearPair.length;j++){var yearList=yearPair[j].split(',');if(yearList[0]){yearOpt[yearOpt.length]=new Option(yearList[1],yearList[0],false,false);if(year==yearList[0]){yearOpt[yearOpt.length-1].selected=true;yearOpt[yearOpt.length-1].defaultSelected=true;}}}
i=yearArray.length;}
i++;}}
function go2step2(task,part){var reg=1;if(Test(document.all.item('f_cnt_name'))){alert('Поле "Имя" не может быть пустым.');reg=0;}
else if(Test(document.all.item('f_cnt_town'))){alert('Поле "Местонахождение" не может быть пустым.');reg=0;}
else if(Test(document.all.item('f_cnt_phone'))&&Test(document.all.item('f_cnt_email'))){alert('Вы должны указать либо свой адрес электронной почты, либо номер телефона.');reg=0;}
if(reg){document.forms.astep1.action="?code=tools&mode=add"+part+task;document.forms.astep1.submit();}}
function c_task(task_id,name_part){partArray=partArrayStr.split('/');partOpt=document.all.item(name_part);partOpt.length=0;i=0;while(i<partArray.length){oneTask=partArray[i].split(':');if(oneTask[0]==task_id){partPair=oneTask[1].split(';');for(j=0;j<partPair.length;j++){var partList=partPair[j].split(',');if(partList[0]){partOpt[partOpt.length]=new Option(partList[1],partList[0],false,false);}}
i=partArray.length;}
i++;}}
function c_firm(firm_id,name_mark,place){if(firm_id!='0'){mark='';markArray=eval("markArrayStr"+place+".split('/')");markOpt=eval("document."+place+"cat."+name_mark);eval("document."+place+"cat.mode.value='"+place+"catfirm'");markOpt.length=0;i=0;while(i<markArray.length){oneFirm=markArray[i].split(':');if(oneFirm[0]==firm_id){markPair=oneFirm[1].split(';');for(j=0;j<markPair.length;j++){var markList=markPair[j].split(',');if(markList[0]){if(j==0){markOpt[0]=new Option('Модель','0',false,false);}
markOpt[markOpt.length]=new Option(markList[1],markList[0],false,false);if(mark==markList[0]){markOpt[markOpt.length-1].selected=true;markOpt[markOpt.length-1].defaultSelected=true;}}}
i=markArray.length;}
i++;}
markOpt.disabled=false;eval("document."+place+"cat.subm.disabled=false");}
if(firm_id=='0'){eval("document."+place+"cat.mode.value='catalogs'");markOpt=eval("document."+place+"cat."+name_mark);markOpt.length=0;markOpt[0]=new Option('Марка','0',false,false);markOpt.disabled=true;eval("document."+place+"cat.subm.disabled=true");c_model(0,'year',place,'');}}
function c_model(prev_id,name,form,place){if(prev_id!='0'){placeArray=eval(name+"ArrayStr"+form+".split('/')");placeOpt=eval("document."+form+"cat."+name);eval("document."+form+"cat.mode.value='"+form+"catview'");placeOpt.length=0;i=0;while(i<placeArray.length){onePrev=placeArray[i].split(':');if(onePrev[0]==prev_id){placePair=onePrev[1].split(';');for(j=0;j<placePair.length;j++){var placeList=placePair[j].split(',');if(placeList[0]){placeOpt[placeOpt.length]=new Option(placeList[1],placeList[0],false,false);if(place==placeList[0]){placeOpt[placeOpt.length-1].selected=true;placeOpt[placeOpt.length-1].defaultSelected=true;}}}
i=placeArray.length;}
i++;}
placeOpt.disabled=false;}
if(prev_id=='0'){eval("document."+form+"cat.mode.value='"+form+"catfirm'");placeOpt=eval("document."+form+"cat."+name);placeOpt.length=0;placeOpt[0]=new Option('Год выпуска','0',false,false);placeOpt.disabled=true;}}
function SetPlaceN(){var place;men=document.all.item('sel_town');men.style.display='none';men=document.all.item('sel_region');men.style.display='none';if(document.all.item('set_place').checked){place='sel_region';}else{place='sel_town';}
men=document.all.item(place)
men.style.display='block';men=document.all.item('type_place');men.value=place;}
function ShowExt(){if(!ext){ShowDiv('extpar');ext=1;document.images.extarr.src='images/img/arrow-up.gif';}
else{CloseDiv('extpar');ext=0;document.images.extarr.src='images/img/arrow-down.gif';}}
function AddExtraPhotoFieldN(photo_table)
{var pictable;if(photoc<6){if(pictable=document.getElementById(photo_table)){newrow=pictable.insertRow();var rowcount=pictable.rows.length;newcell=newrow.insertCell();newcell.innerHTML='<input type="file" size="6" value="" name="f_photo[]" class="f100">';}
photoc++;}}
function trim(s){while(s.substring(0,1)==' '){s=s.substring(1,s.length);}
while(s.substring(s.length-1,s.length)==' '){s=s.substring(0,s.length-1);}
return s;}
function ch_enter(data){var s;s=data;ent=String.fromCharCode(10);ret=String.fromCharCode(13);spc=' ';while(s.substring(0,1)==ent||s.substring(0,1)==ret||s.substring(0,1)==spc){s=s.substring(1,s.length);}
return s;}
function Test(field){var test,act=0,have=0;if(field.length){for(i=0;i<field.length;i++){test=ch_enter(field[i].value).length;if(test!=0){have=1;}
field[i].value=trim(field[i].value);}
if(have==0){act=1;}}
else{test=ch_enter(field.value).length;if(test==0){act=1;}
field.value=trim(field.value);}
return act;}
function AddSlang(){var reg=1;if(Test(document.all.item('name'))){alert('Поле "Имя" не может быть пустым.');reg=0;}
else if(Test(document.all.item('word'))){alert('Поле "Сленговое выражение" не может быть пустым.');reg=0;}
else if(Test(document.all.item('reply'))){alert('Поле "Лексическое значение" не может быть пустым.');reg=0;}
if(reg){document.slang.submit();}}
function onSubFormAddAutoN()
{var check,str_error;reg=1;str_error='';if(men=document.all.item('f_cont_name_main')){if(document.forms['add'].f_cont_name_main.value==''){reg=0;str_error+='Вы не указали главный контакт.';}};if((document.forms['add'].f_volume.value<100)||(document.forms['add'].f_volume.value>20000)||(document.forms['add'].f_volume.value=='')){reg=0;str_error+='\nОбъем должен быть от 100 и до 20 000.';}
if((document.forms['add'].f_price.value==0)||(document.forms['add'].f_price.value<-2)||(document.forms['add'].f_price.value=='')){reg=0;str_error+='\nНеправильно указана цена.';}
var temp_str;if(men=document.all.item('f_cont_email')){temp_str=IsValidEmail(document.forms['add'].f_cont_email.value,0);if(temp_str!=1){reg=0;str_error+=temp_str;}}
if(Test(document.all.item('f_type_auto'))){alert('Поле "Тип автомобиля" не может быть пустым.');reg=0;}
else if(Test(document.all.item('f_firm'))){alert('Поле "Производитель" не может быть пустым.');reg=0;}
else if(Test(document.all.item('f_mark'))){alert('Поле "Марка автомобиля" не может быть пустым.');reg=0;}
if(reg)
{document.forms['add'].submit();}else
{alert(str_error);}}
function MyMailToFriendAYear(ask,result){men=document.all.item('mail-body');men.value='Результат определения года выпуска\nЗапрос:\n'+ask+'\n\nРезультат:\n'+result;ShowDiv('mail',true);}
-->