// JavaScript Document

function trim(s)
{
	return s.replace(/(^\s*)|(\s*$)/g, "");
}

function checkMail(e)
{
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	return filter.test(e);
}

function isDouble(s) {
	var filter = /^[0-9]+([\.\,][0-9]+)?$/;
	return filter.test(s);
}

function isFrGSM(s) {
	return (s.substring(0,2)=='06' || s.substring(0,2)=='00');
}


function PopupCentrer(page,largeur,hauteur, win_name) {

  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;

  window.open(''+page+'', win_name,
	'top='+top+',left='+left+',toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=1,copyhistory=0,menuBar=0,width='+largeur+',height='+hauteur+'');
}

function PopupCentrer_ns(page,largeur,hauteur, win_name) {

  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;

  window.open(''+page+'', win_name,
	'top='+top+',left='+left+',toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=1,copyhistory=0,menuBar=0,width='+largeur+',height='+hauteur+'');
}

var TicketGagnant = {
	pop: function(url, name, width, height, extraParam) {
		var pos_top=(screen.height-height)/2;
		var pos_left=(screen.width-width)/2;

		extraParam = (extraParam != undefined) ? ',' + extraParam : '';
		return window.open(url, name, 'top='+pos_top+',left='+pos_left+',toolbar=0,location=0,directories=0,status=0,resizable=1,copyhistory=0,menuBar=0,width='+width+',height='+height + extraParam);
	}
};
