/*************************************************************************
*		PHP Work Base
*
*	Este Arquivo é parte integrande do PHP Work Base
*
*	PHP Work Base é um software livre, você pode redistribuí-lo
*	e/ou modificá-lo sob os termos da GNU General Public License
*	conforme publicada pela Free Software Foundation, versão 2 da
*	Licença, ou (na sua opção) qualquer versão posterior.
*
*	PHP Work Base é distribuído na esperança que será
*	útil, mas SEM QUALQUER GARANTIA, sem mesmo a garantia implícita de
*	COMERCIABILIDADE ou ADEQUAÇÃO A UM DETERMINADO PROPÓSITO. Veja a
*	GNU General Public License para mais detalhes.
*
*	Você deve ter recebido uma cópia da GNU General Public License
*	junto com o PHP Work Base; se não, escreva para a
*	Free Software Foundation, Inc.,
*	59 Temple Place, Suite 330, Boston, MA 02111-1307 E.U.A.
*
*	copyright 2010 Silas B. Domingos
*
*	Funções para o componente painel fluruante
*
**************************************************************************/

function FP_PHPWBSetSize(id,w,h)
{
	var obj=document.getElementById(id);
	if(!obj)
		return;

	var wp=document.getElementById('webpage');
	if(!wp)
		return;
		
	if(w){

		var w=(navigator.appName=="Netscape"?(document.body.clientWidth-17):document.body.clientWidth);
		if(w > wp.offsetWidth)
			obj.style.width = w;
		else
			obj.style.width = wp.offsetWidth;
	}
	
	if(h){

		var h=document.body.clientHeight;
		if(h > wp.offsetHeight)
			obj.style.height = h;
		else
			obj.style.height = wp.offsetHeight;
	}
}

function FP_PHPWBAlignCenter(id)
{
	var obj=document.getElementById(id);
	if(!obj)
		return;
		
	var wp=document.getElementById('webpage');
	if(!wp)
		return;
		
	var w=(navigator.appName=="Netscape"?(document.body.clientWidth-17):document.body.clientWidth);
	var h=document.body.clientHeight;
	
	if(w > wp.offsetWidth)
		obj.style.left = ((w-obj.offsetWidth)/2);
	else
		obj.style.left = ((wp.offsetWidth-obj.offsetWidth)/2);
		
	if(h > wp.offsetHeight)
		obj.style.top = ((w-obj.offsetHeight)/2);
	else
		obj.style.top = ((wp.offsetHeight-obj.offsetHeight)/2);
}
