
window.onresize = resizemap;

function resizemap() {
	try {
	document.getElementById("app").style.width=clientAreaWidth();
//	document.getElementById("app").style.height= clientAreaHeight()-5;
} catch(err) {
}
}

function clientAreaWidth(){
         if (window.innerWidth!=window.undefined) return window.innerWidth;
         if (document.compatMode=='CSS1Compat') return document.documentElement.clientWidth;
         if (document.body) return document.body.clientWidth;
         return window.undefined;
}
function clientAreaHeight(){
         if (window.innerHeight!=window.undefined) return window.innerHeight;
         if (document.compatMode=='CSS1Compat') return document.documentElement.clientHeight;
         if (document.body) return document.body.clientHeight;
         return window.undefined;
}




function SetDiagram(pID) {
var cApplet;

	cApplet	= '<APPLET id="app" archive="http://www.piwkowski.net/qt/QGenTree.jar" code="org/apsoft/genealogy/TreePanel.class" width="800" height="350">';
	cApplet = cApplet + '<param name="PERSON" VALUE="' + pID + '"/>';
	cApplet = cApplet + '<param name="COMPACT" VALUE="Yes"/>';
	cApplet = cApplet + '<param name="TO_PARENT" VALUE="Yes"/>';
	cApplet = cApplet + '</APPLET>';
	document.getElementById("applet").innerHTML = cApplet;
	
	cApplet = '<center>';
	cApplet = cApplet + '<a target="_blank" href="http://www.piwkowski.net/qt/tp.php?PERSON=' + pID + '&amp;TO_PARENT=Yes">Pokaż ten diagram w osobnym oknie</a>';
	cApplet = cApplet + '</center>';
	document.getElementById("applet_link").innerHTML = cApplet;

	document.getElementById("applet_button").style.visibility = "hidden";

	resizemap();

}
