		function select(arrayname,idname,selectname,selectedid,typeofselect,onselect,choose,widtha)
	{
		result = arrayname;
		var list = document.getElementById(idname);
		if (!list) return false;
		var lp = list.parentNode;
		var Oselect = document.createElement('select');
		
		
		Oselect.setAttribute('name', selectname );
    Oselect.setAttribute('id', idname );
    
      if (widtha) {
      Oselect.style.width=widtha+'px';
      
      //('style', 'width: '+width+'px;');
      
      //Oselect.className=classname;
      }
      else {
      Oselect.className='styleinput_text';
      }
    
    
    if (typeofselect) {
          Oselect.setAttribute('size', result.length );
          Oselect.setAttribute('multiple', 'multiple');
    }
    else {
        //if (onselect) { Oselect.setAttribute('onChange', onselect+'()');}
          if (onselect) {
      Oselect.onchange = function (evt) {
        eval(onselect+'()');
        };
      }

		  var Ooption = document.createElement('option');
		  Ooption.setAttribute('value', '0');
		  
		  if (selectedid=='0') 
          Ooption.setAttribute('selected', 'selected');
      if (!choose && lang[0] == 1) choose='Избери';
      if (!choose && lang[0] == 0) choose='Choose';
		  Ooption.appendChild(document.createTextNode('-- '+choose+' --'));
		  Oselect.appendChild(Ooption);

    
    }

    
    
   // Oselect.className='styleinput_text';

				for (var j=0; j<result.length; j++)
		{
			var Ooption = document.createElement('option');			
			
			for (var h=0; h<result[j].length; h++)
			{ 
				var value = result[j][h].split('=');				
				if (value[0]=='id') var id = value[1];
				Ooption.setAttribute('value', id);
				if (typeofselect){
  				for (var s=0; s<selectedid.length; s++){
  				var selected = selectedid[s];
    				if (selected==value[1]){
    				Ooption.setAttribute('selected', 'selected');
    				}
  				}
        }
				if (selectedid==value[1]){
				Ooption.setAttribute('selected', 'selected');
				}
				if (value[0]=='name'){
					Ooption.appendChild(document.createTextNode(value[1]));					
				}

					Oselect.appendChild(Ooption);
			}
    }

				lp.removeChild(list);
				lp.appendChild(Oselect);
        		
	}

  function gettype(choose,stype){
  if (!stype) stype=0;
    selectinput = document.getElementById("I_want_to");
    if (selectinput)
    var val=selectinput.value;
    if (!choose) choose = '';
    select(obj_props.GetTypes(obj_db,lang[0],val),'type','type',stype,'','',choose);
  
  var tectel = document.getElementById("hidetectel");
  var floor = document.getElementById("hidefloor");
  if (val== 9 || val==4){
    tectel.style.display='inline';
    floor.style.display='inline';
  }
  else {
    tectel.style.display='none';
    floor.style.display='none';
  }
  printGlsl();
  }


  function printGlsl(){
    var division= document.getElementById('Glsl');
    if (division) {
      var val = document.getElementById('I_want_to').value;
      division.innerHTML=obj_props.Glsl(obj_db,lang[0],val)
    }
  }


  function sublocationselect(ssloc){
  if(!ssloc) ssloc = 0;
  selectinput = document.getElementById("location");
  if (selectinput) {
  var id = selectinput.value;
  select(obj_props.GetSubLocations(obj_db,id,lang[0]),'sublocation','sublocation',ssloc);
  }}
	
		function showdiv(){
  var div = document.getElementById('searchdiv');
  if (div) {
  divstyle=div.style.display;
  if (divstyle == 'none'){
  div.style.display = "block";
  };
  
  if (divstyle == 'block'){
    div.style.display ="none";
    };
  }
  };
	
