//variable for 1st popup
var Q11=1;
var Q21=1;
var Q31=1;
var Q41=1;

//variable for 2nd popup
var Q12=1;
var Q22=1;
var Q32=0;

//variable for 3rd popup
var Q13=0;
var Q23=0;
var Q33=0;
var Q43=0;

//variable for 4th popup
var Q14=0;
var Q24=0;
var Q34=0;
var Q44=0;

//variable for 5th popup
var Q15=1;

function changeValue(variable,valeur)
{
	if (variable=='Q11')
		Q11 = valeur;
	else
	if (variable=='Q21')
		Q21 = valeur;
	else
	if (variable=='Q31')
		Q31 = valeur;
	else
	if (variable=='Q41')
		Q41 = valeur;
	else
	if (variable=='Q12')
		Q12 = valeur;
	else
	if (variable=='Q22')
		Q22 = valeur;
	else
	if (variable=='Q32')
		Q32 = valeur;
	else
	if (variable=='Q13')
		Q13 = valeur;
	else
	if (variable=='Q23')
		Q23 = valeur;
	else
	if (variable=='Q33')
		Q33 = valeur;
	else
	if (variable=='Q43')
		Q43 = valeur;
	else
	if (variable=='Q14')
		Q14 = valeur;
	else
	if (variable=='Q24')
		Q24 = valeur;
	else
	if (variable=='Q34')
		Q34 = valeur;
	else
	if (variable=='Q44')
		Q44 = valeur;
	else
	if (variable=='Q15')
		Q15 = valeur;
	
}

function Answer1()
{
//alert(Q11);
//alert(Q21);
//alert(Q31);
//alert(Q41);



	//IF Q11=YES + (Q21=YES OU Q31=Q31a OU Q41 = YES) ==> R1
	if((Q11==1) && (Q21==1 || Q31==1 || Q41==1))
	{
		Modalbox.show('product_finder/pf_answers/p1r1.htm', {title: '', width: 500});
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim PN version SDSL')} });
		//window.location.href = "index.php?option=com_content&task=view&id=76&Itemid=143";
		//Modalbox.show("http://www.google.com", {title: "google", width: 600});
	}
	//IF Q11=YES + (Q21=NO OU Q31 différent Q31a) +Q41=NO ==> R2
	else if((Q11==1) && (Q21==2 || Q31!=1) && (Q41==2))
	{
		Modalbox.show('product_finder/pf_answers/p1r2.htm', {title: '', width: 500});
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim PN version ADSL')} });
		//window.location.href = "index.php?option=com_content&task=view&id=76&Itemid=143";
	}
	//IF Q11=NO + (Q21=YES OU Q31=Q31a OU Q41=YES) ==> R3
	else if((Q11==2) && (Q21==1 || Q31==1 || Q41==1))
	{
		Modalbox.show('product_finder/pf_answers/p1r3.htm', {title: '', width: 500});
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Business SDSL')} });
		//window.location.href = "index.php?option=com_content&task=view&id=10&Itemid=142";
	}
	//IF Q11=NO + Q21=NO + Q31=Q31b + Q41=YES ==> R3
	else if(Q11== 2 && Q21==2 && Q31==2 && Q41==1)
	{
		Modalbox.show('product_finder/pf_answers/p1r3.htm', {title: '', width: 500});
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Business SDSL')} });
		//window.location.href = "index.php?option=com_content&task=view&id=10&Itemid=142";
	}
	//IF Q11=NO + Q21=NO + Q31=Q31b + Q41=NO ==> R4
	else if(Q11==2 && Q21==2 && Q31==2 && Q41==2)
	{
		Modalbox.show('product_finder/pf_answers/p1r4.htm', {title: '', width: 500});
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Trust')} });
		//window.location.href = "index.php?option=com_content&task=view&id=17&Itemid=145"
	}
	//IF Q11=NO + Q21=NO + Q31=Q31c + Q41=NO ==> R5
	else if(Q11==2 && Q21==2 && Q31==3 && Q41==2)
	{
		Modalbox.show('product_finder/pf_answers/p1r5.htm', {title: '', width: 500});
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim ADSL')} });
		//window.location.href = "index.php?option=com_content&task=view&id=18&Itemid=146";
	}
	
}

function Answer2()


{
	
	//IF Q12=Q12a + Q22=NO + Q32=NO ==> R1
	if(Q12==1 && Q22==2 && Q32==2 )
	{
		Modalbox.show('product_finder/pf_answers/p2r1.htm', {title: '', width: 500});
		//exit();
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Hosting VDS')} });
		//window.location.href = "index.php?option=com_content&task=view&id=19&Itemid=148";
	}
	else if(Q12==1 && Q22==2 && Q32==1 )
 {
  Modalbox.show('product_finder/pf_answers/p2r1.htm', {title: '', width: 500});
  //exit();
  //Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Hosting VDS')} });
  //window.location.href = "index.php?option=com_content&task=view&id=19&Itemid=148";
 }
	//IF Q12=Q12b + Q22=NO ==> ne pas afficher Q32 et afficher R0
	else if(Q12==2 && Q22==2)
	{
		Modalbox.show('product_finder/pf_answers/p2r0.htm', {title: '', width: 500});
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Housing')} });
		//window.location.href = "index.php?option=com_content&task=view&id=13&Itemid=37&mosmsg=Nous pouvons héberger vos serveurs si vous en faites l'acquisition et en assurez la maintenance (prestation de colocation de datacenter : Nerim Housing)";	
	}
	//IF Q12=Q12a + Q22=YES et Q32= YES ou NO ==> R2
	else if(Q12==1 && Q22==1 && (Q32==1 || Q32==2))
	{
		Modalbox.show('product_finder/pf_answers/p2r2.htm', {title: '', width: 500});
		//exit();
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Housing')} });
		//window.location.href = "index.php?option=com_content&task=view&id=20&Itemid=149";		
	}
	//IF Q12=Q12b + Q22=YES et Q32= YES ou NO ==> R2
	else if(Q12==2 && Q22==1 && (Q32==1 || Q32==2))
	{
		Modalbox.show('product_finder/pf_answers/p2r2.htm', {title: '', width: 500});
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Housing')} });
		//window.location.href = "index.php?option=com_content&task=view&id=20&Itemid=149";			
		//exit();
	}
	//IF Q12=YES ou NO + Q22=YES et Q32= YES ==> R3
	else if((Q12==1 || Q12==2) && Q22==1 && Q32==1)
	{
		Modalbox.show('product_finder/pf_answers/p2r3.htm', {title: '', width: 500});
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Connect')} });
		//window.location.href = "index.php?option=com_content&task=view&id=21&Itemid=150 ";		
	}
	
	if(Q12==1 && Q22==2 && Q32==0 ) 
	{
		Modalbox.show('product_finder/pf_hebergement/ques3.htm', {title: '', width: 500});
		
	}
	if(Q12==1 && Q22==1 && Q32==0)
	{
		Modalbox.show('product_finder/pf_hebergement/ques3.htm', {title: '', width: 500});
		
	}
	if(Q12==2 && Q22==1 && Q32==0 )
	{
		Modalbox.show('product_finder/pf_hebergement/ques3.htm', {title: '', width: 500});
		
	}
}

function Answer3()
{
	//IF Q13=Q13a, alors poser question Q23
	if(Q13==1)
	{
		Modalbox.show('product_finder/pf_securite/ques2.htm', {title: '', width: 600});	
		
	}
	//IF Q13=Q13b, alors poser question Q33
	if(Q13==2)
	{
		Modalbox.show('product_finder/pf_securite/ques3.htm', {title: '', width: 600});	
		
	}
	//IF Q13=Q13c ==> R2
	if(Q13==3)
	{
		Modalbox.show('product_finder/pf_answers/p3r2.htm', {title: '', width: 600});
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Serenity VPN')} });
		//window.location.href = "index.php?option=com_content&task=view&id=24&Itemid=153";
	}
	//IF Q13=Q13d, alors poser question Q43
	if(Q13==4)
	{
		Modalbox.show('product_finder/pf_securite/ques4.htm', {title: '', width: 600});	
		
	}
	//IF Q23=NO ==> R1
	if(Q23==2)
	{
		Modalbox.show('product_finder/pf_answers/p3r1.htm', {title: '', width: 600});
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Serenity')} });
		//window.location.href = "index.php?option=com_content&task=view&id=25&Itemid=154";	
	}
	//IF Q23=YES ==> R2
	if(Q23==1)
	{
		Modalbox.show('product_finder/pf_answers/p3r2.htm', {title: '', width: 600});
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Serenity VPN')} });
		//window.location.href = "index.php?option=com_content&task=view&id=24&Itemid=153";	
		
	}
	//IF Q33=Q33a ==> R3
	if(Q33==1)
	{
		Modalbox.show('product_finder/pf_answers/p3r3.htm', {title: '', width: 600});
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant :  Nerim PN')} });
		//window.location.href = "index.php?option=com_content&task=view&id=22&Itemid=151";	
	}	
	//IF Q33=Q33b==> R2
	if(Q33==2)
	{
		Modalbox.show('product_finder/pf_answers/p3r2.htm', {title: '', width: 600});
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Serenity VPN')} });
		//window.location.href = "index.php?option=com_content&task=view&id=24&Itemid=153";	
	}	
	//IF Q43=Q43a==> R1
	if(Q43==1)
	{
		Modalbox.show('product_finder/pf_answers/p3r1.htm', {title: '', width: 600});
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Serenity')} });
		//window.location.href = "index.php?option=com_content&task=view&id=25&Itemid=154";	
	}		
	//IF Q43=Q43b ==> R4
	if(Q43==2)
	{
		Modalbox.show('product_finder/pf_answers/p3r4.htm', {title: '', width: 600});
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Serene Housing')} });
		//window.location.href = "http://www.yahoo7.com";	
	}	
	
}

function Answer4()
{
	
	//IF Q14=Q14b ==> ne pas afficher les autres questions et afficher R1
	if(Q14==2)
	{
		Modalbox.show('product_finder/pf_answers/p4r1.htm', {title: '', width: 600});
		//exit();
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Mobile')} });
		//window.location.href = "http://www.yahooR1.com";
	}
	//IF Q14=Q14a + Q24=Yes +Q34=NO ==> ne pas afficher Q44 et afficher R2
	if(Q14==1 && Q24==1 && Q34==2)
	{
		Modalbox.show('product_finder/pf_answers/p4r2.htm', {title: '', width: 600});
		//exit();
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Préselection')} });
		//window.location.href = "index.php?option=com_content&task=view&id=74&Itemid=158";
	}
	//IF Q14=Q14a + Q24=NO +Q34=YES + Q44=NO ==> R3
	if(Q14==1 && Q24==2 && Q34==1 && Q44==2)
	{
		Modalbox.show('product_finder/pf_answers/p4r3.htm', {title: '', width: 600});
		//exit();
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim VoIP TPE')} });
		//window.location.href = "index.php?option=com_content&task=view&id=73&Itemid=157";
	}
	//IF Q14=Q14a + Q24=NO + Q34=YES + Q44=YES ==> R4
	if(Q14==1 && Q24==2 && Q34==1 && Q44==1)
	{
		Modalbox.show('product_finder/pf_answers/p4r4.htm', {title: '', width: 600});
		//exit();
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant :Nerim Centrex')} });
		//window.location.href = "index.php?option=com_content&task=view&id=72&Itemid=156";
	}	
	//IF Q14=Q14a + Q24=YES + Q34=YES + Q44=NO ==> R5
	if(Q14==1 && Q24==1 && Q34==1 && Q44==2)
	{
		Modalbox.show('product_finder/pf_answers/p4r5.htm', {title: '', width: 600});
		//exit();
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim VoIP Entreprise')} });
		//window.location.href = "index.php?option=com_content&task=view&id=71&Itemid=155";
	}		
	//IF Q14=Q14a + Q24=YES + Q34=YES + Q44=YES==> R4
	if(Q14==1 && Q24==1 && Q34==1 && Q44==1)
	{
		Modalbox.show('product_finder/pf_answers/p4r4.htm', {title: '', width: 600});
		//exit();
		//Modalbox.hide({afterHide: function() { alert('Au vue des réponses à vos questions, on vous conseille le produit suivant : Nerim Centrex')} });
		//window.location.href = "index.php?option=com_content&task=view&id=72&Itemid=156";
	}	
	
	if(Q14==1 && Q24==0 && Q34==0 && Q44==0)
	{
		Modalbox.show('product_finder/pf_telephonie/ques2.htm', {title: '', width: 600});
		
	}
	if((Q14==1 && Q24==2 && Q34==1 && Q44==0 ) || (Q14==1 && Q24==1 && Q34==1 && Q44==0)) 
	{
		Modalbox.show('product_finder/pf_telephonie/ques4.htm', {title: '', width: 600});
		
	}

}

function Answer5()
{
	//Q15 ==> afficher product finder Connexions
	if(Q15==1)
	{
		Modalbox.show('product_finder/pf_connexions/ques1.htm', {title: '', width: 500});	
		
	}
	//Q2 ==> afficher product finder Connexions
	if(Q15==7)
	{
		Modalbox.show('product_finder/pf_connexions/ques1.htm', {title: '', width: 500});	
		
	}	
	//Q3 ==> afficher product finder Sécurité
	if(Q15==3)
	{
		Modalbox.show('product_finder/pf_securite/ques1.htm', {title: '', width: 500});	
		
	}	
	//Q4 ==> afficher product finder Téléphonie
	if(Q15==4)
	{
		Modalbox.show('product_finder/pf_telephonie/ques1.htm', {title: '', width: 500});
		
	}	
	//Q5 ==> afficher product finder Téléphonie
	if(Q15==5)
	{
		Modalbox.show('product_finder/pf_telephonie/ques1.htm', {title: '', width: 500});
		
	}	
	//Q6 ==> afficher product finder Hébergement
	if(Q15==6)
	{
		Modalbox.show('product_finder/pf_hebergement/ques1.htm', {title: '', width: 500});


		
	}		
	
}


