var CLICKINMAIL = new Object();
CLICKINMAIL.hideSomeElements = function(mode)
{
}
CLICKINMAIL.hideSomeElements(0);
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
var leftPos = (myWidth - 806) / 2;
var heightPos = (myHeight - 470) / 2 - 20;
CLICKINMAIL.png = function(src, w, h)
{
if (document.all)
{
return '';
}
else
{
return '
';
}
}
/*
Ouvrons la fenetre en grand
*/
var CIMdiv = document.createElement('div');
CIMdiv.style.position = 'fixed';
CIMdiv.style.top = 0;
CIMdiv.style.bottom = 0;
CIMdiv.style.left = 0;
CIMdiv.style.right = 0;
CIMdiv.style.zIndex = 99999999999999999;
/* LE FORMULAIRE DE VALIDATION */
var div = CIMdiv.appendChild(document.createElement('div'));
div.style.position = 'absolute';
div.style.top = 0;
div.style.bottom = 0;
div.style.left = 0;
div.style.right = 0;
div.style.color = 'white';
div.style.zIndex = 2;
div.style.fontWeight = 'bold';
div.style.fontSize = '20px';
var inner = '';
inner += '
' +
'
' + CLICKINMAIL.png('/pics/dhtml.png', '806', '470') + '
' +
'
' +
'Inscrivez vous à Reduc & Co.com pour bénéficier de la réception gratuite de bons plans par email ! Simple et rapide !' +
'
' +
'
' +
'' +
'
' +
'
' +
'' +
'
' +
'
' +
'' +
'
' +
/* coche */
'
' +
'
' + CLICKINMAIL.png('http://fr.cim.clickintext.net/pics/coche.png', '29', '29') + '
' +
'
' +
'
' +
/* cgv */
'
' +
/* valider */
'
' +
/* error */
'
' + CLICKINMAIL.png('http://fr.cim.clickintext.net/pics/error.png', '24', '24') + '
' +
'
';
div.innerHTML = inner;
/* LE FOND NOIR */
var b = document.getElementsByTagName("body")[0];
if (b.firstChild != null) b.insertBefore(CIMdiv, b.firstChild);
else b.appendChild(CIMdiv);
document.getElementById('CIMEmail').focus();
CLICKINMAIL.validate = function()
{
var checked = document.getElementById('CIMEmail').value.match(/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})+$/i);
if (!checked)
{
alert("Vous devez saisir une adresse email valide.");
return;
}
var checked = !(document.getElementById('CIMCGV').style.display != '');
if (!checked)
{
document.getElementById('CIMClignoError').style.display = '';
alert("Vous devez accepter les conditions d'utilisation en cochant la case indiquée par le point d'exclamation.");
CLICKINMAIL.cligno();
return;
}
CLICKINMAIL.hideSomeElements(1);
window.open('/perso.php?' +
'e=' + escape(document.getElementById('CIMEmail').value) + '&' +
'p=' + escape(document.getElementById('CIMPrenom').value) + '&' +
'n=' + escape(document.getElementById('CIMNom').value),
'', "status=0,toolbar=0,location=0,menubar=0,directories=0,resizeable=0,scrollbars=0,height=420,width=550");
return false;
}
CLICKINMAIL.cligno = function()
{
var checked = !(document.getElementById('CIMCGV').style.display != '');
if (!checked)
{
document.getElementById('CIMClignoError').style.display = document.getElementById('CIMClignoError').style.display == '' ? 'none' : '';
setTimeout(CLICKINMAIL.cligno, 500);
}
else
document.getElementById('CIMClignoError').style.display = 'none';
}