
var afa = new String();var afb = new String();var afc = new String();var afd = new String();

// ----------------- 1ere inscription client ---------

function inscrire()
{
a2 = document.send.f_name.value;
a1 = document.send.l_name.value;
a3 = document.send.ncountry.selectedIndex;
a4 = document.send.agre.checked;

if (a2 == "")
	{alert(jvs5);return;}
if (a1 == "")
	{alert(jvs3);return;}
if ((a1.charAt(0) == "&#32") || (a1.charAt(0) == " "))
	{alert(jvs4);return;}
if (a3 == 0)
	{alert(jvs6);return;}
if (a4 == false)
	{alert(jvs7);return;}
else
	{document.send.submit();}
}

// ----------------- question suivante test gratuit ---------

function suite()
{
document.answer_q.submit();
}

// ----------------- verifiaction remplissage question test gratuit ---------


function contr(n)
{

eval("acx = document.getElementById('q"+ n +"').value;")

if(acx != "")
	{
	abx = acx.charAt(0);
	if (!(abx-0))
		{alert(jvs8);eval("document.getElementById('q"+ n +"').value= '';");return;}

	if (acx > 4)
		{alert(jvs9);eval("document.getElementById('q"+ n +"').value= '';");return;}

	}

if (n==1)
	{lettre = "A";}
if (n==2)
	{lettre = "B";}
if (n==3)
	{lettre = "C";}
if (n==4)
	{lettre = "D";}
if (n==5)
	{lettre = "E";}
if (n==6)
	{lettre = "F";}
if (n==7)
	{lettre = "G";}
if (n==8)
	{lettre = "H";}
if (n==9)
	{lettre = "I";}

if (abx==0)
	{afa = '';afb = '';afc = '';afd = '';}

if (abx==1)
	{afa = lettre;
	if (afb == lettre)
		{afb = '';}
	if (afc == lettre)
		{afc = '';}
	if (afd == lettre)
		{afd = '';}
	}

if (abx==2)
	{afb = lettre;
	if (afa == lettre)
		{afa = '';}
	if (afc == lettre)
		{afc = '';}
	if (afd == lettre)
		{afd = '';}
	}

if (abx==3)
	{afc = lettre;
	if (afa == lettre)
		{afa = '';}
	if (afb == lettre)
		{afb = '';}
	if (afd == lettre)
		{afd = '';}
	}

if (abx==4)
	{afd = lettre;
	if (afa == lettre)
		{afa = '';}
	if (afb == lettre)
		{afb = '';}
	if (afc == lettre)
		{afc = '';}
	}


document.garder.aff1.value = afa;
document.garder.aff2.value = afb;
document.garder.aff3.value = afc;
document.garder.aff4.value = afd;


}

function miseazero()
{
for (i = 1 ; i < 10 ; i++)
	{eval("document.getElementById('q"+ i +"').value= '';")}

document.garder.aff1.value = "";
document.garder.aff2.value = "";
document.garder.aff3.value = "";
document.garder.aff4.value = "";

afa = '';
afb = '';
afc = '';
afd = '';

}

function verif()
{
btot = 0;
tbx = new Array;
infox = 0;

tbx[0] = Math.round(document.getElementById('q1').value);
tbx[1] = Math.round(document.getElementById('q2').value);
tbx[2] = Math.round(document.getElementById('q3').value);
tbx[3] = Math.round(document.getElementById('q4').value);
tbx[4] = Math.round(document.getElementById('q5').value);
tbx[5] = Math.round(document.getElementById('q6').value);
tbx[6] = Math.round(document.getElementById('q7').value);
tbx[7] = Math.round(document.getElementById('q8').value);
tbx[8] = Math.round(document.getElementById('q9').value);


for (j = 0 ; j < 9 ; j++)
	{
	if (tbx[j] != 0)
		{
		tbtest = tbx[j];
		infox = 0;
		for (i = 0 ; i < 9 ; i++)
			{
			if (tbtest == tbx[i])
				{infox = infox + 1;
				if (infox > 1) 
					{alert(jvsa1);return;}
				}
			}
		}
	}


for (i = 0 ; i < 9 ; i++)
	{btot = btot + tbx[i];}

if (btot > 10)
	{alert(jvs10);miseazero();return;}

if ((btot > 6) && (btot != 10))
	{alert(jvs11);;miseazero();return;}

if ((btot > 3) && (btot != 6) && (btot != 10))
	{alert(jvs12);;miseazero();return;}


afa = document.garder.aff1.value;
afb = document.garder.aff2.value;
afc = document.garder.aff3.value;
afd = document.garder.aff4.value;


if (afa == "")
	{alert(jvs13);miseazero();return;}
if ((afb == "") && (afc != ""))
	{alert(jvs14);miseazero();return;}
if ((afc == "") && (afd != ""))
	{alert(jvs15);miseazero();return;}

else
	{document.questionnaire.submit();}

	
}

function verifsub1(x)
{

nx = 0;
bz = 0;

for (var i = 0; i < x; i++)
	{
	nx = nx + 1;
	eval("repon = document.getElementById('q"+ nx +"').checked;")

 	if (repon == true)
		{bz = bz + 1;}
	}

if (bz == 0)
	{alert(jvs16);return;}
else
	{document.questionnaire.submit();}
}

function verifsub2(x)
{

nx = 0;
bz = 0;

for (var i = 0; i < x; i++)
	{
	nx = nx + 1;
	eval("repon = document.getElementById('q"+ nx +"').checked;")

 	if (repon == true)
		{
		eval("valeurprofil = document.getElementById('q"+ nx +"').value;")
		bz = bz + 1;

		if ((valeurprofil == 3) || (valeurprofil == 6) || (valeurprofil == 9))
			{ fiche = "career-advice-email-the-report-beforereading-page2.asp"}
		else
			{ fiche = "career-advice-questionnaire-page73.asp"}
		}
	}

if (bz == 0)
	{alert(jvs16);return;}
else
	{document.questionnaire.action = fiche;document.questionnaire.submit();}
}


// ----------------- faire apparaitre le private policy ---------

var item1 = null;

function privacypolicy(newItem)
{
if(item1)
	{item1.style.visibility='hidden';}

item1 = document.getElementById(newItem);
item1.style.visibility='visible';
}

function closelement(newItem)
{

item1 = document.getElementById(newItem);
item1.style.visibility='hidden';
}

// ----------------- faire apparaitre le help ---------

var item2 = null;

function helpx(newItem)
{
if(item2)
	{item2.style.visibility='hidden';}

item2 = document.getElementById(newItem);
item2.style.visibility='visible';
}

function closelement(newItem)
{

item2 = document.getElementById(newItem);
item2.style.visibility='hidden';
}



// ----------------- rapport test gratuit ---------


function rapport(x,y)
{
if (x == 1)
	{
	txmail = document.getElementById('adress-mail').value;

	if (txmail == "")
		// {alert(jvs17);return;}
		{
		document.suite_rapport.asend.value= 0;
		document.suite_rapport.action = 'career-advice-report-page.asp';
		}

	else
		{
		var rgEx = /^.+@[^\.].*\.[a-z]{2,}$/;
		var OK = rgEx.exec(txmail);

		if(!OK) 
			{alert(jvs18);
			document.getElementById('adress-mail').value = '';return;}

		else 	{
			document.suite_rapport.action = 'career-advice-report-emailed.asp';
			document.suite_rapport.from_p1.value = y;
			}
		}


	}

if (x == 2)
	{
	txmail = document.getElementById('adress-mail').value;
	if (txmail == "")
		{document.suite_rapport.asend.value= 0;}
	else
		{
		var rgEx = /^.+@[^\.].*\.[a-z]{2,}$/;
		var OK = rgEx.exec(txmail);

		if(!OK) 
			{alert(jvs18);
			document.getElementById('adress-mail').value = '';return;}
		else
			{
			document.suite_rapport.asend.value= 1;
			}
		}
	if (y == 0)
		{document.suite_rapport.action = 'career-advice-report-page.asp';}
	if (y == 1)
		{document.suite_rapport.action = 'career-advice-freereport-lastpage.asp';}
	}

document.suite_rapport.submit();
}

// ----------------- ???? ---------

function suiv(xx)
{
if (xx == 10)
	{
	//a1 = document.getElementById('devise').selectedIndex;
	//a2 = document.getElementById('devise').options[a1].value;
	//document.suivante.dv.value = a2;
	document.suivante.action = 'career-advice-offerings.asp';}

if (xx == 11)
	{document.suivante.action = 'career-advice-specific-offer.asp';}

if (xx == 12)
	{document.suivante.action = 'career-test-detailed-contents.asp';}

if (xx == 13)
	{document.suivante.action = 'finding-your-path-detailed-contents.asp';}

if (xx == 14)
	{document.suivante.action = 'career-test-testimonials-upgrade.asp';}

if (xx == 15)
	{document.suivante.action = 'finding-your-path-detailed-contents2.asp';}

if (xx == 16)
	{document.suivante.action = 'career-test-testimonials.asp';}


document.suivante.submit();

}

// ----------------- ???? ---------

function bac_prev(xy)
{
document.suivante.action = xy;
document.suivante.submit();
}

// ----------------- ???? ---------

function command(xx)
{
document.commande.product.value = xx;
document.commande.submit();
}

// ----------------- ???? ---------

function chgdevise()
{
document.changdev.submit();
}

// ----------------- ???? ---------

function paiement()
{

a1 = document.ordering.f_name.value;
a2 = document.ordering.l_name.value;
a3 = document.ordering.adres.value;
a4 = document.ordering.zip.value;
a5 = document.ordering.city.value;
a6 = document.ordering.country.selectedIndex;
a7 = document.ordering.email.value;

buttons = document.ordering.paie;


if (a1 == "")
	{alert(jvs19);return;}
if (a2 == "")
	{alert(jvs20);return;}
if (a3 == "")
	{alert(jvs21);return;}
if (a4 == "")
	{alert(jvs221);return;}
if (a4.length > 10)
	{alert(jvs222);return;}
if (a5 == "")
	{alert(jvs23);return;}
if (a6 == 0)
	{alert(jvs24);return;}
if (a7 == "")
	{alert(jvs25);return;}

mval = new String (a7)
mAro = mval.indexOf("@")
mPnt = mval.indexOf(".")

if (a7.length < 6)
	{alert(jvs31);return;}
if ((a7 != "") && ((mAro == -1) || (mPnt == -1)))
	{alert(jvs31);	return;}
	

else
	{document.ordering.submit();}

}

// ----------------- suite paiement ---------

function suitepaiement()
{
buttons = document.ordering.paie;

if ((buttons[0].checked == false) && (buttons[1].checked == false))
	{alert(jvs26);return;}

else
	{
	if (buttons[0].checked)
		{document.ordering.action = 'choix_cartes_bancaires.asp'}
	if (buttons[1].checked)
		{document.ordering.action = 'career-advice-transfer-instructions.asp'}

	document.ordering.submit();}

}

// ----------------- ???? ---------

function again()
{
buttons = document.re_ordering.paie;

if ((buttons[0].checked == false) && (buttons[1].checked == false))
	{alert(jvs26);return;}

else
	{
	if (buttons[0].checked)
		{document.re_ordering.action = 'choix_cartes_bancaires.asp'}
	if (buttons[1].checked)
		{document.re_ordering.action = 'career-advice-transfer-instructions.asp'}

	document.re_ordering.submit();}

}

// ----------------- voir le fichier PDF du produit ---------

function action1(x,y) // - ouvrir fichier PDF x = n°produit , y = fichier pdf
{

window.open('see_pdf.asp?p='+ x +'&s='+ y +'','pdf','scrollbars=yes,left=0,top=0,screenX=0,screenY=0');
	
}

// ----------------- ???? ---------

function action2(x) // - commander produit
{
document.ordering.product.value = x;
document.ordering.submit();
}

// ----------------- selection paiement sur order form ---------

function suitepaiement()
{

buttons = document.ordering.paie;

if ((buttons[0].checked == false) && (buttons[1].checked == false))
	{alert(jvs26);return;}
	

else
	{
	if (buttons[0].checked)
		{document.ordering.action = 'choix_cartes_bancaires.asp'}
	if (buttons[1].checked)
		{document.ordering.action = 'career-advice-transfer-instructions.asp'}

	document.ordering.submit();}

}

// ----------------- selection paiement sur career-advice-payment-method---------

function paiment(x)
{

if (x == 1)
	{document.cb.submit();}
if (x == 2)
	{document.transfer.submit();}
if (x == 3)
	{document.paypal.submit();}
}

// ----------------- function affiliates ---------

function affiliates()
{
a1 = document.envoi.f_name.value;
a2 = document.envoi.l_name.value;

a4 = document.envoi.email.value;
a5 = document.envoi.remail.value;
a6 = document.envoi.phone.value;
a7 = document.envoi.street.value;
a8 = document.envoi.city.value;
a9 = document.envoi.state.value;
a10 = document.envoi.country.selectedIndex;
a11 = document.envoi.zipcode.value;
a12 = document.envoi.w_urls.value;
a13 = document.envoi.aver.value;

mval = new String (a4)
mAro = mval.indexOf("@")
mPnt = mval.indexOf(".")

if (a1 == "")
	{alert(jvs27);return;}
if (a2 == "")
	{alert(jvs28);return;}

if (a4 == "")
	{alert(jvs30);return;}
if (a4.length < 6)
	{alert(jvs31);return;}
if ((a4 != "") && ((mAro == -1) || (mPnt == -1)))
	{alert(jvs31);	return;}
if (a5 != a4)
	{alert(jvs32);return;}
if (a6 == "")
	{alert(jvs33);return;}
if (a7 == "")
	{alert(jvs34);return;}
if (a8 == "")
	{alert(jvs35);return;}
if (a9 == "")
	{alert(jvs36);return;}
if (a10 == 0)
	{alert(jvs37);return;}
if (a11 == "")
	{alert(jvs38);return;}
if (a12 == "")
	{alert(jvs39);return;}
if (a13 == "")
	{alert(jvs40);return;}

else
	{document.envoi.submit();}


}

// ----------------- function emailus ---------

function emailus()
{
a1 = document.envoi.f_name.value;
a2 = document.envoi.l_name.value;
a3 = document.envoi.email.value;

mval = new String (a3)
mAro = mval.indexOf("@")
mPnt = mval.indexOf(".")

if (a1 == "")
	{alert(jvs41);return;}
if (a2 == "")
	{alert(jvs42);return;}
if (a3 == "")
	{alert(jvs44);return;}
if (a3.length < 6)
	{alert(jvs45);return;}
if ((a3 != "") && ((mAro == -1) || (mPnt == -1)))
	{alert(jvs45);	return;}

else
	{document.envoi.submit();}

}

// ----------------- function tellfriends ---------

function tellfriends()
{

b1 = document.envoi.fname.value;
b2 = document.envoi.lname.value;

a1 = document.envoi.adres1.value;

mval = new String (a1)
mAro = mval.indexOf("@")
mPnt = mval.indexOf(".")

if (b1 == "")
	{alert(jvs5);return;}
if (b2 == "")
	{alert(jvs3);return;}

if (a1 == "")
	{alert(jvs46);return;}

if (a1.length < 6)
	{alert(jvs47);return;}
if ((a1 != "") && ((mAro == -1) || (mPnt == -1)))
	{alert(jvs47);	return;}


else
	{document.envoi.submit();}
}

// ----------------- ???? ---------

function direc()
{
a1 = document.acces.namex.value;
a2 = document.acces.filex.value;

if (a1 == "")
	{alert(jvs1);return;}
if (a2 == "")
	{alert(jvs2);return;}

else
	{
	document.directe.na.value = a1;
	document.directe.fi.value = a2;
	document.directe.submit();
	}

}

// ----------------- ???? ---------

function goes(x,y)
{
if (x == 1)
	{document.sendquest.action='career-advice-questionnaire-rules.asp';
	document.sendquest.submit();}

if (x == 2)
	{pagx = "career-advice-questionnaire-page";
	finpage = ".asp";
	pagy = pagx+y;
	pagz = pagy+finpage;
	document.sendquest.action=pagz;
	document.sendquest.submit();}

if (x == 3)
	{document.sendquest.action='career-advice-questionnaire-page7.asp';
	document.sendquest.submit();}
}

// ------- voir ou envoi pdf rapport test gratuit depuis returning-user -------

function newgoes(x)
{

if (x == 1)
	{document.seerapport.action='career-advice-report-page.asp';
	document.seerapport.submit();}
if (x == 2)
	{document.sendfreemail.submit();}

}

// ----------------- ???? ---------

function ordergoes(x)
{

if (x == 1)
	{document.ordering.product.value=1  ;
	document.ordering.submit();}
if (x == 2)
	{document.ordering.product.value=2  ;
	document.ordering.submit();}
if (x == 3)
	{document.ordering.product.value=3  ;
	document.ordering.submit();}
}

// ----------------- ???? ---------

function reordergoes(x)
{

if (x == 1)
	{document.reordering.product.value=1  ;
	document.reordering.submit();}
if (x == 2)
	{document.reordering.product.value=2  ;
	document.reordering.submit();}

}

// ------- envoi pdf produit depuis returning-user -------

function goesmail(x,y)
{

document.sendmail.product.value = x; // produit = 1, 2, 3 
document.sendmail.voir_facture.value = y; // facture selon produit 1, 2, 3 
document.sendmail.submit();

}


// ------- voir detail produit depuis returning-user -------

function seedetails(x)
{

if (x == 1)
	{document.seedetail.action='career-test-detailed-contents.asp';
	document.seedetail.submit();}
if (x == 2)
	{document.seedetail.action='finding-your-path-detailed-contents.asp';
	document.seedetail.submit();}

}

// ------- voir facture depuis returning-user -------

function seeinvo(x)
{

document.seeinvoice.product.value = x;
document.seeinvoice.submit();

}

// ----------------- validation partner ---------

function partner()
{
a1 = document.hold.parte.value;
a2 = document.hold.coda.value;
a3 = document.hold.mota.value;

if (a1 == "")
	{alert(jvs50);return;}
if (a2 == "")
	{alert(jvs51);return;}
if (a3 == "")
	{alert(jvs52);return;}

else
	{document.hold.submit();}

}

// ----------------- resultats partner ---------

function envoi(x)
{

if ((x == 1) || (x == 2) || (x == 3) || (x == 4))
	{
	document.results.indic.value = x;
	document.results.submit();
	}


if (x == 5)
	{
	a1 = document.msp.monthr.selectedIndex;
	a2 = document.msp.anner.selectedIndex;

	if (a1 == 0)
		{alert(jvs53);return;}
	if (a2 == 0)
		{alert(jvs54);return;}
	
	else
		{
		z1 = document.msp.monthr.options[a1].value;
		z2 = document.msp.anner.options[a2].value;
		document.results2.mx.value = z1;
		document.results2.yx.value = z2;
		document.results2.submit();
		}
	}


if (x == 6)
	{
	a1 = document.period.dd1.selectedIndex;
	a2 = document.period.mm1.selectedIndex;
	a3 = document.period.yy1.selectedIndex;
	a4 = document.period.dd2.selectedIndex;
	a5 = document.period.mm2.selectedIndex;
	a6 = document.period.yy2.selectedIndex;
	
	if (a1 == 0)
		{alert(jvs55);return;}
	if (a2 == 0)
		{alert(jvs56);return;}
	if (a3 == 0)
		{alert(jvs57);return;}
	if (a4 == 0)
		{alert(jvs58);return;}
	if (a5 == 0)
		{alert(jvs59);return;}
	if (a6 == 0)
		{alert(jvs60);return;}
	
	else
		{
		document.results3.d1.value = document.period.dd1.options[a1].value;
		document.results3.m1.value = document.period.mm1.options[a2].value;
		document.results3.y1.value = document.period.yy1.options[a3].value;
		document.results3.d2.value = document.period.dd2.options[a4].value;
		document.results3.m2.value = document.period.mm2.options[a5].value;
		document.results3.y2.value = document.period.yy2.options[a6].value;
		document.results3.submit();
		}
	}

if (x == 7)
	{
	a1 = document.invoi.month.selectedIndex;
	a2 = document.invoi.year.selectedIndex;

	
	if (a1 == 0)
		{alert(jvs61);return;}
	if (a2 == 0)
		{alert(jvs62);return;}
	
	
	else
		{document.invoi.submit();}
	}

if (x == 8)
	{document.devise.submit();}


}

// ------- tourner page depuis rapport gratuit -------

function followit(x)
{
document.rapport.submit();
}

// ------- changer devise sur site grand public -------
	// sur page final free rapport -------

function verifcurrency()
{
a1 = document.changecur.dv.selectedIndex;

if (a1 == 0)
	{alert(jvs63);return;}

else
	{
	z1 = document.changecur.dv.options[a1].value;
	document.chgcurr.dv.value = z1;
	document.chgcurr.submit();
	}
}


	// sur page return-users -------

function currencynew(x)
{
if (x == 1)
	{
	a1 = document.through.xndv1.selectedIndex;
	z1 = document.through.xndv1.options[a1].value;
	}
if (x == 2)
	{
	a1 = document.through.xndv2.selectedIndex;
	z1 = document.through.xndv2.options[a1].value;
	}
if (x == 3)
	{
	a1 = document.through.xndv3.selectedIndex;
	z1 = document.through.xndv3.options[a1].value;
	}
if (x == 4)
	{
	a1 = document.through.xndv4.selectedIndex;
	z1 = document.through.xndv4.options[a1].value;
	}
if (x == 5)
	{
	a1 = document.through.xndv5.selectedIndex;
	z1 = document.through.xndv5.options[a1].value;
	}

if (a1 == 0)
	{alert(jvs63);return;}

else
	{
	document.currencychg.dv.value = z1 ;
	document.currencychg.submit();  
	}
}

function currencynew2(x)
{
if (x == 1)
	{
	a1 = document.through.xndv1.selectedIndex;
	z1 = document.through.xndv1.options[a1].value;
	}
if (x == 2)
	{
	a1 = document.through2.xndv1.selectedIndex;
	z1 = document.through2.xndv1.options[a1].value;
	}

if (a1 == 0)
	{alert(jvs63);return;}

else
	{
	document.currencychg.dv.value = z1 ;
	document.currencychg.submit();  
	}
}

// ------- conditions participation -------

function conditionx()
{
a1 = document.send.l_name.value;
a2 = document.send.f_name.value;
a3 = document.send.ncountry.selectedIndex;

document.condi.nx.value = a1;
document.condi.fx.value = a2;
document.condi.cnx.value = a3;

document.condi.submit();
}

function retour()
{
document.returnx.submit();
}

// ------- envoi mail free report -------

function sendfree()
{
a1 = document.directe.newmail.value;

mval = new String (a1)
mAro = mval.indexOf("@")
mPnt = mval.indexOf(".")


if (a1 == "")
	{alert(jvs48);return;}

if (a1.length < 6)
	{alert(jvs49);return;}
if ((a1 != "") && ((mAro == -1) || (mPnt == -1)))
	{alert(jvs49);	return;}


else
	{document.directe.submit();}
}


function seemessage()
{
mesa = window.open('messagetellyourfriends.asp','messag','scrollbars=yes,width=450,height=430,left=50,top=10,screenX=50,screenY=10,innerWidth=450,innerHeight=430');
}

// ----------------- faire apparaitre le message ---------

var item3 = null;

function seemessagex(newItem)
{
if(item3)
	{item3.style.visibility='hidden';}

item3 = document.getElementById(newItem);
item3.style.visibility='visible';
}

function closelement3(newItem)
{

item3 = document.getElementById(newItem);
item3.style.visibility='hidden';
}
