var rosace = new Array();

rosace[0] = new Array();
rosace[0][0] = new Array();
rosace[0][1] = new Array();
rosace[0][2] = new Array();
rosace[0][3] = new Array();

rosace[1] = new Array();
rosace[1][0] = new Array();
rosace[1][1] = new Array();
rosace[1][2] = new Array();
rosace[1][3] = new Array();

rosace[2] = new Array();
rosace[2][0] = new Array();
rosace[2][1] = new Array();
rosace[2][2] = new Array();
rosace[2][3] = new Array();

rosace[3] = new Array();
rosace[3][0] = new Array();
rosace[3][1] = new Array();
rosace[3][2] = new Array();
rosace[3][3] = new Array();

rosace[4] = new Array();
rosace[4][0] = new Array();
rosace[4][1] = new Array();
rosace[4][2] = new Array();
rosace[4][3] = new Array();

rosace[5] = new Array();
rosace[5][0] = new Array();
rosace[5][1] = new Array();
rosace[5][2] = new Array();
rosace[5][3] = new Array();

rosace[6] = new Array();
rosace[6][0] = new Array();
rosace[6][1] = new Array();
rosace[6][2] = new Array();
rosace[6][3] = new Array();

rosace[7] = new Array();
rosace[7][0] = new Array();
rosace[7][1] = new Array();
rosace[7][2] = new Array();
rosace[7][3] = new Array();

rosace[8] = new Array();
rosace[8][0] = new Array();
rosace[8][1] = new Array();
rosace[8][2] = new Array();
rosace[8][3] = new Array();

rosace[9] = new Array();
rosace[9][0] = new Array();
rosace[9][1] = new Array();
rosace[9][2] = new Array();
rosace[9][3] = new Array();

rosace[10] = new Array();
rosace[10][0] = new Array();
rosace[10][1] = new Array();
rosace[10][2] = new Array();
rosace[10][3] = new Array();

rosace[11] = new Array();
rosace[11][0] = new Array();
rosace[11][1] = new Array();
rosace[11][2] = new Array();
rosace[11][3] = new Array();

rosace[12] = new Array();
rosace[12][0] = new Array();
rosace[12][1] = new Array();
rosace[12][2] = new Array();
rosace[12][3] = new Array();

rosace[13] = new Array();
rosace[13][0] = new Array();
rosace[13][1] = new Array();
rosace[13][2] = new Array();
rosace[13][3] = new Array();

rosace[14] = new Array();
rosace[14][0] = new Array();
rosace[14][1] = new Array();
rosace[14][2] = new Array();
rosace[14][3] = new Array();

rosace[15] = new Array();
rosace[15][0] = new Array();
rosace[15][1] = new Array();
rosace[15][2] = new Array();
rosace[15][3] = new Array();

rosace[16] = new Array();
rosace[16][0] = new Array();
rosace[16][1] = new Array();
rosace[16][2] = new Array();
rosace[16][3] = new Array();

rosace[17] = new Array();
rosace[17][0] = new Array();
rosace[17][1] = new Array();
rosace[17][2] = new Array();
rosace[17][3] = new Array();

rosace[18] = new Array();
rosace[18][0] = new Array();
rosace[18][1] = new Array();
rosace[18][2] = new Array();
rosace[18][3] = new Array();

rosace[19] = new Array();
rosace[19][0] = new Array();
rosace[19][1] = new Array();
rosace[19][2] = new Array();
rosace[19][3] = new Array();

rosace[20] = new Array();
rosace[20][0] = new Array();
rosace[20][1] = new Array();
rosace[20][2] = new Array();
rosace[20][3] = new Array();

rosace[21] = new Array();
rosace[21][0] = new Array();
rosace[21][1] = new Array();
rosace[21][2] = new Array();
rosace[21][3] = new Array();

rosace[22] = new Array();
rosace[22][0] = new Array();
rosace[22][1] = new Array();
rosace[22][2] = new Array();
rosace[22][3] = new Array();

rosace[23] = new Array();
rosace[23][0] = new Array();
rosace[23][1] = new Array();
rosace[23][2] = new Array();
rosace[23][3] = new Array();

// -----
rosace[0][0]["x"] = 322;
rosace[0][0]["y"] = 220;

rosace[0][1]["x"] = 322;
rosace[0][1]["y"] = 163;

rosace[0][2]["x"] = 322;
rosace[0][2]["y"] = 103;

rosace[0][3]["x"] = 322;
rosace[0][3]["y"] = 51;

// -----
rosace[1][0]["x"] = 332;
rosace[1][0]["y"] = 222;

rosace[1][1]["x"] = 360;
rosace[1][1]["y"] = 173;

rosace[1][2]["x"] = 390;
rosace[1][2]["y"] = 121;

rosace[1][3]["x"] = 416;
rosace[1][3]["y"] = 76;

// -----
rosace[2][0]["x"] = 334;
rosace[2][0]["y"] = 223;

rosace[2][1]["x"] = 362;
rosace[2][1]["y"] = 174;

rosace[2][2]["x"] = 392;
rosace[2][2]["y"] = 122;

rosace[2][3]["x"] = 418;
rosace[2][3]["y"] = 78;

// -----
rosace[3][0]["x"] = 342;
rosace[3][0]["y"] = 230;

rosace[3][1]["x"] = 391;
rosace[3][1]["y"] = 202;

rosace[3][2]["x"] = 443;
rosace[3][2]["y"] = 172;

rosace[3][3]["x"] = 486;
rosace[3][3]["y"] = 147;

// -----
rosace[4][0]["x"] = 342;
rosace[4][0]["y"] = 233;

rosace[4][1]["x"] = 392;
rosace[4][1]["y"] = 204;

rosace[4][2]["x"] = 443;
rosace[4][2]["y"] = 174;

rosace[4][3]["x"] = 488;
rosace[4][3]["y"] = 148;

// -----
rosace[5][0]["x"] = 346;
rosace[5][0]["y"] = 243;

rosace[5][1]["x"] = 402;
rosace[5][1]["y"] = 243;

rosace[5][2]["x"] = 461;
rosace[5][2]["y"] = 243;

rosace[5][3]["x"] = 514;
rosace[5][3]["y"] = 243;

// -----
rosace[6][0]["x"] = 346;
rosace[6][0]["y"] = 246;

rosace[6][1]["x"] = 402;
rosace[6][1]["y"] = 246;

rosace[6][2]["x"] = 461;
rosace[6][2]["y"] = 246;

rosace[6][3]["x"] = 514;
rosace[6][3]["y"] = 246;

// ----- 
rosace[7][0]["x"] = 344;
rosace[7][0]["y"] = 256;

rosace[7][1]["x"] = 393;
rosace[7][1]["y"] = 284;

rosace[7][2]["x"] = 444;
rosace[7][2]["y"] = 314;

rosace[7][3]["x"] = 488;
rosace[7][3]["y"] = 339;

// ----- 
rosace[8][0]["x"] = 343;
rosace[8][0]["y"] = 258;

rosace[8][1]["x"] = 391;
rosace[8][1]["y"] = 285;

rosace[8][2]["x"] = 442;
rosace[8][2]["y"] = 315;

rosace[8][3]["x"] = 487;
rosace[8][3]["y"] = 341;

// -----
rosace[9][0]["x"] = 335;
rosace[9][0]["y"] = 265;

rosace[9][1]["x"] = 364;
rosace[9][1]["y"] = 315;

rosace[9][2]["x"] = 393;
rosace[9][2]["y"] = 366;

rosace[9][3]["x"] = 418;
rosace[9][3]["y"] = 410;

// ----- 
rosace[10][0]["x"] = 333;
rosace[10][0]["y"] = 266;

rosace[10][1]["x"] = 362;
rosace[10][1]["y"] = 317;

rosace[10][2]["x"] = 390;
rosace[10][2]["y"] = 366;

rosace[10][3]["x"] = 416;
rosace[10][3]["y"] = 411;

// -----
rosace[11][0]["x"] = 323;
rosace[11][0]["y"] = 269;

rosace[11][1]["x"] = 323;
rosace[11][1]["y"] = 326;

rosace[11][2]["x"] = 323;
rosace[11][2]["y"] = 385;

rosace[11][3]["x"] = 323;
rosace[11][3]["y"] = 438;

// -----
rosace[12][0]["x"] = 320;
rosace[12][0]["y"] = 269;

rosace[12][1]["x"] = 320;
rosace[12][1]["y"] = 326;

rosace[12][2]["x"] = 320;
rosace[12][2]["y"] = 385;

rosace[12][3]["x"] = 320;
rosace[12][3]["y"] = 438;

// ----- 
rosace[13][0]["x"] = 311;
rosace[13][0]["y"] = 267;

rosace[13][1]["x"] = 283;
rosace[13][1]["y"] = 316;

rosace[13][2]["x"] = 253;
rosace[13][2]["y"] = 367;

rosace[13][3]["x"] = 226;
rosace[13][3]["y"] = 413;

// ----- 
rosace[14][0]["x"] = 309;
rosace[14][0]["y"] = 266;

rosace[14][1]["x"] = 280;
rosace[14][1]["y"] = 315;

rosace[14][2]["x"] = 251;
rosace[14][2]["y"] = 366;

rosace[14][3]["x"] = 225;
rosace[14][3]["y"] = 411;

// -----
rosace[15][0]["x"] = 301;
rosace[15][0]["y"] = 258;

rosace[15][1]["x"] = 252;
rosace[15][1]["y"] = 287;

rosace[15][2]["x"] = 200;
rosace[15][2]["y"] = 317;

rosace[15][3]["x"] = 156;
rosace[15][3]["y"] = 342;

// ----- 
rosace[16][0]["x"] = 299;
rosace[16][0]["y"] = 257;

rosace[16][1]["x"] = 252;
rosace[16][1]["y"] = 284;

rosace[16][2]["x"] = 200;
rosace[16][2]["y"] = 314;

rosace[16][3]["x"] = 155;
rosace[16][3]["y"] = 340;

// ----- 
rosace[17][0]["x"] = 297;
rosace[17][0]["y"] = 246;

rosace[17][1]["x"] = 241;
rosace[17][1]["y"] = 246;

rosace[17][2]["x"] = 182;
rosace[17][2]["y"] = 246;

rosace[17][3]["x"] = 129;
rosace[17][3]["y"] = 246;

// -----
rosace[18][0]["x"] = 297;
rosace[18][0]["y"] = 243;

rosace[18][1]["x"] = 241;
rosace[18][1]["y"] = 243;

rosace[18][2]["x"] = 182;
rosace[18][2]["y"] = 243;

rosace[18][3]["x"] = 129;
rosace[18][3]["y"] = 243;

// -----
rosace[19][0]["x"] = 299;
rosace[19][0]["y"] = 233;

rosace[19][1]["x"] = 250;
rosace[19][1]["y"] = 205;

rosace[19][2]["x"] = 199;
rosace[19][2]["y"] = 176;

rosace[19][3]["x"] = 154;
rosace[19][3]["y"] = 150;

// ----- 
rosace[20][0]["x"] = 300;
rosace[20][0]["y"] = 232;

rosace[20][1]["x"] = 251;
rosace[20][1]["y"] = 203;

rosace[20][2]["x"] = 199;
rosace[20][2]["y"] = 173;

rosace[20][3]["x"] = 155;
rosace[20][3]["y"] = 148;

// -----
rosace[21][0]["x"] = 308;
rosace[21][0]["y"] = 224;

rosace[21][1]["x"] = 280;
rosace[21][1]["y"] = 175;

rosace[21][2]["x"] = 250;
rosace[21][2]["y"] = 124;

rosace[21][3]["x"] = 224;
rosace[21][3]["y"] = 78;

// -----
rosace[22][0]["x"] = 310;
rosace[22][0]["y"] = 223;

rosace[22][1]["x"] = 282;
rosace[22][1]["y"] = 174;

rosace[22][2]["x"] = 252;
rosace[22][2]["y"] = 122;

rosace[22][3]["x"] = 226;
rosace[22][3]["y"] = 77;

// -----
rosace[23][0]["x"] = 320;
rosace[23][0]["y"] = 220;

rosace[23][1]["x"] = 320;
rosace[23][1]["y"] = 163;

rosace[23][2]["x"] = 320;
rosace[23][2]["y"] = 104;

rosace[23][3]["x"] = 320;
rosace[23][3]["y"] = 51;

function setRosace(p1, v1, p2, v2)
{
	var Xpoints = new Array(rosace[p1][0]["x"], rosace[p1][v1]["x"], rosace[p2][v2]["x"], rosace[p2][0]["x"]);
	var Ypoints = new Array(rosace[p1][0]["y"], rosace[p1][v1]["y"], rosace[p2][v2]["y"], rosace[p2][0]["y"]);
	jg.setColor("#FF0000"); // rouge
	jg.fillPolygon(Xpoints, Ypoints);
}

function part1()
{
	var tmp1 = document.rose.eval_alcool;
	var value1 = tmp1.options[tmp1.selectedIndex].value;

	var tmp2 = document.rose.eval_tabac;
	var value2 = tmp2.options[tmp2.selectedIndex].value;

	if (value1 != 0 || value2 != 0)
		setRosace(0, value1, 1, value2);
}

function part2()
{
	var tmp1 = document.rose.eval_tabac;
	var value1 = tmp1.options[tmp1.selectedIndex].value;

	var tmp2 = document.rose.eval_canabis;
	var value2 = tmp2.options[tmp2.selectedIndex].value;

	if (value1 != 0 || value2 != 0)
		setRosace(2, value1, 3, value2);
}

function part3()
{
	var tmp1 = document.rose.eval_canabis;
	var value1 = tmp1.options[tmp1.selectedIndex].value;

	var tmp2 = document.rose.eval_mesusmedi;
	var value2 = tmp2.options[tmp2.selectedIndex].value;

	if (value1 != 0 || value2 != 0)
		setRosace(4, value1, 5, value2);
}

function part4()
{
	var tmp1 = document.rose.eval_mesusmedi;
	var value1 = tmp1.options[tmp1.selectedIndex].value;

	var tmp2 = document.rose.eval_prodill;
	var value2 = tmp2.options[tmp2.selectedIndex].value;

	if (value1 != 0 || value2 != 0)
		setRosace(6, value1, 7, value2);
}

function part5()
{
	var tmp1 = document.rose.eval_prodill;
	var value1 = tmp1.options[tmp1.selectedIndex].value;

	var tmp2 = document.rose.eval_troublcond;
	var value2 = tmp2.options[tmp2.selectedIndex].value;

	if (value1 != 0 || value2 != 0)
		setRosace(8, value1, 9, value2);
}

function part6()
{
	var tmp1 = document.rose.eval_troublcond;
	var value1 = tmp1.options[tmp1.selectedIndex].value;

	var tmp2 = document.rose.eval_probjudi;
	var value2 = tmp2.options[tmp2.selectedIndex].value;

	if (value1 != 0 || value2 != 0)
		setRosace(10, value1, 11, value2);
}

function part7()
{
	var tmp1 = document.rose.eval_probjudi;
	var value1 = tmp1.options[tmp1.selectedIndex].value;

	var tmp2 = document.rose.eval_probpro;
	var value2 = tmp2.options[tmp2.selectedIndex].value;

	if (value1 != 0 || value2 != 0)
		setRosace(12, value1, 13, value2);
}

function part8()
{
	var tmp1 = document.rose.eval_probpro;
	var value1 = tmp1.options[tmp1.selectedIndex].value;

	var tmp2 = document.rose.eval_probsoc;
	var value2 = tmp2.options[tmp2.selectedIndex].value;

	if (value1 != 0 || value2 != 0)
		setRosace(14, value1, 15, value2);
}

function part9()
{
	var tmp1 = document.rose.eval_probsoc;
	var value1 = tmp1.options[tmp1.selectedIndex].value;

	var tmp2 = document.rose.eval_probfam;
	var value2 = tmp2.options[tmp2.selectedIndex].value;

	if (value1 != 0 || value2 != 0)
		setRosace(16, value1, 17, value2);
}

function part10()
{
	var tmp1 = document.rose.eval_probfam;
	var value1 = tmp1.options[tmp1.selectedIndex].value;

	var tmp2 = document.rose.eval_etatpsy;
	var value2 = tmp2.options[tmp2.selectedIndex].value;

	if (value1 != 0 || value2 != 0)
		setRosace(18, value1, 19, value2);
}
// **********************
function part11()
{
	var tmp1 = document.rose.eval_etatpsy;
	var value1 = tmp1.options[tmp1.selectedIndex].value;

	var tmp2 = document.rose.eval_etatsoma;
	var value2 = tmp2.options[tmp2.selectedIndex].value;

	if (value1 != 0 || value2 != 0)
		setRosace(20, value1, 21, value2);
}

function part12()
{
	var tmp1 = document.rose.eval_etatsoma;
	var value1 = tmp1.options[tmp1.selectedIndex].value;

	var tmp2 = document.rose.eval_alcool;
	var value2 = tmp2.options[tmp2.selectedIndex].value;

	if (value1 != 0 || value2 != 0)
		setRosace(22, value1, 23, value2);
}

function drawRosace()
{
	jg.clear();
	part1();
	part2();
	part3();
	part4();
	part5();
	part6();
	part7();
	part8();
	part9();
	part10();
	part11();
	part12();
	jg.paint();
}