<!--

function openLnk(lnk) {
	browser ='ie';
	x =parent.screenTop;
	y =parent.screenLeft;

	if(typeof x =='undefined') {x =parent.screenX; browser="ns";}
	if(typeof y =='undefined') {y =parent.screenY};
	if(browser=='ie') infoWindow =window.open(lnk, '', '');
	if(browser=='ns') infoWindow =window.open(lnk, '', '');
}

function ShowPass(div)
{
	ShowDiv(div);
	centerDiv(div,'passwordID');
}
function ShowDiv(wname) {
	if(man=document.getElementById(wname)){
		man.style.display ="block";
	}
	//document.getElementById(wname).style.display ="block";
}
function CloseDiv(wname) {
	if(man=document.getElementById(wname)){
		man.style.display ="none";
	}
	//document.getElementById(wname).style.display ="none";
}
function centerDiv(SWName,point) {
	elm =document.getElementById(point);
	h =elm.offsetHeight;
	w =elm.offsetWidth;
	t =0;
	while(elm.parentNode) {
		if(elm.nodeName !='TD') t +=elm.offsetTop;
		elm =elm.parentNode;
	}
	elm =document.getElementById(SWName);
	h =Math.ceil((h -elm.offsetHeight));
	w =Math.ceil((w -elm.offsetWidth));
	elm.style.top  =h +t;
	elm.style.left =w;
}
function centerDiv02(SWName){
	var x = document.body.scrollLeft;
	var y = document.body.scrollTop;
	var x2=(window.innerWidth)?window.innerWidth: ((document.all)?document.body.offsetWidth:null);
	var y2=(window.innerHeight)?window.innerHeight: ((document.all)?document.body.offsetHeight:null);
	x=x+x2-(x2/2);
	y=y+y2-(y2/2);
	elm =document.getElementById(SWName);
	x =Math.ceil((x -elm.offsetWidth/2));
	y =Math.ceil((y -elm.offsetHeight/2));
	elm.style.left =x;
	elm.style.top =y;
}


 function SetPlace(name_of_point){
	men=document.all.item('sel_town');
	men.style.display='none';
	men=document.all.item('sel_region');
	men.style.display='none';
  	men=document.all.item(name_of_point);
	men.style.display='inline';

	men=document.all.item('type_place');
	men.value=name_of_point;

 }
function InitSaler()
{
	men=document.all.item('sel_one');
	men.style.display='none';
	men=document.all.item('sel_list');
	men.style.display='none';
	men=document.all.item(sel_point_saler);
	men.style.display='inline';
}
 function SetSaler(name_of_point){
	men=document.all.item('sel_one');
	men.style.display='none';
	men=document.all.item('sel_list');
	men.style.display='none';
  	men=document.all.item(name_of_point);
	men.style.display='inline';

	men=document.all.item('type_saler');
	men.value=name_of_point;

 }

 function SetTyreWheel(){
	if(tyrewheel_point==1){
		men=document.all.item('tyre');
		men.style.display='inline';
		men=document.all.item('wheel');
		men.style.display='none';
	}
	if(tyrewheel_point==2){
		men=document.all.item('tyre');
		men.style.display='none';
		men=document.all.item('wheel');
		men.style.display='inline';
	}
  	
  	/*men=document.all.item(name_of_point);
	men.style.display='inline';

	men=document.all.item('type_place');
	men.value=name_of_point;*/

 }

function InitPlace()
{
	men=document.all.item('sel_town');
	men.style.display='none';
	men=document.all.item('sel_region');
	men.style.display='none';
	if(sel_point=='') sel_point='sel_town';
	men=document.all.item(sel_point);
//	men.style.display='inline';
	men.style.display='block';
}
function ChangeValue(name_val,name_div)
{
	if(men=document.all.item(name_val)){
		if(men.value.length==0||men.value==0){
			ShowDiv(name_div);
		}else{
			HideDiv(name_div);
		}
	}
}
function ChangeFirm(name_frim,name_mark,def)
{
	
	if(men=document.all.item('div_mark_text')){
		men.style.display='none';
	}
	if(men=document.all.item('div_mark_combo')){
		men.style.display='none';
	}
	
	firm_id =document.all.item(name_frim);
	
	firm_id=firm_id.value;
	//alert(firm_id);
	if (firm_id != '0'){
		if(men=document.all.item('div_mark_combo')){
			men.style.display='inline';
		}
		if(men=document.all.item('div_mark_tuning')){
			men.style.display='inline';
		}
		selected = false;
	}else {
		if(men=document.all.item('div_mark_text')){
			men.style.display='inline';
		}
		if(men=document.all.item('div_mark_tuning')){
			men.style.display='none';
		}
		selected = true;
		return;
	}
	markOpt =document.all.item(name_mark);
	markOpt.length = 0;
	if(def==1){
		markOpt[markOpt.length] = new Option('<не имеет значения>', '0', false, false);
		markOpt[markOpt.length-1].selected = selected;
		markOpt[markOpt.length-1].defaultSelected = selected;
	}
	
	markArray = markArrayStr.split('/');
	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]){
					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++;
	}
}

function HideDiv(a)
{
	if(men=document.all.item(a)){
		men.style.display='none';
	}
}
function IsValidEmail (data,need)
{
	var str='';
	var check=1;
	data += "";
	if( data.length == 0 && need==1) {
		str="\nВы не указали e-mail";
		check=0;
		check=str;
		return check;
	}
	var comAt = "@";
	if(( data.length>0)&&(data.indexOf(comAt, 0) == -1) ) {
		str="\nНе правильный e-mail";
		check=0;
		check=str;
		return check;
	}
	var Point = ".";
	if(( data.length>0)&&( data.indexOf(Point, 0) == -1) ) {
		str="\nНе правильный e-mail";
		check=0;
		check=str;
		return check;
	}
	if((data.length<5)&&((data.length>0))) {
		str="\nНе правильный e-mail";
		check=0;
		check=str;
		return check;
	}
	if(check==0){
		check=str;
	}
	return check;
}

function openMyWindow(href,width,height) {
	browser ='ie';
	y =parent.screenTop;
	x =parent.screenLeft;
	if(typeof x =='undefined') {x =parent.screenX; browser="ns";}
	if(typeof y =='undefined') {y =parent.screenY};
	leftt =50;
	topp =200;
	if(width>0 && height > 0){
		dim='width=' + width + ',height=' + height + ',';
	}else{dim='width=795,height=450,';leftt=10;topp=10;}

	if(browser=='ie') infoWindow =window.open(href, '', dim + 'left=' + leftt + ',top=' + topp + ',scrollbars,dependent=yes,resizable=yes,status=yes');
	if(browser=='ns') infoWindow =window.open(href, '', dim + 'left=' + leftt + ',top=' + topp + ',scrollbars,dependent=yes,resizable=yes,status=yes');
	//if(browser=='ie') infoWindow =window.open(href, 'infoWindow', 'width=' + width + ',height=' + height + ',left=' + leftt + ',top=' + topp + ',scrollbars');
	//if(browser=='ns') infoWindow =window.open(href, 'infoWindow', 'width=' + width + ',height=' + height + ',left=' + leftt + ',top=' + topp + ',scrollbars');
}
function MyMail(mail){
	men=document.all.item('mail-to');
	men.value=mail;
	ShowDiv('mail',true);
	centerDiv02('mail');
}
function MyMailToFriend(link){
	men=document.all.item('mail-body');
	men.value='По мнению отправителя, Вас должна заинтересовать следущая ссылка:\n'+link;
	ShowDiv('mail',true);
	centerDiv02('mail');
}

function loadPlace() {
	place =document.search.f_town.options;
	place.length =0;
	if(saler_id==0){
		place[place.length] =new Option('<не имеет значения>', 0, false, false);
	}

	for(i=0;i <placeArray.length; i++) {
		placeRec=placeArray[i].split(':');
		if(placeRec[3] >0)
		caption=placeRec[2] +' (' +placeRec[3] +')';
		else
		caption=placeRec[2];
		
		place[place.length] =new Option(caption, placeRec[1], false, false);
		if(placeRec[1] ==selectedPlaceId) {
			place[place.length -1].defaultSelected =true;
			place[place.length -1].selected =true;
		}
	}
}
function loadSalerCombo(placeId) {
	saler =document.search.f_saler_one.options;
	saler.length=0;
	if(saler_id==0){
		saler[saler.length] =new Option('<не имеет значения>', 0, false, false);
		if(viewMode =='contract') {
			saler[saler.length] =new Option('частные лица, барахолка', -1, false, false);
		}
	}
	
	
	for(i=0; i<salerArray.length; i++) {
		salerRec =salerArray[i].split(':');
		//alert(salerRec);
		if(salerRec[3] ==placeId || placeId ==0) {
			if(salerRec[4] >0) {
			saler[saler.length] =new Option((i+1) +'. ' +salerRec[2], salerRec[1], false, false);
			} else {
			saler[saler.length] =new Option((i+1) +'. ' +salerRec[2], salerRec[1], false, false);
			}
			if(salerRec[1] ==selectedSalerId) {
				saler[saler.length -1].selected =true;
				saler[saler.length -1].defaultSelected =true;
			}
		}
	}
}
function selectPlace(salerId) {
	placeId = -1;
	selectedSalerId =salerId;
	if (selectedSalerId == -2) placeId = 0;
	else {
		for(i=0; i<salerArray.length; i++) {
			salerRec =salerArray[i].split(':');
			if(salerRec[1] ==salerId) {
				placeId =salerRec[3];
			}
		}
	}
	if(placeId > -1) {
		place =document.search.f_town.options;
		for(i=0; i<place.length; i++) {
			if(place[i].value ==placeId) {
				place[i].selected =true;
			}
		}
	}
}
function InitProfiPotter(th){
	if(men=document.all.item('h1_profi')) men.style.display='none';
	if(men=document.all.item('h1_potter')) men.style.display='none';
	if(men=document.all.item('button_profi')) men.style.display='none';
	if(men=document.all.item('button_potter')) men.style.display='none';
	if(men=document.all.item('parts_name01_profi')) men.style.display='none';
	if(men=document.all.item('parts_name01_potter')) men.style.display='none';
	if(men=document.all.item('parts_name01v_profi')) men.style.display='none';
	if(men=document.all.item('parts_name01v_potter')) men.style.display='none';
	if(men=document.all.item('parts_name02_profi')) men.style.display='none';
	if(men=document.all.item('parts_name02_potter')) men.style.display='none';
	if(men=document.all.item('parts_name02v_profi')) men.style.display='none';
	if(men=document.all.item('parts_name02v_potter')) men.style.display='none';
	if(men=document.all.item('marka_profi')) men.style.display='none';
	if(men=document.all.item('marka_potter')) men.style.display='none';
	if(men=document.all.item('model_profi')) men.style.display='none';
	if(men=document.all.item('model_potter')) men.style.display='none';

	if(th=='profi'){
		if(men=document.all.item('h1_profi')) men.style.display='inline';
		if(men=document.all.item('button_profi')) men.style.display='inline';
		if(men=document.all.item('parts_name01_profi')) men.style.display='inline';
		if(men=document.all.item('parts_name01v_profi')) men.style.display='inline';
		if(men=document.all.item('parts_name02_profi')) men.style.display='inline';
		if(men=document.all.item('parts_name02v_profi')) men.style.display='inline';
		if(men=document.all.item('marka_profi')) men.style.display='inline';
		if(men=document.all.item('model_profi')) men.style.display='inline';
	}else{
		if(men=document.all.item('h1_potter')) men.style.display='inline';
		if(men=document.all.item('button_potter')) men.style.display='inline';
		if(men=document.all.item('parts_name01_potter')) men.style.display='inline';
		if(men=document.all.item('parts_name01v_potter')) men.style.display='inline';
		if(men=document.all.item('parts_name02_potter')) men.style.display='inline';
		if(men=document.all.item('parts_name02v_potter')) men.style.display='inline';
		if(men=document.all.item('marka_potter')) men.style.display='inline';
		if(men=document.all.item('model_potter')) men.style.display='inline';
	}
	profi_potter=th;
	men=document.all.item('type_profipotter');
	men.value=profi_potter;
}

  function loadGroup() {

    //group =document.search.partGroup.options;
    men=document.all.item('partGroup');
    group =men.options;

    group.length =0;
    if(add_form==1){
    	group[group.length] =new Option('<выбрать>', 0, false, false);
	}else{
		group[group.length] =new Option('<не имеет значения>', 0, false, false);
	}


    groupArray=groupStr.split(';');
    for(i=0;i <groupArray.length; i++) {
      groupPair=groupArray[i].split(':');
      group[group.length] =new Option(groupPair[2], groupPair[1], false, false);
      if(groupPair[1] ==selectedGroup) {
        group[group.length -1].defaultSelected =true;
        group[group.length -1].selected =true;
      }
    }
  }

  function loadParts(groupId) {
    //part =document.search.partCode.options;
    men=document.all.item('partCode');
    part =men.options;

    part.length =0;

    if(add_form==1){
    	part[part.length] =new Option('<выбрать>', groupId, false, false);
	}else{
		part[part.length] =new Option('<не имеет значения>', groupId, false, false);
	}

    for(i=0; i<partArray.length; i++) {
      partPair =partArray[i].split(':');
      if(partPair[2].split('.')[0] ==groupId) {
        part[part.length] =new Option(partPair[3], partPair[2] +':' +partPair[1] +':' +partPair[4], false, false);
        if(partPair[2] +':' +partPair[1] +':' +partPair[4] ==selectedPart) {
          part[part.length -1].defaultSelected =true;
          part[part.length -1].selected =true;
            }
      }
    }
  }
  function setClass(part) {

    if(part==0||part=='0') {
      disableField(document.search.kuzov,'ENABLE');
      disableField(document.search.engine,'ENABLE');
      disableField(document.search.number,'ENABLE');
      return;
    }

    if(viewMode =='contract') {
    	if(part.length>3){
     	 cl =part.split(':')[2];
    	}else{
    		cl='xxxxxxxx';
    	}

      cl.charAt(0) !='-' ? document.search.f_mark_potter.disabled =false : document.search.f_mark_potter.disabled =true;
      cl.charAt(1) !='-' ? document.search.f_model_potter.disabled =false : document.search.f_model_potter.disabled =true;
      cl.charAt(2) !='-' ? disableField(document.search.f_kuzovN,'ENABLE') : disableField(document.search.f_kuzovN,'DISABLE');
      cl.charAt(4) !='-' ? disableField(document.search.f_engineN,'ENABLE') : disableField(document.search.f_engineN,'DISABLE');
      cl.charAt(3) !='-' ? disableField(document.search.f_modelN,'ENABLE') : disableField(document.search.f_modelN,'DISABLE');

      if(cl.charAt(5) =='-') {
        document.search.f_F_R[0].disabled =true;
        document.search.f_F_R[1].disabled =true;
        document.search.f_F_R[2].disabled =true;
      } else {
        document.search.f_F_R[0].disabled =false;
        document.search.f_F_R[1].disabled =false;
        document.search.f_F_R[2].disabled =false;
      }
      if(cl.charAt(6) =='-') {
        document.search.f_R_L[0].disabled =true;
        document.search.f_R_L[1].disabled =true;
        document.search.f_R_L[2].disabled =true;
      } else {
        document.search.f_R_L[0].disabled =false;
        document.search.f_R_L[1].disabled =false;
        document.search.f_R_L[2].disabled =false;
      }
      if(cl.charAt(7) =='-') {
        document.search.f_U_D[0].disabled =true;
        document.search.f_U_D[1].disabled =true;
        document.search.f_U_D[2].disabled =true;
      } else {
        document.search.f_U_D[0].disabled =false;
        document.search.f_U_D[1].disabled =false;
        document.search.f_U_D[2].disabled =false;
      }
    }
  }

  function disableField(field,op) {
    if(op=='ENABLE') {
      field.disabled =false; field.style.backgroundColor ='#FFFFFF';
    }
    if(op=='DISABLE') {
      field.disabled =true; field.style.backgroundColor ='#EEEEEE';
    }
  }
function loadMark() {
	mark =document.search.f_mark_potter.options;
	mark.length =0;
	mark[mark.length] =new Option('<не имеет значения>', 0, false, false);
	
	markArray=markStr.split(';');
	for(i=0;i <markArray.length; i++) {
		markPair=markArray[i].split(':');
		mark[mark.length] =new Option(markPair[2], markPair[1] +':' +markPair[2], false, false);
		if(markPair[1] +':' +markPair[2] ==selectedMark) {
			mark[mark.length -1].defaultSelected =true;
			mark[mark.length -1].selected =true;
		}
	}
}
function loadModel(mark) {
	if(mark==0) {
		markId =0;
	} else {
		mark_a =mark.split(':');
		markId =mark_a[0];
	}

	model =document.search.f_model_potter.options;
	model.length =0;
	model[model.length] =new Option('<не имеет значения>', 0, false, false);

	modelArray=modelStr.split(';');
	for(i=0;i <modelArray.length; i++) {
		modelPair=modelArray[i].split(':');
		if(modelPair[2] ==markId) {
			model[model.length] =new Option(modelPair[3], modelPair[3], false, false);
			if(modelPair[3]==selectedModel) {
				model[model.length -1].defaultSelected =true;
				model[model.length -1].selected =true;
			}
		}
	}
}
function onSubFormAddYellow(){
	var check,str_error;
	check=0;
	str_error='';
	if (document.forms['add'].f_name_of_firm.value==''){
		check=1;
		str_error+='\nВы не указали Имя фирмы.';
	}
	
	if (document.forms['add'].f_mainservice.value==''){
		check=1;
		str_error+='\nВы не указали Основное направление.';
	}
	
	if (document.forms['add'].f_maincontact.value==''){
		check=1;
		str_error+='\nВы не указали Главный контакт .';
	}

	temp_str=IsValidEmail(document.forms['add'].f_contact_email.value,0);
	if(temp_str!=1){
		check=1;
		str_error+=temp_str;
	}
	
	if (check==1)
	{
		alert(str_error);
	}else
	{
		document.forms['add'].submit();
	}

}
function onSubFormAddTyre(){
	var check,str_error;
	check=0;
	str_error='';
	
	if (document.forms['add'].f_cont_name_main.value==''){
		check=1;
		str_error+='Вы не указали главный контакт.';
	}

	temp_str=IsValidEmail(document.forms['add'].f_cont_email.value,0);
	if(temp_str!=1){
		check=1;
		str_error+=temp_str;
	}

	if (check==1)
	{
		alert(str_error);
	}else
	{
		document.forms['add'].submit();
	}

}
function onSubFormAddWater()
{
	var check,str_error;
	check=0;
	str_error='';
	if (document.forms['add'].f_cont_name_main.value==''){
		check=1;
		str_error+='Вы не указали главный контакт.';
	}
	if ((document.forms['add'].f_volume.value<0)||(document.forms['add'].f_volume.value>100000)||(document.forms['add'].f_volume.value=='')){
		check=1;
		str_error+='\nОбъем не должен быть меньше 0.';
	}
	if ((document.forms['add'].f_pricein.value<1)||(document.forms['add'].f_pricein.value=='')){
		check=1;
		str_error+='\nНеправильно указана цена.';
	}
	var temp_str;

	temp_str=IsValidEmail(document.forms['add'].f_cont_email.value,0);
	if(temp_str!=1){
		check=1;
		str_error+=temp_str;
	}

	if (check==1)
	{
		alert(str_error);
	}else
	{
		document.forms['add'].submit();
	}
}

function onSubFormAddWaterBuy()
{
	var check,str_error;
	check=0;
	str_error='';
	if (document.forms['add'].f_cont_name_main.value==''){
		check=1;
		str_error+='Вы не указали главный контакт.';
	}
	var temp_str;

	temp_str=IsValidEmail(document.forms['add'].f_cont_email.value,0);
	if(temp_str!=1){
		check=1;
		str_error+=temp_str;
	}

	if (check==1)
	{
		alert(str_error);
	}else
	{
		document.forms['add'].submit();
	}
}
function onSubFormAddMoto()
{
	var check,str_error;
	check=0;
	str_error='';
	if (document.forms['add'].f_cont_name_main.value==''){
		check=1;
		str_error+='Вы не указали главный контакт.';
	}
	if ((document.forms['add'].f_volume.value<0)||(document.forms['add'].f_volume.value>100000)||(document.forms['add'].f_volume.value=='')){
		check=1;
		str_error+='\nОбъем не должен быть меньше 0.';
	}
	if ((document.forms['add'].f_pricein.value<1)||(document.forms['add'].f_pricein.value=='')){
		check=1;
		str_error+='\nНеправильно указана цена.';
	}
	var temp_str;

	temp_str=IsValidEmail(document.forms['add'].f_cont_email.value,0);
	if(temp_str!=1){
		check=1;
		str_error+=temp_str;
	}

	if (check==1)
	{
		alert(str_error);
	}else
	{
		document.forms['add'].submit();
	}
}

function onSubFormAddMotoBuy()
{
	var check,str_error;
	check=0;
	str_error='';
	if (document.forms['add'].f_cont_name_main.value==''){
		check=1;
		str_error+='Вы не указали главный контакт.';
	}
	var temp_str;

	temp_str=IsValidEmail(document.forms['add'].f_cont_email.value,0);
	if(temp_str!=1){
		check=1;
		str_error+=temp_str;
	}

	if (check==1)
	{
		alert(str_error);
	}else
	{
		document.forms['add'].submit();
	}
}

function onSubFormAddAuto2Parts()
{
	var check,str_error;
	check=0;
	str_error='';
	if (document.forms['add'].f_cont_name_main.value==''){
		check=1;
		str_error+='Вы не указали главный контакт.';
	}
	var temp_str;

	temp_str=IsValidEmail(document.forms['add'].f_cont_email.value,0);
	if(temp_str!=1){
		check=1;
		str_error+=temp_str;
	}

	if (check==1)
	{
		alert(str_error);
	}else
	{
		document.forms['add'].submit();
	}
}
function onSubFormAddAuto2Half()
{
	var check,str_error;
	check=0;
	str_error='';
	if (document.forms['add'].f_cont_name_main.value==''){
		check=1;
		str_error+='Вы не указали главный контакт.';
	}
	var temp_str;

	temp_str=IsValidEmail(document.forms['add'].f_cont_email.value,0);
	if(temp_str!=1){
		check=1;
		str_error+=temp_str;
	}

	if (check==1)
	{
		alert(str_error);
	}else
	{
		document.forms['add'].submit();
	}
}
function onSubFormAddAuto2Constructor()
{
	var check,str_error;
	check=0;
	str_error='';
	if (document.forms['add'].f_cont_name_main.value==''){
		check=1;
		str_error+='Вы не указали главный контакт.';
	}
	var temp_str;

	temp_str=IsValidEmail(document.forms['add'].f_cont_email.value,0);
	if(temp_str!=1){
		check=1;
		str_error+=temp_str;
	}

	if (check==1)
	{
		alert(str_error);
	}else
	{
		document.forms['add'].submit();
	}
}

function onSubFormAddTuningGallery()
{
	var check,str_error;
	check=0;
	str_error='';
	if (document.forms['add'].f_cont_name_main.value==''){
		check=1;
		str_error+='Вы не указали главный контакт.';
	}

	var temp_str;

	temp_str=IsValidEmail(document.forms['add'].f_cont_email.value,0);

	if(temp_str!=1){
		check=1;
		str_error+=temp_str;
	}

	if (check==1)
	{
	alert(str_error);
	}else
	{
	document.forms['add'].submit();
	}
}
function onSubFormAddTuning()
{
	var check,str_error;
	check=0;
	str_error='';
	if (document.forms['add'].f_cont_name_main.value==''){
		check=1;
		str_error+='Вы не указали главный контакт.';
	}
	if ((document.forms['add'].f_price.value<0)||(document.forms['add'].f_price.value<-2)||(document.forms['add'].f_price.value=='')){
		check=1;
		str_error+='\nНеправильно указана цена (цена должна быть >= 0).';
	}

	var temp_str;

	temp_str=IsValidEmail(document.forms['add'].f_cont_email.value,0);

	if(temp_str!=1){
		check=1;
		str_error+=temp_str;
	}

	if (check==1)
	{
	alert(str_error);
	}else
	{
	document.forms['add'].submit();
	}
}
function onSubFormAddGoods()
{
	var check,str_error;
	check=0;
	str_error='';
	if (document.forms['add'].f_cont_name_main.value==''){
		check=1;
		str_error+='Вы не указали главный контакт.';
	}

	var temp_str;

	temp_str=IsValidEmail(document.forms['add'].f_cont_email.value,0);

	if(temp_str!=1){
		check=1;
		str_error+=temp_str;
	}

	if (check==1)
	{
	alert(str_error);
	}else
	{
	document.forms['add'].submit();
	}
}

function onSubFormAddAuto()
{
	var check,str_error;
	check=0;
	str_error='';
	if (document.forms['add'].f_cont_name_main.value==''){
		check=1;
		str_error+='Вы не указали главный контакт.';
	}
	if ((document.forms['add'].f_volume.value<100)||(document.forms['add'].f_volume.value>100000)||(document.forms['add'].f_volume.value=='')){
		check=1;
		str_error+='\nОбъем должен быть от 100 и до 100 000.';
	}

	if ((document.forms['add'].f_price.value==0)||(document.forms['add'].f_price.value<-2)||(document.forms['add'].f_price.value=='')){
		check=1;
		str_error+='\nНеправильно указана цена.';
	}

	var temp_str;

	temp_str=IsValidEmail(document.forms['add'].f_cont_email.value,0);

	if(temp_str!=1){
		check=1;
		str_error+=temp_str;
	}

	if (check==1)
	{
	alert(str_error);
	}else
	{
	document.forms['add'].submit();
	}
}

function onDivisinSendReq()
{
	var check,str_error;
	check=0;
	str_error='';
	if (document.forms['senddiv'].f_name.value==''){
		check=1;
		str_error+='\nВы не указали свое имя.';
	}

	if (document.forms['senddiv'].f_town.value==''){
		check=1;
		str_error+='\nВы не указали свой город.';
	}

	if (document.forms['senddiv'].f_email.value==''){
		check=1;
		str_error+='\nУкажите свой e-mail.';
	}

	if (document.forms['senddiv'].f_phone.value==''){
		check=1;
		str_error+='\nУкажите свой контактный телефон.';
	}

	var temp_str;

	temp_str=IsValidEmail(document.forms['senddiv'].f_email.value,0);

	if(temp_str!=1){
		check=1;
		str_error+=temp_str;
	}

	if (document.forms['senddiv'].f_note.value==''){
		check=1;
		str_error+='\nВы не написали запрос.';
	}



	if (check==1)
	{
		alert(str_error);
	}else
	{
		document.forms['senddiv'].submit();
	}
}


function onSubFormAddAutoBuy()
{
	var check,str_error;
	check=0;
	str_error='';
	if (document.forms['add'].f_cont_name_main.value==''){
		check=1;
		str_error+='Вы не указали главный контакт.';
	}

	var temp_str;

	temp_str=IsValidEmail(document.forms['add'].f_cont_email.value,0);

	if(temp_str!=1){
		check=1;
		str_error+=temp_str;
	}

	if (check==1)
	{
	alert(str_error);
	}else
	{
	document.forms['add'].submit();
	}
}
            function onSubFormAddPower()
            {
                    var check,str_error;
                check=0;
                str_error='';
                if (document.forms['add'].f_cont_name_main.value==''){
                    check=1;
                    str_error+='Вы не указали главный контакт.';
                }
                if ((document.forms['add'].f_volume.value<0)||(document.forms['add'].f_volume.value>100000)||(document.forms['add'].f_volume.value=='')){
                    check=1;
                    str_error+='\nОбъем не должен быть меньше 0.';
                }
                if ((document.forms['add'].f_pricein.value==0)||(document.forms['add'].f_pricein.value<-2)||(document.forms['add'].f_pricein.value=='')){
                    check=1;
                    str_error+='\nНеправильно указана цена.';
                }
                var temp_str;
                
                temp_str=IsValidEmail(document.forms['add'].f_cont_email.value,0);
                if(temp_str!=1){
                    check=1;
                    str_error+=temp_str;
                }

                if (check==1)
                {
                        alert(str_error);
                }else
                {
                        document.forms['add'].submit();
                }
            }

            function onSubFormAddPowerBuy()
            {
                    var check,str_error;
                check=0;
                str_error='';
                if (document.forms['add'].f_cont_name_main.value==''){
                    check=1;
                    str_error+='Вы не указали главный контакт.';
                }
                var temp_str;
                
                temp_str=IsValidEmail(document.forms['add'].f_cont_email.value,0);
                if(temp_str!=1){
                    check=1;
                    str_error+=temp_str;
                }

                if (check==1)
                {
                        alert(str_error);
                }else
                {
                        document.forms['add'].submit();
                }
            }
function onSubFormAddParts()
{
	var check,str_error;
	check=0;
	str_error='';
	if (document.forms['add'].f_cont_name.value==''){
		check=1;
		str_error+='\nВы не указали "Наименование продавца".';
	}
	if (document.forms['add'].f_cont_phone.value==''){
		check=1;
		str_error+='\nВы не указали телефон.';
	}
	if (document.forms['add'].f_place.value==0){
		check=1;
		str_error+='\nВыберите Местонахождение.';
	}
    if(document.forms['add'].pr_type.value=='add_parts'){
		if (document.forms['add'].partCode.value==''){
			check=1;
			str_error+='\nУкажите название запчасти, или введите свое название.';
		}
	}else{
		if (document.forms['add'].f_new_name_parts.value==''){
			check=1;
			str_error+='\nВведите свое название запчасти, или выберите из списка.';
		}
	}
	if (document.forms['add'].f_marka.value==0){
		check=1;
		str_error+='\nВыберите Производителя.';
	}
	if (document.forms['add'].f_model.value==''){
		check=1;
		str_error+='\nВы не указали модель.';
	}
	/*if ((document.forms['add'].f_volume.value<1)||(document.forms['add'].f_volume.value>100000)||(document.forms['add'].f_volume.value=='')){
		check=1;
		str_error+='\nОбъем должен быть больше 0.';
	}*/


	var temp_str;

	//temp_str=IsValidEmail(document.forms['add'].f_cont_email.value,0);

	/*if(temp_str!=1){
		check=1;
		str_error+=temp_str;
	}*/

	if (check==1)
	{
	alert(str_error);
	}else
	{
	document.forms['add'].submit();
	}
}
function InitNameOfSelect(th){
	if(men=document.all.item('new_name_01')) men.style.display='none';
	if(men=document.all.item('new_name_11')) men.style.display='none';
	if(men=document.all.item('new_name_02')) men.style.display='none';
	if(men=document.all.item('new_name_12')) men.style.display='none';
	if(men=document.all.item('new_name_03')) men.style.display='none';
	if(men=document.all.item('new_name_13')) men.style.display='none';
	if(th=='list'){
		if(men=document.all.item('new_name_01')) men.style.display='inline';
		if(men=document.all.item('new_name_02')) men.style.display='inline';
		if(men=document.all.item('new_name_03')) men.style.display='inline';
		if(men=document.all.item('pr_type')){
		 str='add_parts';
		 men.value=str;
		}
	}else{
		if(men=document.all.item('new_name_11')) men.style.display='inline';
		if(men=document.all.item('new_name_12')) men.style.display='inline';
		if(men=document.all.item('new_name_13')) men.style.display='inline';
		if(men=document.all.item('pr_type')){
		 str='new_name_parts';
		 men.value=str;
		}
	}
};
function SetTyre(tp){
if(men=document.all.item('div_tyre')) men.style.display='none';
if(men=document.all.item('div_wheel')) men.style.display='none';
if(tp==1){
if(men=document.all.item('div_tyre')) men.style.display='inline';
}else if(tp==2){
if(men=document.all.item('div_wheel')) men.style.display='inline';
}else{
if(men=document.all.item('div_tyre')) men.style.display='inline';
if(men=document.all.item('div_wheel')) men.style.display='inline';
}
};
function getCookieVal (offset) {  
	var endstr = document.cookie.indexOf (";", offset);  
	if (endstr == -1)    
	endstr = document.cookie.length;  
	return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {  
	var arg = name + "=";  
	var alen = arg.length;  
	var clen = document.cookie.length;  
	var i = 0;  
	while (i < clen) {    
		var j = i + alen;    
		if (document.cookie.substring(i, j) == arg) return getCookieVal (j);    
		i = document.cookie.indexOf(" ", i) + 1;    
		if (i == 0) break;   
	}  
	return null;
}
function SetCookie (name, value) {  
	var argv = SetCookie.arguments;  
	var argc = SetCookie.arguments.length;  
	var expires = (argc > 2) ? argv[2] : null;  
	var path = (argc > 3) ? argv[3] : null;  
	var domain = (argc > 4) ? argv[4] : null;  
	var secure = (argc > 5) ? argv[5] : false;  
	document.cookie = name + "=" + escape (value) + 
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
	((path == null) ? "" : ("; path=" + path)) +  
	((domain == null) ? "" : ("; domain=" + domain)) +    
	((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {  
	var exp = new Date();  
	exp.setTime (exp.getTime() - 1);  
	var cval = GetCookie (name);  
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

function MinMax(point,act){
	var expDays = 30;
	var exp = new Date(); 
	exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
	
	if(men=document.all.item(point)){
		if(act=='show'){
			men.style.display='inline';
		}else if(act=='hide'){
			men.style.display='none';
		}else if(act=='none'){
			if(GetCookie(point+'_div')=='hide'){
				men.style.display='inline';
				SetCookie (point+'_div', 'show', exp);
			}else{
				men.style.display='none';
				SetCookie (point+'_div', 'hide', exp);
			}
			
		}
		/*else{
			if(men.style.display=='none'){
				men.style.display='inline';
				SetCookie (point+'_div', 'show', exp);
			}else{
				men.style.display='none';
				SetCookie (point+'_div', 'hide', exp);
			}
		}*/
	}
	
	
	//men=document.all.item(a);
	//men.style.display='inline';
}

div_index=['autosalon','insur','tuning','tools','moto','water','tyre','parts','yellow','auto','auto2','tour','signall','news','power','info','serviceauto'];

function GetMinMax(){
	var div_;
	for (i = 0; i < div_index.length; i++) {   
		div_=div_index[i];
		if (GetCookie(div_+'_div')=='hide') MinMax(div_,'hide')
		else MinMax(div_,'show');
	}
}
function AddExtraPhotoField(photo_table)
{
	var pictable;
	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[]" style="width:95%">';
	}
}
/*
function init_place()
{

	if($('div_town_combo_load')) { $('div_town_combo_load').hide(); }

	if($('sel_town')){ $('sel_town').onclick = function() {
		if($('div_town_combo_load')) { $('div_town_combo_load').hide(); }

		$('type_place').value = 'sel_town';

		if($('f_country_title')) $('f_country_title').show();
		if($('f_country')) $('f_country').show();

		if($('f_town_title')) $('f_town_title').show();
		if($('f_town')) $('f_town').show();

		if($('f_region_title')) $('f_region_title').hide();
		if($('f_region')) $('f_region').hide();
	}
	}

	if($('sel_region')){ $('sel_region').onclick = function() {
		if($('div_town_combo_load')) { $('div_town_combo_load').hide(); }

		$('type_place').value = 'sel_region';
		if($('f_country_title')) $('f_country_title').hide();
		if($('f_country')) $('f_country').hide();

		if($('f_town_title')) $('f_town_title').hide();
		if($('f_town')) $('f_town').hide();

		if($('f_region_title')) $('f_region_title').show();
		if($('f_region')) $('f_region').show();
	}
	}

	if ( sel_point == 'sel_town' ){
		if($('sel_town')) $('sel_town').onclick();
	}else{
		if($('sel_region')) $('sel_region').onclick();
	}
	if ($('cl_length_change_mode'))
	{
		$('cl_length_change_mode').value=0;
		if ($('cl_length_to_text') && $('cl_length_to_text').value>0)
		{
			$('cl_length_change_mode').value = "1";
		}
		change_mode('length');
	}
	if ($('cl_capacity_change_mode'))
	{
		$('cl_capacity_change_mode').value=0;
		if ($('cl_capacity_to_text') && $('cl_capacity_to_text').value>0)
		{
			$('cl_capacity_change_mode').value = "1";
		}
		change_mode('capacity');
	}
	if ($('cl_price_change_mode'))
	{
		$('cl_price_change_mode').value=0;
		if ($('price_to') && $('price_to').value>0)
		{
			$('cl_price_change_mode').value = "1";
		}
		change_mode2('price');
	}

}
*/

function ng_OnSearchAll() {
	

	
	//обнуляю муссор

	if($('vlf') && $('vlf').value<=0) $('vlf').disable();
	if($('vlt') && $('vlt').value<=0) $('vlt').disable();
	if($('type_helm') && $('type_helm').value<=0) $('type_helm').disable();
	if($('type_engine') && $('type_engine').value<=0) $('type_engine').disable();
	if($('type_machine') && $('type_machine').value<=0) $('type_machine').disable();
	if($('cl_jctube_search') && $('cl_jctube_search').value==''){ $('cl_jctube_search').disable();}

	//местонахождение
//		alert($('sel_town'));
//	if($('sel_town')) $('sel_town').disable();
//	if($('sel_region')) $('sel_region').disable();
//	if($('type_place')) $('type_place').disable();

	if($('f_town') && ($('f_town').value<1 || $('type_place').value == 'sel_region') ) $('f_town').disable();
	if($('f_country') && ($('f_country').value<1 || $('type_place').value == 'sel_region') ) $('f_country').disable();
	if($('cl_town') && ($('cl_town').value<1))  $('cl_town').disable();
//	if($('type_place') && $('type_place').value != 'sel_region'  ) $('f_region').remove();


	//гады годы
	if($('yf') && ($('yf').value==1970 || $('yf').value<=0)) $('yf').disable();
	if($('yt') && ($('yt').value==2008 || $('yt').value<=0)) $('yt').disable();
	//сортировка

	if($('orderby') && $('orderhow') ){
		if($('orderby').value=='' || $('orderhow').value=='' ){
			$('orderby').disable();
			$('orderhow').disable();
		}
	}else{
		if($('orderby')) $('orderby').disable();
		if($('orderhow')) $('orderhow').disable();
	}


	if($('cl_aucname') && $('cl_aucname').value <2) $('cl_aucname').disable();
	if($('cl_lot_num') && $('cl_lot_num').value =='') $('cl_lot_num').disable();
	if($('cl_score') && $('cl_score').value =='') $('cl_score').disable();
	//фирма|марка
	if($('f_firm') && $('f_firm').value<1){ $('f_firm').disable(); if($('div_mark_combo')) $('div_mark_combo').disable();}
	if($('cl_firm') && $('cl_firm').value<1){ $('cl_firm').disable();}

	if($('div_mark_combo') && $('div_mark_combo').value<1) $('div_mark_combo').disable();

	if($('div_mark_text') && $('div_mark_text').value=='') $('div_mark_text').disable();
	//трансмисия
	if($('type_trans') && $('type_trans').value<=0) $('type_trans').disable();

	//saler_text
	if($('cl_saler_text') && $('cl_saler_text').value=='') $('cl_saler_text').disable();
	//jcnum
	if($('jn') && $('jn').value=='') $('jn').disable();
	//двигатель, текст
	if($('cl_engine') && $('cl_engine').value=='') $('cl_engine').disable();
	//кузов, текст
	if($('cl_body') && $('cl_body').value=='') $('cl_body').disable();
	//название
	if($('cl_name') && $('cl_name').value=='') $('cl_name').disable();

	//тип тюнинга
	if($('cl_typetuning') && $('cl_typetuning').value=='0') $('cl_typetuning').disable();
	//категория тюнинга
	if($('cl_cattuning') && $('cl_cattuning').value=='0') $('cl_cattuning').disable();
	//наличие
	if($('cl_presence_all')){$('cl_presence_all').disable()}
	else if($('cl_presence') && $('cl_presence').value=='0') $('cl_presence').disable();
	//код заказа
	if($('org') && $('org').value<=0) $('org').disable();
	//цена
	if($('price_from') && $('price_from').value<=0) $('price_from').disable();
	if($('price_to') && $('price_to').value<=0) $('price_to').disable();
	//pts
	if($('pts_record_unknown')) $('pts_record_unknown').disable();
	//broken
	if($('broken_all')) $('broken_all').disable();

	if($('rnd') && $('rnd').value<=0) $('rnd').disable();

	if($('dgr') && $('dgr').value<=0) $('dgr').disable();

	//штатная фирма, автозвук
	if($('cl_a_firm') && $('cl_a_firm').value<=0) $('cl_a_firm').disable();
	//размер, автозвук
	if($('cl_sound_size') && $('cl_sound_size').value<=0) $('cl_sound_size').disable();
	//класс, автозвук
	if($('cl_sound_class') && $('cl_sound_class').value<=0) $('cl_sound_class').disable();
	//тип, автозвук
	if($('cl_sound_type') && $('cl_sound_type').value<=0) $('cl_sound_type').disable();

	if($('cl_typepower') && $('cl_typepower').value<=0) $('cl_typepower').disable();

	if($('cl_typemoto') && ($('cl_typemoto').value<=0 || $('cl_typemoto').value==0)) $('cl_typemoto').disable();

	if($('cl_typewater') && $('cl_typewater').value<=0) $('cl_typewater').disable();

	if($('cl_mark_text') && $('cl_mark_text').value=='') $('cl_mark_text').disable();

	if($('cl_OEM') && $('cl_OEM').value=='') $('cl_OEM').disable();

	if($('f_ud_any')) $('f_ud_any').disable();
	if($('f_fr_any')) $('f_fr_any').disable();
	if($('f_rl_any')) $('f_rl_any').disable();

	if($('f_all')) $('f_all').disable();
	if($('cl_use_all')) $('cl_use_all').disable();

	if($('cl_name_dir') && ($('cl_name_dir').value=='' || $('cl_name_dir').value<=0)) $('cl_name_dir').disable();

	if($('cl_cats') && ($('cl_cats').value=='' || $('cl_cats').value<=0)) $('cl_cats').disable();
	if($('cl_type') && ($('cl_type').value=='' || $('cl_type').value<=0)) $('cl_type').disable();

	// тип для продажи запчастей (водная техника)
	if($('subtypes') && ($('subtypes').value=='' || $('subtypes').value<=0)) $('subtypes').disable();
	if($('types') && ($('types').value=='' || $('types').value<=0)) $('types').disable();
	if($('cl_used') && ($('cl_used').value=='all' || $('cl_used').value<=0)) $('cl_used').disable();

	if($('cl_categ') && ($('cl_categ').value=='' || $('cl_categ').value<=0)) $('cl_categ').disable();

	if($('cl_typemore') && ($('cl_typemore').value=='' || $('cl_typemore').value<=0)) $('cl_typemore').disable();

	if($('cl_goods_model') && ($('cl_goods_model').value=='' || $('cl_goods_model').value<=0)) $('cl_goods_model').disable();

	if($('cl_goods_name') && ($('cl_goods_name').value=='' || $('cl_goods_name').value<=0)) $('cl_goods_name').disable();

	if($('cl_goods_firm') && ($('cl_goods_firm').value=='' || $('cl_goods_firm').value<=0)) $('cl_goods_firm').disable();

	if($('cl_motoparts_name')&& ($('cl_motoparts_name').value=='' || $('cl_motoparts_name').value<=0)) $('cl_motoparts_name').disable();
	if($('cl_motoparts_firm')&& ($('cl_motoparts_firm').value=='' || $('cl_motoparts_firm').value<=0)) $('cl_motoparts_firm').disable();
	if($('cl_motoparts_model')&& ($('cl_motoparts_model').value=='' || $('cl_motoparts_model').value<=0)) $('cl_motoparts_model').disable();

	if($('cl_mototype')&& ($('cl_mototype').value=='' || $('cl_mototype').value<=0)) $('cl_mototype').disable();


	if($('cl_wh_hole') && ($('cl_wh_hole').value=='' || $('cl_wh_hole').value<=0)) $('cl_wh_hole').disable();
	if($('cl_wh_pcb') && ($('cl_wh_pcb').value=='' || $('cl_wh_pcb').value<=0)) $('cl_wh_pcb').disable();
	if($('cl_wh_off') && ($('cl_wh_off').value=='' || $('cl_wh_off').value<=0)) $('cl_wh_off').disable();
	if($('cl_wh_size') && ($('cl_wh_size').value=='' || $('cl_wh_size').value<=0 || $('cl_wh_size').value=='-' )) $('cl_wh_size').disable();
	if($('cl_wh_model') && ($('cl_wh_model').value=='' || $('cl_wh_model').value<=0)) $('cl_wh_model').disable();
	if($('cl_wh_marka') && ($('cl_wh_marka').value=='' || $('cl_wh_marka').value<=0)) $('cl_wh_marka').disable();
	if($('cl_compl') && ($('cl_compl').value=='' || $('cl_compl').value<=0 || $('cl_compl').value=='-' )) $('cl_compl').disable();

	if($('cl_tr_size_1') && ($('cl_tr_size_1').value=='' || $('cl_tr_size_1').value<=0 || $('cl_tr_size_1').value=='-' )) $('cl_tr_size_1').disable();
	if($('cl_tr_size_2') && ($('cl_tr_size_2').value=='' || $('cl_tr_size_2').value<=0 || $('cl_tr_size_2').value=='-' )) $('cl_tr_size_2').disable();
	if($('cl_tr_size_3') && ($('cl_tr_size_3').value=='' || $('cl_tr_size_3').value<=0 || $('cl_tr_size_3').value=='-' )) $('cl_tr_size_3').disable();

	if($('f_size01') && ($('f_size01').value=='' || $('f_size01').value<=0 || $('f_size01').value=='-' )) $('f_size01').disable();
	if($('f_size02') && ($('f_size02').value=='' || $('f_size02').value<=0 || $('f_size02').value=='-' )) $('f_size02').disable();
	if($('f_size03') && ($('f_size03').value=='' || $('f_size03').value<=0 || $('f_size03').value=='-' )) $('f_size03').disable();

	if($('cl_cats') && ($('cl_cats').value=='' || $('cl_cats').value<=1 || $('cl_cats').value=='-' )) $('cl_cats').disable();
	if($('cl_year') && ($('cl_year').value=='' || $('cl_year').value<=0 || $('cl_year').value=='-' )) $('cl_year').disable();
	if($('cl_used_tyre') && ($('cl_used_tyre').value=='' || $('cl_used_tyre').value<=0 || $('cl_used_tyre').value=='-' )) $('cl_used_tyre').disable();
	if($('cl_tyre_weather') && ($('cl_tyre_weather').value=='' || $('cl_tyre_weather').value<=0)) $('cl_tyre_weather').disable();
	if($('cl_tyre_type') && ($('cl_tyre_type').value=='' || $('cl_tyre_type').value<=0)) $('cl_tyre_type').disable();
	if($('tyre_type_0') && ($('tyre_type_0').checked) ) $('tyre_type_0').disable();

	if($('cl_price_to') && ($('cl_price_to').value=='' || $('cl_price_to').value<=0)) $('cl_price_to').disable();
	if($('cl_price_from') && ($('cl_price_from').value=='' || $('cl_price_from').value<=0)) $('cl_price_from').disable();
	if($('cl_tr_model_text') && ($('cl_tr_model_text').value=='' || $('cl_tr_model_text').value<=0)) $('cl_tr_model_text').disable();
	if($('cl_tr_marka_text') && ($('cl_tr_marka_text').value=='' || $('cl_tr_marka_text').value<=0)) $('cl_tr_marka_text').disable();

	// книги
	if($('cl_cat') && ($('cl_cat').value=='' || $('cl_cat').value<=0)) $('cl_cat').disable();
	if($('cl_author') && ($('cl_author').value=='' || $('cl_author').value<=0)) $('cl_author').disable();
	if($('cl_note') && ($('cl_note').value=='' || $('cl_note').value<=0)) $('cl_note').disable();
	if($('cl_isbn') && ($('cl_isbn').value=='' || $('cl_isbn').value<=0)) $('cl_isbn').disable();

	if($('cl_purchase_all')) $('cl_purchase_all').disable();



	//опции, звук
	var i;
	for(i=1;i<=20;i++){
		if($('cl_sound_options_'+i)){
			$('cl_sound_options_'+i).disable();
		}
	}

	// новые запчасти

	//список продавцов
	if($('sel_saler_o')) $('sel_saler_o').disable();
	if($('sel_saler_l')) $('sel_saler_l').disable();
	if($('type_saler')) $('type_saler').disable();

	if($('saler_o') && ($('saler_o').value<1 || $('type_saler').value == 'sel_list') ) $('saler_o').disable();
	if($('type_saler') && $('type_saler').value != 'sel_list'  ) $('saler_l').remove();



	var type_profipotter = $('type_profipotter');
	if (type_profipotter != null) type_profipotter.disable();

	var cl_oem_code = $('cl_oem_code');
	if (cl_oem_code != null) if (cl_oem_code.value == '') cl_oem_code.disable();

	var cl_parts_name_profi = $('name_pro');
	if (cl_parts_name_profi != null)if (cl_parts_name_profi.value == '') cl_parts_name_profi.disable();

	var cl_partGroup = $('name_potter');
	if (cl_partGroup != null) if ((cl_partGroup.value <= 0)) cl_partGroup.disable();

	var cl_prod_code = $('cl_prod_code');
	if (cl_prod_code != null) if(cl_prod_code.value == '') cl_prod_code.disable();

	var cl_parts_name_acc = $('acc_name_pro');
	if (cl_parts_name_acc != null) if (cl_parts_name_acc.value <= 0) cl_parts_name_acc.disable();

	var cl_partCode = $('partCode');
	if (cl_partCode != null) if (cl_partCode.value <= 0) cl_partCode.disable();



	var cl_producer = $('cl_producer');
	if (cl_producer != null) if (cl_producer.value <= 0) cl_producer.disable();

	var cl_saler_one = $('saler_o');
	if (cl_saler_one != null) if (cl_saler_one.value <= 0) cl_saler_one.disable();

	var cl_remark = $('cl_remark');
	if (cl_remark != null) if (cl_remark.value == '') cl_remark.disable();



	if($('cl_model') && $('cl_model').value=='') $('cl_model').disable();

	if($('mdl') && $('mdl').value=='') $('mdl').disable();

	//Вода, длина от/до
	if($('cl_length_from_text') && ($('cl_length_from_text').value=='' || $('cl_length_from_text').value<=0)){$('cl_length_from_text').disable();}
	if($('cl_length_to_text') && ($('cl_length_to_text').value=='' || $('cl_length_to_text').value<=0)){$('cl_length_to_text').disable();}

	//Вода, мощность от/до
	if($('cl_capacity_from_text') && ($('cl_capacity_from_text').value=='' || $('cl_capacity_from_text').value<=0)){$('cl_capacity_from_text').disable();}
	if($('cl_capacity_to_text') && ($('cl_capacity_to_text').value=='' || $('cl_capacity_to_text').value<=0)){$('cl_capacity_to_text').disable();}

	if($('cl_length_change_mode'))$('cl_length_change_mode').disable();
	if($('cl_capacity_change_mode'))$('cl_capacity_change_mode').disable();
	if($('cl_price_change_mode'))$('cl_price_change_mode').disable();
	// в угоне
	// цвет
	if ($('cl_color') && ($('cl_color').value=='' || $('cl_color').value==0   ) ) $('cl_color').disable();
	// дата угона
	// проверяем дату "С"
	if ( $('cl_hdf') && $('cl_hmf') && $('cl_hyf') ) {// они хотябы существуют
		 if ($('cl_hdf').value=='' || $('cl_hdf').value==0 ||
		 	 $('cl_hmf').value=='' || $('cl_hmf').value==0 ||
		 	 $('cl_hyf').value=='' || $('cl_hyf').value==0) {
		 	 	$('cl_hdf').disable();
		 	 	$('cl_hmf').disable();
		 	 	$('cl_hyf').disable();
		 	 }
	}

	// проверяем дату "ПО"
	if ( $('cl_hdt') && $('cl_hmt') && $('cl_hyt') ) {
		if ($('cl_hdt').value=='' || $('cl_hdt').value==0 ||
			$('cl_hmt').value=='' || $('cl_hmt').value==0 ||
			$('cl_hyt').value=='' || $('cl_hyt').value==0) {
				$('cl_hdt').disable();
				$('cl_hmt').disable();
				$('cl_hyt').disable();
			}
	}
	$('search').submit();

}

//-->

