
// Oedipus file  (c) 2003 Lamain Bergen, www.lamain.nl

function Persons(xpos,ypos,naam, sex,geb,overl, getrouwd, naampartner) {
        this.xpos=xpos
        this.ypos=ypos
	this.naam=naam
        this.sex=sex
        this.geb = geb
        this.overl = overl
        this.getrouwd = getrouwd
        this.naampartner = naampartner
}


function writePerson(st) {
   if(Person[st].naam=='') return

var cont='<div ID="divstyle" STYLE="top:'+Person[st].ypos+'; left:'+Person[st].xpos
    if(nobox==false) {
      if(Person[st].sex==1) cont+='; BACKGROUND-COLOR:#c5d6fe'
      else cont+='; BACKGROUND-COLOR:#fec7d0'
    }
    cont+=';">'
    if(flyover) cont+='<a onMouseOver="createBoxLayer('+st+')"  onMouseOut="destroyBoxLayer()">'+Person[st].naam+'</a></div>'
    else cont+='<a onClick="createBoxLayer('+st+')">'+Person[st].naam+'</a></div>'
    document.write(cont)
}

function createBoxLayer(str1) {	
    var sx=Person[str1].xpos+30
    var sy=Person[str1].ypos+15  

    if(boxlayeron) {
		if(flyover==false) destroyBoxLayer()
                else return
    }

var str ='<table border=1 cellspacing=1 cellpadding=0 width=250 height=200 >'
    str+='<tr height=20><td valign=top>'
    if(flyover==false) str+='<a onClick="destroyBoxLayer()">'
    str+='<table><tr><td valign=top width='
    if(flyover==false) str+='220 '
    else str+='250 '
    str+=(Person[str1].sex==1) ? 'bgcolor=#c5d6fe' : 'bgcolor=#fec7d0'
    str+='><b><center>'+Person[str1].naam+'</center></b>'
    if(flyover==false) str+='</td><td width=15 align=right><img src="checkbox0.gif">'
    str+='</td></tr></table>'
    if(flyover==false) str+='</a>'
    str+='<table cellspacing=1 cellpadding=0>'
    if(Person[str1].geb!='') str+='<tr><td><Font size=2> geb.&nbsp;</td><td><Font size=2>'+Person[str1].geb+'</td></tr>'
    if(Person[str1].overl!='') str+='<tr><td><Font size=2> overl. &nbsp; </td><td><Font size=2>'+Person[str1].overl+'</td></tr>'
    if(Person[str1].naampartner!='') {
       str+='<tr><td><Font size=2> partner &nbsp; </td><td><b><Font size=2>'+Person[str1].naampartner+'</b></td></tr>'
       if(Person[str1].getrouwd!='') str+='<tr><td><Font size=2> trouwt &nbsp; </td><td><Font size=2>'+Person[str1].getrouwd+'</td></tr>'
    }
    str+='</TABLE></TD></TR></TABLE>'

    createLayer('boxlayerDiv',null,sx,sy,250,200,str,'#dddddd')
    boxlayer = new DynLayer('boxlayerDiv')
    boxlayeron=true
}


function destroyBoxLayer() {
        if(boxlayeron) {
		destroyLayer('boxlayerDiv')
		delete boxlayer
        }
        boxlayeron=false
}