//
// Popup
//
function popup(url, name, width, height)
{
  newwindow = window.open(url, name, 'width='+width+', height='+height+', toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes');
  newwindow.focus();
}

function PopupNoScroll(url, name, width, height) {
  newWindow = window.open(url, name, 'width=' + width + ',height=' + height + ',status=no toolbar=no, location=no, directories=no, menubar=no, scrollbars=yes, resizable=no');
}

function checkMail(email) {
  var espressione = /^[_a-z0-9+-]+(\.[_a-z0-9+-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/;
  if (!espressione.test(email)) {
    alert("La mail inserita non è valida!");
    return false;
  }
  return true;
}

/*
*  INIT 
*/
$(document).ready(function() {
/*
  // al click nascondo bottoni con classe hideJs
  $('.hideJs').click(function() {
    $(this).toggle();
  });
*/
});

//
// sistema per testare se ho i cookie abilitati
//
anonymous = $.cookie('anonymous_user');
if (anonymous == null) {
  $.cookie('tmpcookie', '111', { path: '/', domain: '.traderlink.it' });  
  var valCookie = $.cookie('tmpcookie');
  // cookie abilitati
  if (valCookie != null) {
    $.get('/ajax/set_user.php', function(data) {
    }); 
  } 
}

