/**********************************************************************************************************
	LANG DEFINITION VARS
**********************************************************************************************************/
COUNTRY_NAME_US='USA';

STATE=[];
STATE['']='---';
STATE['AL']='Alabama';
STATE['AK']='Alaska';
STATE['AZ']='Arizona';
STATE['AR']='Arkansas';
STATE['CA']='California';
STATE['CO']='Colorado';
STATE['CT']='Connecticut';
STATE['DE']='Delaware';
STATE['DC']='District of Columbia';
STATE['GA']='Georgia';
STATE['FL']='Florida';
STATE['HI']='Hawaii';
STATE['ID']='Idaho';
STATE['IL']='Illinois';
STATE['IN']='Indiana';
STATE['IA']='Iowa';
STATE['KS']='Kansas';
STATE['KY']='Kentucky';
STATE['LA']='Louisiana';
STATE['ME']='Maine';
STATE['MD']='Maryland';
STATE['MA']='Massachusetts';
STATE['MI']='Michigan';
STATE['MN']='Minnesota';
STATE['MS']='Mississippi';
STATE['MO']='Missouri';
STATE['MT']='Montana';
STATE['NE']='Nebraska';
STATE['NV']='Nevada';
STATE['NH']='New Hampshire';
STATE['NJ']='New Jersey';
STATE['NM']='New Mexico';
STATE['NY']='New York';
STATE['NC']='North Carolina';
STATE['ND']='North Dakota';
STATE['OH']='Ohio';
STATE['OK']='Oklahoma';
STATE['OR']='Oregon';
STATE['PA']='Pennsylvania';
STATE['RI']='Rhode Island';
STATE['SC']='South Carolina';
STATE['SD']='South Dakota';
STATE['TN']='Tennessee';
STATE['TX']='Texas';
STATE['UT']='Utah';
STATE['VT']='Vermont';
STATE['VA']='Virginia';
STATE['WA']='Washington';
STATE['WV']='West Virginia';
STATE['WI']='Wisconsin';
STATE['WY']='Wyoming';

GENDER_MISTER='Mr';
GENDER_LADY='Mrs';
GENDER_MISS='Miss';
GENDER_NONE='NA';

RECIPIENT_SERVICE='recipient service';
SECURITY_CODE='The security code';
YOUR_EMAIL='Your email';
YOUR_EMAIL_CONFIRMATION='Your Email confirmation';
YOUR_MESSAGE='Your message';
PLEASE_CHECK='Please check';
SEND_YOUR_MESSAGE='Send Your message ?';
TOMBOLA_CONFIRM='Do you confirm Tombola partherepation : %1$s ?';
STORE_CONFIRM='Do you confirm points redeemed for a prize : %1$s ?';
NUMBER_MAXIMUM_REACHED='You have already selected %1$s numbers';
YOU_MUST_CLICK_ON_A_BANNER='You must click on a banner';
YOU_MUST_SELECT_X_NUMBERS='You must select %1$s numbers !';
NOT_VALID_EMAIL_ADDRESS='Invalid email.';
YOU_MUST_ENTER_PASS='Please enter a new password.';
YOUR_GENDER='Your title';
YOUR_NAME='Your lastname';
YOUR_FIRSTNAME='Your firstname';
YOUR_PASSWORD='Your password (Must have 2 to 10 letters/digits)';
YOUR_PASSWORD_SHORT='Your password';
YOUR_PASSWORD_CONFIRMATION='Your password confirmation';
YOUR_OLD_PASSWORD='Your previous password';
YOUR_POSTAL_ADDRESS='Your address';
YOUR_GSM_NUMBER='Your mobile phone number';
YOUR_PHONE_NUMBER='Your phone number';
YOUR_POSTCODE='Your zipcode';
YOUR_TOWN='Your city';
YOUR_STATE='Your state';
FORM_ERROR='An error as occured.\nPlease delete temporary files from Your browser and try again.\nThank you.';
PLEASE_FILL_HILIGHT_FIELDS='Please complete highlighted fields.';
YOUR_BIRTHDATE='Your date of birth';
PARTNER_SUBSCRIPTION='Partners good deals subscription';
ACCEPT_RULES='Accept Rules and T&Cs';
YOU_NEED_TO_MAKE_A_CHOICE='You need to make a choice.';
INCORRECT_NEW_EMAIL_ADDRESS='Invalid email.';
PRIZE_CHOICE='Prize choice';
EMAIL_FIELDS='email field';
TOO_OLD_BROWSER='Your navigator (internet explorer/firefox version) is too old. Please update new version available. We recommend you to use Firefox : http://www.getfirefox.com/';
LEGAL_NOTES='T&Cs and Private Policy';
LEGAL_NOTES_ALERT="Click on this button and &quot;join and play now!&quot;, your personal details will be transmitted to our company %1$s. Please check our Privacy policy for all details below";
ENDED='Terminé';
DELETE_FAVORITE='Are you sure you want to erase your lucky numbers?';
GRID_SELECT_NUMBER='Please select a grid number';
THE_GRID_NUMBER='Grid number %1$s';
DUPLICATE_GRID_NOT_COMPLETED='This grid can\'t be duplicated yet because it\'s not complete.';
ON_ALL_GRIDS='On all grids';
WS_NOTUSER='<a href="#" class="close" onclick="closePop()"><span class="nodisplay">Close</span></a><br>For security reasons, we cannot register you with this email.<br>part of your email is not recognized by our website maybe because of a mistake (webmaster email etc.)<br>Please modify it and re enter it. <br><br>';
WS_NOTDOMAIN='<a href="#" class="close" onclick="closePop()"><span class="nodisplay">Close</span></a><br>Your email may contain a mistake and need to be changed.<br>Please check your email and modify it<br><br>';
WS_CHOICES='<a href="#" class="close" onclick="closePop()"><span class="nodisplay">Close</span></a>you wanted to write : <a href=# onclick="SelectMail(\'{prop}\')">{prop}</a><br> <br> or you confirm:<br> <a href=# onclick="SelectMail(\'{mail}\')">{mail}</a>';

var lg_formPleaseCheck='Please Check :';
var lg_birthdateDay='Date of birth (day)';
var lg_birthdateMonth='Date of birth (month)';
var lg_birthdateYear='Date of birth (year)';
var lg_gender='Title';
var lg_country='Country';
var fb_pleaseFinish='<img height="11" width="16" alt="Facebook" src="http://img.mediastay.com/core/img/fbLoader.gif">';

/**********************************************************************************************************
	--- DON'T MODIFY BELOW ---
	COUNTRY SPECIFIC CONF
**********************************************************************************************************/
// profile
CIVILITE_SELECT_OPTIONS={'0':'--','1':GENDER_MISTER,'2':GENDER_LADY,'3':GENDER_MISS};
COUNTRY_SELECT_OPTIONS={'7':COUNTRY_NAME_US};
BIRTH_SELECT_ORDER={1:'month',2:'day',3:'year'};

// name of play page and delay for tracker
TRACKER_VALID_URL='play.php';
TRACKER_VALID_TIME=3000;

// img sub path (on static server)
PUB_SUBPATH='lucky';

// enabled magic number or not
ENABLED_GRID_MAGIC_NUMBER=false;

// grid per day
GRIDS_PER_DAY=10;

/**********************************************************************************************************
	COUNTRY SPECIFIC FUNCTIONS
**********************************************************************************************************/
function clearPhoneNumber(num,country){
	if(typeof(country)=='undefined') country='7';
	num=num.replace(/[^0-9+]/g,'');
	if(COUNTRIES[country]['code']=='US')
		num=num.replace(/^(\+|00)1/i,'0');
	num=num.replace(/[^0-9]/g,'');
	return(num);
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
function isValidGsmNumber(num,country){
	if(typeof(country)=='undefined') country='7';
	if(COUNTRIES[country]['code']=='US')
		return(num.match(/^[0-9]{10}$/i));
	else return(true);
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
function isValidPhoneNumber(num,country){
	if(typeof(country)=='undefined') country='7';
	if(COUNTRIES[country]['code']=='US')
		return(num.match(/^[0-9]{10}$/i));
	else return(true);
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
function isValidZipCode(zipCode,country){
	var rv=true;
	if(typeof(country)=='undefined') country='7';
	if(COUNTRIES[country]['code']=='US') return(zipCode.match(/^[0-9]{3,5}(-[0-9]{1,6})?$/i));
	return rv;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
function activateAutomaticGridValidation(){
  var isActivated;
  isActivated=$('#formGrilles input:radio:checked').val();
  if (isActivated==1) enabledGridList();
  else return(automaticSubmit(this));
}
/**********************************************************************************************************
	MDSTOOLS EXTEND
**********************************************************************************************************/

if(typeof(MFC)=='undefined'){
	var MFC={};
}
if(typeof(MFC.fieldsTypes)=='undefined'){
	MFC.fieldsTypes={};
}

MFC.fieldsTypes.gsmNumber={
	'regExp':null,
	'check':function(elm){
	        	var v=MU.formTagGetValue(elm);
	        	var rv=(v=='');
	        	var f=elm.form;
	        	if((!rv)&&f.elements['pays']){
	        		var country=MU.formTagGetValue(f.elements['pays']);
	        		if(COUNTRIES[country]['code']=='US'){
	        			v=v.replace(/^(\+|00)1/i,'0');
	        			rv=v.match(/^[0-9]{10}$/i);
	        		}else{
	        			rv=true;
	        		}
	        	}
	        	if(rv) MU.formTagSetValue(elm,v);
	        	rv=(elm.readOnly||rv);
	        	return rv;
	        }
};

MFC.fieldsTypes.homeNumber={
	'regExp':null,
	'check':function(elm){
	        	var v=MU.formTagGetValue(elm);
	        	var rv=(v=='');
	        	var f=elm.form;
	        	if((!rv)&&f.elements['pays']){
	        		var country=MU.formTagGetValue(f.elements['pays']);
	        		if(COUNTRIES[country]['code']=='US'){
	        			v=v.replace(/^(\+|00)1/i,'0');
	        			rv=v.match(/^[0-9]{10}$/i);
	        		}else{
	        			rv=true;
	        		}
	        	}
	        	if(rv) MU.formTagSetValue(elm,v);
	        	rv=(elm.readOnly||rv);
	        	return rv;
	        }
};

MFC.fieldsTypes.zipcode={
	'regExp':null,
	'check':function(elm){
	        	var v=MU.formTagGetValue(elm);
	        	var rv=true;
	        	var f=elm.form;
	        	if(f.elements['pays']){
	        		var country=MU.formTagGetValue(f.elements['pays']);
	        		if(COUNTRIES[country]['code']=='US'){
	        			v=v.replace(/[^0-9-]/,'');
	        			rv=v.match(/^[0-9]{3,5}(-[0-9]{1,6})?$/i);
	        		}else{
	        			v='';
	        			rv=true;
	        		}
	        	}else{
	        		v='';
	        	}
	        	if(rv) MU.formTagSetValue(elm,v);
	        	rv=(elm.readOnly||rv);
	        	return rv;
	        }
};

