// ----------------------------------------------
//          (c) by sign of renitence 2000             
//          for more information contact         
//                info@renitence.de            
// ----------------------------------------------

// general information:
var isNav=false, isIE=false, OS="", version;
var coll="", styleObj="";

version=parseInt( navigator.appVersion );

if( navigator.appName=="Netscape" )
{
	isNav=1;
	if( version>=4 )
	{
  	origWidth=innerWidth;
  	origHeight=innerHeight;
		window.onresize=handleResize;
		
		if( !window.saveInnerWidth )
		{
			window.captureEvents( Event.RESIZE );
  		window.onresize = handleResize;
  		window.saveInnerWidth = window.innerWidth;
  		window.saveInnerHeight = window.innerHeight;
		}
	}
}
else
{
  isIE=1;
	coll="all.";
	styleObj=".style";
}

     if( navigator.userAgent.indexOf("Win")!=-1 ) OS="Win";
else if( navigator.userAgent.indexOf("Mac")!=-1 ) OS="Mac";
else if( navigator.userAgent.indexOf("X11")!=-1 ) OS="Unix";
else                                              OS="-unknown-";

if( false && isIE && OS=="Win" && version>=4 )
{
	document.writeln( "<object" );
  document.writeln( "classid=\"clsid:0246ECA8-996F-11D1-BE2F-00A0C9037DFE\"" );
  document.writeln( "codebase=\"http://www.truedoc.com/activex/tdserver.cab#version=1,0,0,9\"" );
  document.writeln( "id=\"TDS\" width=0 height=0" );
  document.writeln( ">" );
  document.writeln( "</object>"); 
}

function handleResize( )
{
	if( isNav && version>=4 &&
			(saveInnerWidth !=window.innerWidth  ||
       saveInnerHeight!=window.innerHeight ))
	{
    window.history.go( 0 );
		return( false );
	}
	
	return( true );
}

// utility functions:

function getObj( objID )
{
	if( (typeof objID=="string") ) return( eval( "document."+coll+objID ) );
	else                           return( objID );
}

function getObjX( obj )
{
	if( isNav ) return( obj.left );
	else        return( obj.style.pixelLeft );
}

function getObjY( obj )
{
	if( isNav ) return( obj.top );
	else        return( obj.style.pixelTop );
}

function getObjW( obj )
{
	if( isNav ) return( obj.clip.width );
	else        return( obj.clientWidth );
}

function getObjH( obj )
{
	if( isNav ) return( obj.clip.height );
	else        return( obj.clientHeight );
}

function getWinInnerW( )
{
	if( isNav ) return( window.innerWidth );
	else        return( document.body.clientWidth );
}

function getWinInnerH( )
{
	if( isNav ) return( window.innerHeight );
	else        return( document.body.clientHeight );
}

function getPageX( obj )
{
	if( isNav ) return( obj.pageX );
	else        return( obj.offsetLeft );
}

function getPageY( obj )
{
	if( isNav ) return( obj.pageY );
	else        return( obj.offsetTop );
}

function showObj( obj )
{
	if( isIE ) obj=obj.style;
	obj.visibility="visible";
}

function hideObj( obj )
{
	if( isIE ) obj=obj.style;
	obj.visibility="hidden";
}

function moveObjTo( obj, x, y )
{
	if( isNav ) obj.moveTo( x, y );
	else
	{
		obj.style.pixelLeft=x;
		obj.style.pixelTop =y;
	}
}

function moveObjBy( obj, dx, dy )
{
	if( isNav ) obj.moveBy( dx, dy );
	else
	{
		obj.style.pixelLeft+=dx;
		obj.style.pixelTop +=dy;
	}
}

function sizeObjTo( obj, w, h )
{
	if( isNav )
	{
		obj.clip.width=w;
		obj.clip.height=h;
	}
	else
	{
		obj.style.width=w;
		obj.style.height=h;
	}
}

function setZIndex( obj, zOrder )
{
	if( isNav ) obj.zIndex=zOrder;
	else        obj.style.zIndex=zOrder;
}
