/**
 * @author Timo 9.09.2005
 */
/**
 * GET BROWSER
//Opera/9.20 (Windows NT 5.1; U; en)
 //'Mozilla/4.0 (compatible;MSIE 6.0;Windows NT 5.1) Opera 7.54u1  [en]'Opera
  //'Mozilla/4.0 (compatible;MSIE 6.0;Windows NT 5.1;SV1;.NET CLR 1.1.4322)'Explorer
   //'Mozilla/5.0 (Windows;U;Windows NT 5.1;rv:1.7.3) Gecko/20041001 Firefox/0.10.1'Firefox
    //'Mozilla/5.0 (Windows;U;Windows NT 5.1;en-US;rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)'Netscape
     */
Log.browserTool=new String(window.navigator.userAgent);//FINAL, NO NEED FOR NEW INSTANCES
Log.browserTool.appVersion=parseInt((window.navigator.appVersion+'').split('.', 1)[0]);//FINAL, NO NEED FOR NEW INSTANCES

Log.browserTool._sEvent=null; // =-1; //='null';

if(Log.browserTool.indexOf('Firefox')!=-1){Log.browserTool._bFirefox=true;}
else if(Log.browserTool.indexOf('Opera')!=-1){
  Log.browserTool._bOpera=true;
  Log.browserTool._sEvent='event';
}
else if(Log.browserTool.indexOf('MSIE')!=-1){
//'Mozilla/4.0 (compatible;MSIE 6.0;Windows NT 5.1) Opera 7.54u1  [en]'Opera
  Log.browserTool._bMSIE=true;
  Log.browserTool._sEvent='event';
  if(Log.browserTool.indexOf('MSIE 7')!=-1){
  //Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; InfoPath.2; .NET CLR 3.0.04506.648)
    Log.browserTool._bMSIE7=true;
  }
}
if(Log.browserTool._bOpera==true&&!isNaN(Log.browserTool.appVersion)&&Log.browserTool.appVersion>8){
  Log.browserTool._bOpera9=true;
}
//Log.browserTool.vPrompt=prompt('I havenīt finished yet the version for :', Log.browserTool+' '+Log.browserTool.appVersion);
if(Log.browserTool._bFirefox==true){/*tolk._sCheckInputBreak='\n';*/Log.sJsBreak='\n';}

Log.browserTool._xCoefficent=1;
Log.browserTool._yCoefficent=1;
/**
 * @see page
 */
Log.browserTool._iTotalWidth=1280;
Log.browserTool._iTotalHeight=1024;
/**
 * 
 */
Log.browserTool.resolutionCoefficent=function(bHorisontal){    
	Log.browserTool._xCoefficent=1;   
	Log.browserTool._yCoefficent=1;
	try{
		Log.browserTool._xCoefficent=screen.width/Log.browserTool._iTotalWidth;//@see 0main.js
		Log.browserTool._yCoefficent=screen.height/Log.browserTool._iTotalHeight;
	}catch(e_rror){/*Log.showExeption( e_rror, Log.browserTool.resolutionCoefficent');*/}
	if (bHorisontal==true){
		return Log.browserTool._xCoefficent;
	}else{
		return Log.browserTool._yCoefficent;
	}
	return new Xy(Log.browserTool._xCoefficent, Log.browserTool._yCoefficent);
}//resolutionCoefficent

/**
 * The inner dimensions of the window or frame.
 * @author Peter-Paul Koch
 * @see http://www.quirksmode.org/viewport/compatibility.html
 */
Log.browserTool.innerDimension=function(bHorisontal){
	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;
	}
	if (bHorisontal==true){
		return x;
	}else if (bHorisontal==false){
		return y;
	}
	return new Xy(x, y);
}//innerDimension 

/**
 * How much the page has scrolled.
 * @author Peter-Paul Koch
 * @see http://www.quirksmode.org/viewport/compatibility.html
 */
Log.browserTool.scrollingOffset=function(bHorisontal){
	var x,y;
	if (self.pageYOffset) // all except Explorer
	{
		x=self.pageXOffset;
		y=self.pageYOffset;
	}
	else if (document.documentElement && document.documentElement.scrollTop)
		// Explorer 6 Strict
	{
		x=document.documentElement.scrollLeft;
		y=document.documentElement.scrollTop;
	}
	else if (document.body) // all other Explorers
	{
		x=document.body.scrollLeft;
		y=document.body.scrollTop;
	}
	if (bHorisontal==true){
		return x;
	}else if (bHorisontal==false){
		return y;
	}
	return new Xy(x, y);
}//scrollingOffset 

/**
 * The height of the total page (usually the body element).
 * This is a tricky one, some browsers require scrollHeight, others offsetHeight, but all browsers support both properties.
 * Therefore I see which property has the larger value.
 * This means the page height the script below gives is never smaller than the window height.
 * @author Peter-Paul Koch
 * @see http://www.quirksmode.org/viewport/compatibility.html
 */
Log.browserTool.pageHeight=function(bHorisontal){
	var x,y;
	var test1=document.body.scrollHeight;
	var test2=document.body.offsetHeight;
	if (test1 > test2) // all but Explorer Mac
	{
		x=document.body.scrollWidth;
		y=document.body.scrollHeight;
	}
	else // Explorer Mac;
		//would also work in Explorer 6 Strict, Mozilla and Safari
	{
		x=document.body.offsetWidth;
		y=document.body.offsetHeight;
	}
	if (bHorisontal==true){
		return x;
	}else if (bHorisontal==false){
		return y;
	}
	return new Xy(x, y);
}//pageHeight 
/**
 * @author timo
 */
Log.browserTool.elementPx=function(e_lement){
	var i_x ,i_y;
	i_x=parseInt(e_lement.style.left);
	if (isNaN(i_x)){i_x=0;}	
	i_y=parseInt(e_lement.style.top);
	if (isNaN(i_y)){i_y=0;}
	return new Xy(i_x,i_y);
}//elementPx

