
var flag = 0;

function clear_input(element)
{
  if (flag == 0)
    element.value = '';
  flag = 1;
}

function updateSurface(id)
{
  $('content-1').style.display = 'none';
  $('content-2').style.display = 'none';
  $('content-3').style.display = 'none';
  $('content-4').style.display = 'none';
  $('content-5').style.display = 'none';
  $('content-6').style.display = 'none';
  $('content-7').style.display = 'none';
  $('li-1').style.textDecoration = "none";
  $('li-2').style.textDecoration = "none";
  $('li-3').style.textDecoration = "none";
  $('li-4').style.textDecoration = "none";
  $('li-5').style.textDecoration = "none";
  $('li-6').style.textDecoration = "none";
  $('li-7').style.textDecoration = "none";
  $('content-'+id).style.display = 'block';
  $('li-'+id).style.textDecoration = "underline";
}

function formMail(lang,ref)
{
  req = new Ajax.Updater('encartmiddle','/'+lang+'/craft.sendMail',{method: 'POST', parameters: {'friendmail':$('inputfriendmail').value,'yourname':$('inputyourname').value, 'friendname':$('inputfriendname').value, 'yourmess':$('inputyourmess').value, 'lang':lang,'ref':ref}});
}