//settings
var maxi = 23;							//number of child topics
var maxw = 628;							//overall with
var maxh = 560;							//overall hight
var topx = 0;							//main area spacing x
var topy = 0;							//main area spacing y
var trans = "../images/mindmap/transparent.gif"	//transparent gif location
var grey = "../images/mindmap/grey2.gif"			//transparent gif location

var centw = 224;						//center topic width
var centh = 54;							//center topic hight
var centfillc = "#d9dde9";				//center topic fill colour
var centstrokec = "#c00000";			//center topic stroke colour
var centstroke = 1;						//center topic stroke
var centfontc = "000000";				//center font colour
var centfont = "arial";					//center font
var centfonts = "14px";					//center font size
//var centstyle = "Font.ITALIC_BOLD";	//center font style !!! DOES NOT WORK IF IT IS HANDED OVER TO THE FUNCTION --> DIRECTLY CODED THERE !!!
var centtxto = "left";					//center text orientation
var centimw = 80						//center image with
var centimh = 45;						//center image hight
var centimx = 5;						//center image spacing x
var centimy = 5;						//center image spacing y
var centtxtx = 4;						//center text spacing x
var centtxty = 10;						//center image spacing y

var ancw = 224;							//ancestor topic width
var anch = 54;							//ancestor topic hight
var ancy = 0;							//ancestor topic spacing y
var ancfillc = "#F7F7F9";				//ancestor topic fill colour
var ancstrokec = "#2B2C6F";				//ancestor topic stroke colour
var ancstroke = 1;						//ancestor topic stroke
var ancfontc = "#666666";				//ancestor font colour
var ancfont = "arial";					//ancestor font
var ancfonts = "14px";					//ancestor font size
//var ancstyle = "Font.ITALIC_BOLD";	//ancestor font style !!! DOES NOT WORK IF IT IS HANDED OVER TO THE FUNCTION --> DIRECTLY CODED THERE !!!
var anctxto = "left";					//ancestor text orientation
var ancimw = 80							//ancestor image with
var ancimh = 45;						//ancestor image hight
var ancimx = 5;							//ancestor image spacing x
var ancimy = 5;							//ancestor image spacing y
var anctxtx = 4;						//ancestor text spacing x
var anctxty = 10;						//ancestor image spacing y

var childw = 180;						//child topiv width
var childh = 43;						//child topic hight
var childfillc = "#edeef3";				//child topic fill colour
var childstrokec = "#2B2C6F";			//child topic stroke colour
var childstroke = 1;					//child topic stroke
var childfontc = "000000";				//child font colour
var childfont = "arial";				//child font
var childfonts = "12px";				//child font size
//var childstyle = "Font.REGULAR";		//child font style
var childtxto = "left";					//child text orientation
var childimw = 64;						//child image with
var childimh = 36;						//child image hight
var childimx = 4;						//child image spacing x
var childimy = 4;						//child image spacing y
var childtxtx = 3;						//child text spacing x
var childtxty = 6;						//child image spacing y

var highstroke = 3;						//mouseOver highlight stroke
var highc = "#c00000";					//mouseOver highlight colour

var linestroke = 1;						//center-child connection line
var linec = "#000000";					//center-child connection line colour
var anclinestroke = 1;					//center-ancestor connection line
var anclinec = "#666666";				//center-ancestor connection line colour
var anchighstroke = 3;					//mouseOver highlight stroke
var anchighc = "#2B2C6F";				//mouseOver highlight colour

var ar = new Array();					//arrow coordinates
ar[0] = 0;
ar[1] = 8;
ar[2] = 21;
ar[3] = 15;
ar[4] = 33;
ar[5] = 17;
ar[6] = 5;


//define place holders
var interx = ((maxw-(3*childw)-(2*topx))/2);				//calculate child-child distance x
var intery = ((maxh-(11*childh)-(2*topy))/10);				//calculate child-child distance y
var totalcentx = parseInt((maxw)/2);						//calculate total middle of area (x)
var totalcenty = parseInt((maxh)/2);						//calculate total middle of area (y)
var places = new Array(0, 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,1,26,27,3,4,5,6,7,8,9,1,10,11,12,13,14,15,16,17,18,19,2,20,21,22,23,24,25,26,27,4,5,6,7,8,9,10,1,11,12,13,14,15,16,17,18,19,20,2,21,22,23,24,25,26,3,27,5,6,7,1,9,10,11,3,11,12,13,14,15,16,2,18,19,20,4,20,21,22,23,24,25,26,27,5,6,7,1,9,10,11,3,11,12,13,14,15,16,2,18,19,20,4,20,21,22,24,25,26,5,27,7,8,9,1,10,3,11,5,12,13,14,15,16,17,2,18,4,19,6,20,21,22,23,24,25,26,27,8,9,10,1,11,3,12,5,13,14,15,16,17,18,2,19,4,20,6,21,22,23,24,25,26,7,27,9,10,1,11,3,12,5,13,7,14,15,16,17,2,18,4,19,6,20,8,21,22,23,24,25,26,27,10,11,1,12,3,13,5,14,7,15,16,17,18,2,19,4,20,6,21,8,22,23,24,25,26,27,9,11,1,12,3,13,5,14,7,15,9,16,17,2,18,4,19,6,20,8,21,10,22,23,24,25,26,27,12,13,14,1,3,5,7,9,15,16,18,19,20,21,2,4,6,8,10,20,21,23,22,23,11,24,27,13,14,15,1,3,5,7,9,11,16,17,18,19,20,2,4,6,8,10,12,21,22,23,24,25,26,27,14,15,1,3,5,7,9,11,16,17,18,19,20,2,4,6,8,10,12,21,22,23,24,25,13,26,27,15,16,1,3,5,7,9,11,13,17,18,19,20,2,4,6,8,10,12,14,21,22,23,24,25,26,27,16,17,1,3,5,7,9,11,13,18,19,20,21,2,4,6,8,10,12,14,22,23,24,25,26,15,27,17,18,1,3,5,7,9,11,13,15,19,20,21,2,4,6,8,10,12,14,16,22,23,24,25,26,27,18,1,3,5,7,9,11,13,15,19,20,21,2,4,6,8,10,12,14,16,22,23,24,25,26,17,27,19,1,3,5,7,9,11,13,15,17,20,21,2,4,6,8,10,12,14,16,18,22,23,24,25,26,27,20,1,3,5,7,9,11,13,15,17,21,22,2,4,6,8,10,12,14,16,18,23,24,25,26,27,19,22,1,3,5,7,9,11,13,15,17,19,23,2,4,6,8,10,12,14,16,18,20,23,24,25,26,27,22,1,3,5,7,9,11,13,15,17,19,23,2,4,6,8,10,12,14,16,18,20,24,25,26,27,21,1,3,5,7,9,11,13,15,17,19,21,2,4,6,8,10,12,14,16,18,20,22,23,24,25,26,27,1,3,5,7,9,11,13,15,17,19,21,2,4,6,8,10,12,14,16,18,20,22,24,25,26,27,23);		//definition of place holder fill order

var artipx = parseInt((totalcentx)-(ancw/2)+(ancimw/2)+ancimx);		//tip of "back" arrow
var artipy = parseInt((ancy+ancimy)+(ancimh/2)-1);					//tip of "back" arrow



//MouseOver effect and link to ancestor topic
function mouseOverUp()
{
	for (j=1;j<=maxi;j++)
	{
	  	jh[j].clear();
	}
	jh[24].setPrintable(false);
  	jh[24].setColor(anchighc);
  	jh[24].setStroke(anchighstroke);
  	jh[24].drawRect(parseInt((totalcentx)-(ancw/2)-1),(ancy-1),ancw,anch);	
	jt[24]=jt[24].replace(/-<br>/g,"");
  	jh[24].drawImage(trans,(parseInt((totalcentx)-(ancw/2))-5),(ancy-5),(ancw+10),(anch+10)," alt="+ jt[24].replace(/ /g, "&nbsp;")+ " (onMouseOver=() style='cursor: pointer; cursor: hand;') onMouseOut=jh[24].clear() onClick=navigate(jn[24])");
  	jh[24].paint(); 
}


//MouseOver effect and link
function mouseOver(i)
{
var childx = new Array(); //child array x
childx[0] = 0;
childx[places[((((maxi-1)*27)+1))]] = topx;
childx[places[((((maxi-1)*27)+2))]] = topx;
childx[places[((((maxi-1)*27)+3))]] = topx;
childx[places[((((maxi-1)*27)+4))]] = topx;
childx[places[((((maxi-1)*27)+5))]] = topx;
childx[places[((((maxi-1)*27)+6))]] = topx;
childx[places[((((maxi-1)*27)+7))]] = topx;
childx[places[((((maxi-1)*27)+8))]] = topx;
childx[places[((((maxi-1)*27)+9))]] = topx;
childx[places[((((maxi-1)*27)+10))]] = topx;
childx[places[((((maxi-1)*27)+11))]] = topx;
childx[places[((((maxi-1)*27)+12))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+13))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+14))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+15))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+16))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+17))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+18))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+19))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+20))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+21))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+22))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+23))]] = parseInt((totalcentx-(childw/2)));
childx[places[((((maxi-1)*27)+24))]] = parseInt((totalcentx-(childw/2)));
childx[places[((((maxi-1)*27)+25))]] = parseInt((totalcentx-(childw/2)));
childx[places[((((maxi-1)*27)+26))]] = parseInt((totalcentx-(childw/2)));
childx[places[((((maxi-1)*27)+27))]] = parseInt((totalcentx-(childw/2)));

var childy = new Array(); //child array y
childy[0] = 0;
childy[places[((((maxi-1)*27)+1))]] = parseInt(topy+(0*(childh+intery)));
childy[places[((((maxi-1)*27)+2))]] = parseInt(topy+(1*(childh+intery)));
childy[places[((((maxi-1)*27)+3))]] = parseInt(topy+(2*(childh+intery)));
childy[places[((((maxi-1)*27)+4))]] = parseInt(topy+(3*(childh+intery)));
childy[places[((((maxi-1)*27)+5))]] = parseInt(topy+(4*(childh+intery)));
childy[places[((((maxi-1)*27)+6))]] = parseInt(topy+(5*(childh+intery)));
childy[places[((((maxi-1)*27)+7))]] = parseInt(topy+(6*(childh+intery)));
childy[places[((((maxi-1)*27)+8))]] = parseInt(topy+(7*(childh+intery)));
childy[places[((((maxi-1)*27)+9))]] = parseInt(topy+(8*(childh+intery)));
childy[places[((((maxi-1)*27)+10))]] = parseInt(topy+(9*(childh+intery)));
childy[places[((((maxi-1)*27)+11))]] = parseInt(topy+(10*(childh+intery)));
childy[places[((((maxi-1)*27)+12))]] = parseInt(topy+(0*(childh+intery)));
childy[places[((((maxi-1)*27)+13))]] = parseInt(topy+(1*(childh+intery)));
childy[places[((((maxi-1)*27)+14))]] = parseInt(topy+(2*(childh+intery)));
childy[places[((((maxi-1)*27)+15))]] = parseInt(topy+(3*(childh+intery)));
childy[places[((((maxi-1)*27)+16))]] = parseInt(topy+(4*(childh+intery)));
childy[places[((((maxi-1)*27)+17))]] = parseInt(topy+(5*(childh+intery)));
childy[places[((((maxi-1)*27)+18))]] = parseInt(topy+(6*(childh+intery)));
childy[places[((((maxi-1)*27)+19))]] = parseInt(topy+(7*(childh+intery)));
childy[places[((((maxi-1)*27)+20))]] = parseInt(topy+(8*(childh+intery)));
childy[places[((((maxi-1)*27)+21))]] = parseInt(topy+(9*(childh+intery)));
childy[places[((((maxi-1)*27)+22))]] = parseInt(topy+(10*(childh+intery)));
childy[places[((((maxi-1)*27)+23))]] = parseInt(topy+(6*(childh+intery)));
childy[places[((((maxi-1)*27)+24))]] = parseInt(topy+(7*(childh+intery)));
childy[places[((((maxi-1)*27)+25))]] = parseInt(topy+(8*(childh+intery)));
childy[places[((((maxi-1)*27)+26))]] = parseInt(topy+(9*(childh+intery)));
childy[places[((((maxi-1)*27)+27))]] = parseInt(topy+(10*(childh+intery)));

var tagx = new Array(); //line array x
tagx[0] = 0;
tagx[places[((((maxi-1)*27)+1))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+2))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+3))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+4))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+5))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+6))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+7))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+8))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+9))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+10))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+11))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+12))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+13))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+14))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+15))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+16))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+17))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+18))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+19))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+20))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+21))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+22))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+23))]] = totalcentx;
tagx[places[((((maxi-1)*27)+24))]] = totalcentx;
tagx[places[((((maxi-1)*27)+25))]] = totalcentx;
tagx[places[((((maxi-1)*27)+26))]] = totalcentx;
tagx[places[((((maxi-1)*27)+27))]] = totalcentx;

var tagy = new Array(); //line array y
tagy[0] = 0;
tagy[places[((((maxi-1)*27)+1))]] = parseInt(topy+(0*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+2))]] = parseInt(topy+(1*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+3))]] = parseInt(topy+(2*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+4))]] = parseInt(topy+(3*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+5))]] = parseInt(topy+(4*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+6))]] = parseInt(topy+(5*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+7))]] = parseInt(topy+(6*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+8))]] = parseInt(topy+(7*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+9))]] = parseInt(topy+(8*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+10))]] = parseInt(topy+(9*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+11))]] = parseInt(topy+(10*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+12))]] = parseInt(topy+(0*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+13))]] = parseInt(topy+(1*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+14))]] = parseInt(topy+(2*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+15))]] = parseInt(topy+(3*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+16))]] = parseInt(topy+(4*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+17))]] = parseInt(topy+(5*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+18))]] = parseInt(topy+(6*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+19))]] = parseInt(topy+(7*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+20))]] = parseInt(topy+(8*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+21))]] = parseInt(topy+(9*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+22))]] = parseInt(topy+(10*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+23))]] = parseInt(topy+(6*(childh+intery)));
tagy[places[((((maxi-1)*27)+24))]] = parseInt(topy+(7*(childh+intery)));
tagy[places[((((maxi-1)*27)+25))]] = parseInt(topy+(8*(childh+intery)));
tagy[places[((((maxi-1)*27)+26))]] = parseInt(topy+(9*(childh+intery)));
tagy[places[((((maxi-1)*27)+27))]] = parseInt(topy+(10*(childh+intery)));

	for (j=1;j<=maxi;j++)
	{
	  	jh[j].clear();
	}
	jh[24].clear();
	jh[i].setPrintable(false);
  	jh[i].setColor(highc);
  	jh[i].setStroke(highstroke);
  	jh[i].drawRect((childx[i]-1),(childy[i]-1),childw,childh);
	jt[i]=jt[i].replace(/-<br>/g,"");
  	jh[i].drawImage(trans,(childx[i]-5),(childy[i]-5),(childw+10),(childh+10),"(onMouseOver=() style='cursor: pointer; cursor: hand;' alt="+ jt[i].replace(/ /g, "&nbsp;")+ " onMouseOut=jh["+i+"].clear() onClick=navigate(jn["+i+"])");
  	jh[i].paint();
}


function eraseChild (i)
{
	for (j=1;j<=24;j++)
	{
	  	jg[j].clear();
	  	jh[j].clear();		
		jl[j].clear();
	}
	drawMap(i);
}

function drawMap(y)
{
maxi=y;
var childx = new Array(); //child array x
childx[0] = 0;
childx[places[((((maxi-1)*27)+1))]] = topx;
childx[places[((((maxi-1)*27)+2))]] = topx;
childx[places[((((maxi-1)*27)+3))]] = topx;
childx[places[((((maxi-1)*27)+4))]] = topx;
childx[places[((((maxi-1)*27)+5))]] = topx;
childx[places[((((maxi-1)*27)+6))]] = topx;
childx[places[((((maxi-1)*27)+7))]] = topx;
childx[places[((((maxi-1)*27)+8))]] = topx;
childx[places[((((maxi-1)*27)+9))]] = topx;
childx[places[((((maxi-1)*27)+10))]] = topx;
childx[places[((((maxi-1)*27)+11))]] = topx;
childx[places[((((maxi-1)*27)+12))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+13))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+14))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+15))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+16))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+17))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+18))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+19))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+20))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+21))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+22))]] = parseInt((topx+(2*(interx+childw))));
childx[places[((((maxi-1)*27)+23))]] = parseInt((totalcentx-(childw/2)));
childx[places[((((maxi-1)*27)+24))]] = parseInt((totalcentx-(childw/2)));
childx[places[((((maxi-1)*27)+25))]] = parseInt((totalcentx-(childw/2)));
childx[places[((((maxi-1)*27)+26))]] = parseInt((totalcentx-(childw/2)));
childx[places[((((maxi-1)*27)+27))]] = parseInt((totalcentx-(childw/2)));

var childy = new Array(); //child array y
childy[0] = 0;
childy[places[((((maxi-1)*27)+1))]] = parseInt(topy+(0*(childh+intery)));
childy[places[((((maxi-1)*27)+2))]] = parseInt(topy+(1*(childh+intery)));
childy[places[((((maxi-1)*27)+3))]] = parseInt(topy+(2*(childh+intery)));
childy[places[((((maxi-1)*27)+4))]] = parseInt(topy+(3*(childh+intery)));
childy[places[((((maxi-1)*27)+5))]] = parseInt(topy+(4*(childh+intery)));
childy[places[((((maxi-1)*27)+6))]] = parseInt(topy+(5*(childh+intery)));
childy[places[((((maxi-1)*27)+7))]] = parseInt(topy+(6*(childh+intery)));
childy[places[((((maxi-1)*27)+8))]] = parseInt(topy+(7*(childh+intery)));
childy[places[((((maxi-1)*27)+9))]] = parseInt(topy+(8*(childh+intery)));
childy[places[((((maxi-1)*27)+10))]] = parseInt(topy+(9*(childh+intery)));
childy[places[((((maxi-1)*27)+11))]] = parseInt(topy+(10*(childh+intery)));
childy[places[((((maxi-1)*27)+12))]] = parseInt(topy+(0*(childh+intery)));
childy[places[((((maxi-1)*27)+13))]] = parseInt(topy+(1*(childh+intery)));
childy[places[((((maxi-1)*27)+14))]] = parseInt(topy+(2*(childh+intery)));
childy[places[((((maxi-1)*27)+15))]] = parseInt(topy+(3*(childh+intery)));
childy[places[((((maxi-1)*27)+16))]] = parseInt(topy+(4*(childh+intery)));
childy[places[((((maxi-1)*27)+17))]] = parseInt(topy+(5*(childh+intery)));
childy[places[((((maxi-1)*27)+18))]] = parseInt(topy+(6*(childh+intery)));
childy[places[((((maxi-1)*27)+19))]] = parseInt(topy+(7*(childh+intery)));
childy[places[((((maxi-1)*27)+20))]] = parseInt(topy+(8*(childh+intery)));
childy[places[((((maxi-1)*27)+21))]] = parseInt(topy+(9*(childh+intery)));
childy[places[((((maxi-1)*27)+22))]] = parseInt(topy+(10*(childh+intery)));
childy[places[((((maxi-1)*27)+23))]] = parseInt(topy+(6*(childh+intery)));
childy[places[((((maxi-1)*27)+24))]] = parseInt(topy+(7*(childh+intery)));
childy[places[((((maxi-1)*27)+25))]] = parseInt(topy+(8*(childh+intery)));
childy[places[((((maxi-1)*27)+26))]] = parseInt(topy+(9*(childh+intery)));
childy[places[((((maxi-1)*27)+27))]] = parseInt(topy+(10*(childh+intery)));

var tagx = new Array(); //line array x
tagx[0] = 0;
tagx[places[((((maxi-1)*27)+1))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+2))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+3))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+4))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+5))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+6))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+7))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+8))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+9))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+10))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+11))]] = (topx+childw);
tagx[places[((((maxi-1)*27)+12))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+13))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+14))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+15))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+16))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+17))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+18))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+19))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+20))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+21))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+22))]] = parseInt((topx+(2*(interx+childw))));
tagx[places[((((maxi-1)*27)+23))]] = totalcentx;
tagx[places[((((maxi-1)*27)+24))]] = totalcentx;
tagx[places[((((maxi-1)*27)+25))]] = totalcentx;
tagx[places[((((maxi-1)*27)+26))]] = totalcentx;
tagx[places[((((maxi-1)*27)+27))]] = totalcentx;

var tagy = new Array(); //line array y
tagy[0] = 0;
tagy[places[((((maxi-1)*27)+1))]] = parseInt(topy+(0*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+2))]] = parseInt(topy+(1*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+3))]] = parseInt(topy+(2*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+4))]] = parseInt(topy+(3*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+5))]] = parseInt(topy+(4*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+6))]] = parseInt(topy+(5*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+7))]] = parseInt(topy+(6*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+8))]] = parseInt(topy+(7*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+9))]] = parseInt(topy+(8*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+10))]] = parseInt(topy+(9*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+11))]] = parseInt(topy+(10*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+12))]] = parseInt(topy+(0*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+13))]] = parseInt(topy+(1*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+14))]] = parseInt(topy+(2*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+15))]] = parseInt(topy+(3*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+16))]] = parseInt(topy+(4*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+17))]] = parseInt(topy+(5*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+18))]] = parseInt(topy+(6*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+19))]] = parseInt(topy+(7*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+20))]] = parseInt(topy+(8*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+21))]] = parseInt(topy+(9*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+22))]] = parseInt(topy+(10*(childh+intery))+(childh/2));
tagy[places[((((maxi-1)*27)+23))]] = parseInt(topy+(6*(childh+intery)));
tagy[places[((((maxi-1)*27)+24))]] = parseInt(topy+(7*(childh+intery)));
tagy[places[((((maxi-1)*27)+25))]] = parseInt(topy+(8*(childh+intery)));
tagy[places[((((maxi-1)*27)+26))]] = parseInt(topy+(9*(childh+intery)));
tagy[places[((((maxi-1)*27)+27))]] = parseInt(topy+(10*(childh+intery)));

//central topic
  jg[0].setPrintable(true);
  jg[0].setColor(centfillc);
  jg[0].fillRect(parseInt((totalcentx)-(centw/2)),(parseInt((totalcenty)-(centh/2))),centw,centh);
  jg[0].setColor(centstrokec);
  jg[0].setStroke(centstroke);
  jg[0].drawRect(parseInt((totalcentx)-(centw/2)),(parseInt((totalcenty)-(centh/2))),centw,centh);
  jg[0].drawImage(jp[0],(parseInt((totalcentx)-(centw/2))+centimx),(parseInt((totalcenty)-(centh/2))+centimy),centimw,centimh);
  jg[0].setColor(centfontc);
  jg[0].setFont(centfont,centfonts,Font.ITALIC_BOLD);
  jg[0].drawStringRect(jt[0],(parseInt((totalcentx)-(centw/2))+centimw+centimx+centtxtx),(parseInt((totalcenty)-(centh/2))+centtxty),(centw-centimw-centimx-(2*centtxtx)),centtxto);
  jt[0]=jt[0].replace(/-<br>/g,"");
  jg[0].drawImage(trans,parseInt((totalcentx)-(ancw/2)),(parseInt((totalcenty)-(centh/2))+centimy),(ancw+4),(anch+4),"alt="+ jt[0].replace(/ /g, "&nbsp;")+ " ");
  jg[0].paint();

//ancestor topic
  jg[24].setPrintable(true);
  jg[24].setColor(ancfillc);
  jg[24].fillRect(parseInt((totalcentx)-(ancw/2)),ancy,ancw,anch);
  jg[24].setColor(ancstrokec);
  jg[24].setStroke(ancstroke);
  jg[24].drawRect(parseInt((totalcentx)-(ancw/2)),ancy,ancw,anch);
  jg[24].drawImage(jp[24],(parseInt((totalcentx)-(ancw/2))+ancimx),(ancy+ancimy),ancimw,ancimh);
  jg[24].setColor(ancfontc);
  jg[24].setFont(ancfont,ancfonts); 
  jg[24].drawStringRect(jt[24],(parseInt((totalcentx)-(ancw/2))+ancimw+ancimx+anctxtx),(ancy+anctxty),(ancw-ancimw-ancimx-(2*anctxtx)),anctxto);
  jg[24].drawImage(grey,(parseInt((totalcentx)-(ancw/2))+ancimx),(ancy+ancimy),ancimw,ancimh);
  jg[24].setColor(ancfillc);
  jg[24].fillPolygon(new Array((artipx+ar[0]),(artipx+ar[1]),(artipx+ar[2]),(artipx+ar[3]),(artipx+ar[4]),(artipx+ar[4]),(artipx+ar[3]),(artipx+ar[2]),(artipx+ar[1])),new Array((artipy+ar[0]),(artipy-ar[5]),(artipy-ar[5]),(artipy-ar[6]),(artipy-ar[6]),(artipy+ar[6]),(artipy+ar[6]),(artipy+ar[5]),(artipy+ar[5])));
  jg[24].setColor(ancstrokec);
  jg[24].setStroke(2);
  jg[24].drawPolygon(new Array((artipx+ar[0]),(artipx+ar[1]),(artipx+ar[2]),(artipx+ar[3]),(artipx+ar[4]),(artipx+ar[4]),(artipx+ar[3]),(artipx+ar[2]),(artipx+ar[1])),new Array((artipy+ar[0]),(artipy-ar[5]),(artipy-ar[5]),(artipy-ar[6]),(artipy-ar[6]),(artipy+ar[6]),(artipy+ar[6]),(artipy+ar[5]),(artipy+ar[5])));
  jg[24].drawImage(trans,parseInt((totalcentx)-(ancw/2)),(ancy-2),(ancw+4),(anch+4),"onMouseOver=mouseOverUp() style='cursor: pointer; cursor: hand;'");
  jg[24].paint();

//children
	for (i=1;i<=maxi;i++)
	{
		jg[i].setPrintable(true);
		jg[i].setColor(childfillc);
		jg[i].fillRect(childx[i],childy[i],childw,childh);
		jg[i].setColor(childstrokec);
 		jg[i].setStroke(childstroke);
		jg[i].drawRect(childx[i],childy[i],childw,childh);
		jg[i].drawImage("../images/mindmap/small/"+jp[i].slice(31)+".jpg",(childx[i]+childimx),(childy[i]+childimy),childimw,childimh);
		jg[i].setColor(childfontc);
		jg[i].setFont(childfont,childfonts);
		jg[i].drawStringRect(jt[i],(childx[i]+childimw+childimx+childtxtx),(childy[i]+childtxty),(childw-childimw-childimx-(2*childtxtx)),childtxto);
		jg[i].drawImage(trans,(childx[i]-2),(childy[i]-2),(childw+4),(childh+4),"onMouseOver=mouseOver("+i+") style='cursor: pointer; cursor: hand;'");
		jg[i].paint();
	}

//lines
	for (i=1;i<=(maxi);i++)
	{
	jl[i].setPrintable(true);
  	jl[i].setColor(linec);
  	jl[i].setStroke(linestroke);
  	jl[i].drawLine(totalcentx,totalcenty,tagx[i],tagy[i]);
  	jl[i].paint();
	}
	jl[24].setPrintable(true);
  	jl[24].setColor(anclinec);
  	jl[24].setStroke(Stroke.DOTTED);
  	jl[24].drawLine(totalcentx,totalcenty,totalcentx,(ancy+anch));
  	jl[24].drawLine((totalcentx-1),totalcenty,(totalcentx-1),(ancy+anch));
  	jl[24].drawLine((totalcentx+1),totalcenty,(totalcentx+1),(ancy+anch));
  	jl[24].paint();
}


//show.hide div
function showlayer(layer){
var myLayer = document.getElementById(layer).style.display;
if(myLayer=="none"){
document.getElementById(layer).style.display="block";
//option to hide layer on click// } else { 
//option to hide layer on click// document.getElementById(layer).style.display="none";
}
}