

var idPopup = '3694' ;

var formWidth = '500';
var formHeight = '300';
var iframeSource = 'http://events.wokup.com/events/web2mobile';
var fontColor = '#000000';
var fontSize = '16';
var fontType = 'arial';
var bodyMessage = 'Votre numéro de mobile :';
var bodyBackgroundColor = '#FFFFFF';
var sendMessage = 'L\'inscription est prise en compte.<br /> Vous allez recevoir un SMS de confirmation.';
var alignment = 'left';
var alertErrorMessage = 'Merci de saisir un numéro valide.';
var buttonMessage = 'Valider';

function web2mobileSubmite() { //v1.2
	var formError = "";
	var oForm = document.getElementById("web2mobileForm");
	msisdnInput= oForm.msisdn;
	if ((msisdnInput.value.length != 10) || (msisdnInput.value.indexOf("06") == -1)) {
		formError += alertErrorMessage;
	}
	if ( formError != "") {
		alert(formError);
		return false;
	} else {
		var Node1 = document.getElementById("web2mobileDivForm");
		while (Node1.hasChildNodes()) {
			Node1.removeChild(Node1.lastChild);
		}
		Node1.style.display="none" ;
		document.getElementById("web2mobileDivResponse").style.display="block";
		var oLocation = iframeSource + "?idWeb2Mobile=" + idPopup + "&msisdn=" + msisdnInput.value;


		oLocation += '&nom=';
		var oInput = oForm.elements['nom'];
		if (oInput.type == 'checkbox') {
			 if (oInput.checked)
				oLocation += 'true';
			 else
				oLocation += 'false';
		}
		else {
			oLocation += encodeURIComponent(oInput.value) ;
		}

		oLocation += '&prenom=';
		var oInput = oForm.elements['prenom'];
		if (oInput.type == 'checkbox') {
			 if (oInput.checked)
				oLocation += 'true';
			 else
				oLocation += 'false';
		}
		else {
			oLocation += encodeURIComponent(oInput.value) ;
		}

		oLocation += '&anneenaissance=';
		var oInput = oForm.elements['anneenaissance'];
		if (oInput.type == 'checkbox') {
			 if (oInput.checked)
				oLocation += 'true';
			 else
				oLocation += 'false';
		}
		else {
			oLocation += encodeURIComponent(oInput.value) ;
		}

		oLocation += '&acceptationoffrescommerciales=';
		var oInput = oForm.elements['acceptationoffrescommerciales'];
		if (oInput.type == 'checkbox') {
			 if (oInput.checked)
				oLocation += 'true';
			 else
				oLocation += 'false';
		}
		else {
			oLocation += encodeURIComponent(oInput.value) ;
		}


		frames['web2mobileIframe'].location = oLocation
		return false;
	}
}

document.writeln("<style>") ;
document.writeln(".web2mobile{") ;
document.writeln("font-size:12px;font-family:arial;width:300px;") ;
document.writeln("}") ;

document.writeln("#web2mobileDivParent{") ;
document.writeln("position:relative;padding-top:10px;margin:0px;padding-left:195px;background:url(http://im2.a2w.fr/openrennes/images/web2mobilealerteetconcours_2011.png);background-repeat:no-repeat;width:509px;height:292px;") ;
document.writeln("}") ;


document.writeln("</style>") ;

document.writeln("<div id=\"web2mobileDivParent\"> ");

document.writeln("<div id=\"web2mobileDivForm\" style=\"width:"+formWidth+"px;height:"+formHeight+ "px;\"> ");
document.writeln("	<form method=\"get\" id=\"web2mobileForm\" onSubmit=\"return web2mobileSubmite();\">");
document.writeln("	  <table class='web2mobile'\"> ");


document.writeln("			<tr>");
document.writeln("			<td>");
document.writeln(bodyMessage);
document.writeln("			</td>");
document.writeln("			<td>");


document.writeln("				<input size=\"10\" maxlength=\"10\" type=\"text\" name=\"msisdn\">");


document.writeln("			</td>");
document.writeln("			</tr>");

document.writeln("			<tr>");
document.writeln("			<td>");
document.writeln('			Votre nom :');
document.writeln("			</td>");
document.writeln("			<td>");


document.writeln('			<input value="" type="text" name="nom" id="Any"></input>');


document.writeln("			</td>");
document.writeln("			</tr>");

document.writeln("			<tr>");
document.writeln("			<td>");
document.writeln('			Votre prénom :');
document.writeln("			</td>");
document.writeln("			<td>");


document.writeln('			<input value="" type="text" name="prenom" id="Any_0"></input>');


document.writeln("			</td>");
document.writeln("			</tr>");

document.writeln("			<tr>");
document.writeln("			<td>");
document.writeln('			Votre année de naissance :');
document.writeln("			</td>");
document.writeln("			<td>");


//document.writeln('			<input value="" type="text" name="anneenaissance" id="Any_1"></input>');
document.writeln('			<select name="anneenaissance" >');
document.writeln('<option value="" selected="selected"></option>');
for (i = 2009 ; i > 1900 ; i--)
{
	document.writeln('<option value="'+i+'">'+i+'</option>');
}
document.writeln('			</select>');

document.writeln("			</td>");
document.writeln("			</tr>");

document.writeln("			<tr>");
document.writeln("			<td colspan=\"2\">");
document.writeln('			<input type="checkbox" name="acceptationoffrescommerciales" checked="checked"></input>');

document.writeln('			J\'accepte de recevoir des offres commerciales des partenaires de l\'Open de Rennes (coupons de réductions,...).');

document.writeln("			</td>");
document.writeln("			</tr>");

document.writeln("			<tr>");
document.writeln("			<td colspan=\"2\" style='text-align:justify;font-size:10px;font-style:italic;'>");
document.writeln('			En validant votre inscription, vous participez automatiquement au concours pour gagner 2 places VIP pour la finale de l\'Open de Rennes. Les participations au concours seront arrêtées le vendredi 14 octobre à 10h00. Le gagnant sera prévenu le vendredi 14 octobre par téléphone.');
document.writeln("			</td>");
document.writeln("			</tr>");


document.writeln("		<tr><td colspan=\"2\" style='text-align:center;'>");
document.writeln("				<input type=\"button\" onclick=\"web2mobileSubmite();\" name=\"Submit\" value=\""+buttonMessage+"\">");
document.writeln("		</td></tr>");
document.writeln("	  </table>");
document.writeln("	<input name=\"idWeb2Mobile\" style=\"display:none;\" type=\"hidden\" value=\""+idPopup+"\">");
document.writeln("	</form>");

document.writeln("</div>");



document.writeln("<div id=\"web2mobileDivResponse\" style=\"display:none;width:"+formWidth+"px;height:"+formHeight+ "px;\"> ");
document.writeln("	  <table border=\"0\" style=\"width:100%;height:100%\"> ");
document.writeln("		<tr>");
document.writeln("		  <td><div align=\"center\" style=\"font-family:"+fontType +";font-size:12px;color:"+fontColor+";text-align:"+alignment+";\">"+sendMessage+"</div></td>");
document.writeln("		</tr>");
document.writeln("	  </table>");
document.writeln("</div>");



document.writeln("<iframe name=\"web2mobileIframe\" style=\"width:0px;height:0px;display:none;\"></iframe>");

document.writeln("</div> ");
