 function validateForm(button) {
    var myform = $(button).parent();
    var empty = false;
    $("#form1 input[type='text']").each(function(index) {
      if($(this).val() == "") {
        $(this).css('background','#b5d3e3');
        empty = true;
      }
    });
    $("#form1 select").each(function(index) {
      if($(this).val() == "") {
        $(this).css('background','#b5d3e3');
        empty = true;
      }
    });
    if (empty) {
      alert( $('#alert-message').val() );
      return false;
    }
	return true;
  };
  

jQuery(document).ready(function($){
  $('.portlet-link').click(function(){
    $('.portlet').hide();
    $('.portlet-link').removeClass('selected');
    $(this).addClass('selected');
    $('#portlet-'+$(this).attr('data-id')).show();
    return false;
  });
  
  $('#form1 input').keyup(function(){
    $(this).css('background','');
  });
  $('#form1 select').change(function(){
    $(this).css('background','');
  });
 
 
  $('#lang-selector a').click(function(e){
    e.preventDefault();
    var exdate = new Date();
    exdate.setDate(exdate.getDate()+365);
    document.cookie = "MarinSoftwareLanguage = "+escape($(this).attr('data-lang'))+";expires="+exdate.toUTCString()+";path=/";
    window.location.reload();
  });
});
