extensions.push('application');

function positionGui() {
	var xPos=(document.body.clientWidth-document.getElementById('guiContainer').style.pixelWidth)/2;
	if(xPos<0)
		xPos=0;
	var yPos=(document.body.clientHeight-document.getElementById('guiContainer').style.pixelHeight)/2;
	if(yPos<0)
		yPos=0;

	document.getElementById('guiContainer').style.pixelLeft=xPos;
	document.getElementById('guiContainer').style.pixelTop=yPos;

	/*consolePosX=xPos;
	consolePosY=yPos;*/
}

function applicationBegin() {
	eventListeners.attachToEvent('queryEnd','deselectTreeFunction');
	var screenWidth=window.screen.width;
	guiVersion='small';
	if(screenWidth>800) {
		guiVersion='big';
		
		document.getElementById('guiContainer').style.pixelWidth=document.getElementById('guiContainer').style.pixelWidth+220;
		document.getElementById('guiContainer').style.pixelHeight=document.getElementById('guiContainer').style.pixelHeight+148;
		if(document.getElementById('UCTreeActionPanel1_TreeView1_div'))
			document.getElementById('UCTreeActionPanel1_TreeView1_div').style.height=309;
		/*document.getElementById('mapBookmark').style.pixelWidth=660;
		document.getElementById('mapBookmark').style.pixelHeight=450;
		
		document.getElementById('legendDiv').style.pixelHeight=471;
		document.getElementById('legendDiv').style.clip='rect(0 120 471 0)';
		document.getElementById('loadmessage').style.pixelLeft=100;
		document.getElementById('loadmessage').style.pixelTop=80;
		document.getElementById('scaleDiv').style.pixelTop=500;
		document.getElementById('scaleSfondoDiv').style.pixelTop=477;*/
	}

	positionGui();
}
