function getCompany() {
	var name = $('company').value;
	var pcode = $('pcode').value;
	var suges = $('suges');
	  if(name != '' && pcode != '')
	{
	    new Ajax.Request('/soap/getcompany.php?name='+name+'&pcode=' + pcode, {
  			method: 'get',
  			onComplete: function(respons) {
  				if (respons.status == 200) {
				  if(respons.responseText != '') {
    				 suges.update(respons.responseText);
					 suges.show();
				  }
  				}
  			}
			});
    }
}

function setCompany(name) {
    
	  if(name != '')
	{
	    new Ajax.Request('/soap/setcompany.php?mskey='+name, {
  			method: 'get',
  			onComplete: function(respons) {
  				if (respons.status == 200) {
				   var txt = respons.responseText.evalJSON();;
				   
				    jQuery("input[name='company']").setValue(txt.name);
				    jQuery("input[name='pcode']").setValue(txt.pcode);
				    jQuery("input[name='adres']").setValue(txt.house_number + ', ' +txt.street);
				    jQuery("input[name='city']").setValue(txt.city);
				    jQuery("input[name='phone']").setValue(txt.phone);
				    jQuery("input[name='fax']").setValue(txt.fax);
				    jQuery("input[name='activity']").setValue(txt.activity);
				    jQuery("input[name='nemployed']").setValue(txt.nemployed);
				    jQuery("input[name='statuscode']").setValue(txt.status);
				  
				  closeSuges();
				  
  				}
  			}
			});
    }
	
	
    
   
}

function showSuges() {
   var suges = $('suges');
   suges.show();
}

function closeSuges() {
   var suges = $('suges');
   suges.hide();
}