var holan={
  marka:function(element,lang){
    $$("#select_model option")._each(
      function(element){
        if(element.value!="0"){
          element.parentNode.removeChild(element)
        }
      }
    )
    if(element.value!=0){
      $("select_model").disabled=false
      new Ajax.Request(
        '/'+lang+'/ajax_select/'+element.value,
        {
          asynchronous:true,
          evalScripts:false,
          onSuccess:function(request){
            var tablica=eval(request.responseText)
            tablica._each(
              function(element){
                if(element.value){
                  var option=document.createElement("option")
                  option.value=element.value
                  option.innerHTML=element.title
                  $("select_model").appendChild(option)
                }
              }
            )
          }
        }
      );
    }else{
      $("select_model").disabled=true
    }
    return true;
  },
  model:function(element){
    if(element.value!="0"){
      document.location=element.value;
    }
  },
  katalog:function(lang){
    new Ajax.Request(
      '/'+lang+'/ajax_catalog/'+$("input_katalog").value,
      {
        asynchronous:true,
        evalScripts:false,
        onSuccess:function(request){
          eval(request.responseText)
          if(wynik.errorText){
            alert(wynik.errorText)
            return false;
          }else{
            document.location=wynik.valueText
            return false;
          }
        }
      }
    )
    return true
  }
}