function switch_box(box) {
  
  var item_id;
  
  if (box == 'home')
  {
    item_id = 1;
  }
  else if (box == 'references')
  {
    item_id = 2;
  }
  else if (box == 'services')
  {
    item_id = 3;
  }
  else if (box == 'partners')
  {
    item_id = 4;
  }
  else if (box == 'contact')
  {
    item_id = 5;
  }
  else
  {
    return;
  }
  
  stepcarousel.stepTo('main_container', item_id);
}

function change_input_color(obj, type) {
	
	if (type == 'active') {
		obj.style.backgroundColor = '#b4a598';
	}
	else if(type == 'inactive') {
		obj.style.backgroundColor = '';
	}
}

function mail() {
	
	var contact_form = document.getElementById('contact_form');
	
	var lastname = contact_form.lastname.value;
	var firstname = contact_form.firstname.value;
	var address = contact_form.address.value;
	var society = contact_form.society.value;
	var email = contact_form.email.value;
	var message = contact_form.message.value;
	
	document.getElementById('ajax_loader').style.display = '';
	
	jQuery.ajax({
	  type: 'POST',
	  url: '/ajax/mail.php',
		data: ({lastname: lastname, firstname: firstname, address: address, society: society, email: email, message: message}),
		dataType: 'json',
		success: function(json)
		{
		  document.getElementById('ajax_loader').style.display = 'none';
		  
			if (typeof(json.error) != 'undefined') {
				alert(json.error);
			}
			else if (typeof(json.success) != 'undefined') {
				document.forms.contact_form.reset();
				alert(json.success);
			}
		}
	});
}