/*
bWeb javascript  framework
Author: Bernie Witter <webmaster@syscon-gmbh.com>
(©) 2003-2006
**************************************/
/*evaluates the position of the mouse 
and fills tho global @ _ba_mouse */
function _gibMaus(Ereignis){
var x,y;
	if(!window.event){//Firefox
	x = Ereignis.pageX;
	y = Ereignis.pageY;
	}else{//IE
	x = window.event.clientX;
	y = window.event.clientY;
	}
_ba_mouse = new Array(x,y);
}
//==================================
function _isEmail(email)
{
	if(!email.match(/^.{1,}@.{1,}\..{1,}$/)) return false;
	else return true;
}
//========================
// get element by id and set innerHTML
function _setID(id,content){
var res = document.getElementById(id).innerHTML = content;
}
/* evaluate if a node contains a value and return it
==========================================*/
function _hasValue(obj){
	if(obj.hasChildNodes()==true) return obj.firstChild.data;
	else{
		 return "&nbsp;";
		
	}
}
/*evaluate size of browser window:
=======================================*/
function _winDim(){
var x,y;
if (self.innerHeight) // all except Explorer
{
	x = self.innerWidth;
	y = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
{
	x = document.documentElement.clientWidth;
	y = document.documentElement.clientHeight;
}
else if (document.body) // other Explorers
{
	x = document.body.clientWidth;
	y = document.body.clientHeight;
}
var result = new Array(x,y);
return result;
}
/* center a given id
===========================================*/
function _center(id){
var winDim = _winDim();
// get element:
var e = document.getElementById(id);
var e_width = parseInt(e.style.width);
var e_height = parseInt(e.style.height);
var left,top;
	if(e_width>winDim[0]) left = 5;
	else
	left = Math.round(winDim[0]/2)-(Math.round(e_width/2));
	if(e_height>winDim[1]) top = 5; 
	else
	top = Math.round(winDim[1]/2)-(Math.round(e_height/2));
	e.style.position = "absolute";
	e.style.top = top+"px";
	e.style.left = left+"px";
}
//========================================
function _fullHeight(id){
var winDim = _winDim();
var container = document.getElementById(id);
	if(container) container.style.height = winDim[1]+"px";
}

