String.prototype.trim = function( )
{
	return this.replace(/^\s+|\s+$/, '');
}

var ns4 = document.layers;
var op5 = (navigator.userAgent.indexOf("Opera 5")!=-1) 
	||(navigator.userAgent.indexOf("Opera/5")!=-1);
var op6 = (navigator.userAgent.indexOf("Opera 6")!=-1) 
	||(navigator.userAgent.indexOf("Opera/6")!=-1);
var agt=navigator.userAgent.toLowerCase();
var mac = (agt.indexOf("mac")!=-1);
var ie = (agt.indexOf("msie") != -1); 
var mac_ie = mac && ie;
var ie6 = ie && (document.implementation != null) && (document.implementation.hasFeature != null);
var ie55 = ie && (document.namespaces != null) && !ie6;

function initAll( )
{
	var lmenuItems = document.getElementById("lmenu").getElementsByTagName("li");
	for( var key = 0; key < lmenuItems.length; key++ )
	{
		lmenuItems[key].childNodes[1].onmouseover = function( )
		{
			this.parentNode.firstChild.style.visibility = "visible"; 
		}

		lmenuItems[key].childNodes[1].onmouseout = function( )
		{
			this.parentNode.firstChild.style.visibility = "hidden";
		}
	}
}

function isArray(obj)
{
	try
	{
		if( obj.constructor.toString().indexOf("Array") == -1 )
		{
			return false;
		}
		else
		{
			return true;
		}
	}
	catch( e )
	{
		return false;
	}
}

function showFloater( f_title, f_content, f_width, f_height )
{
	if( f_width == null )
	{
		f_width = 400;
	}
	if( f_height == null )
	{
		f_height = 300;
	}

	Floater.reinit( 'new', f_title, f_content, f_width, f_height );
}

function hideFloater( )
{
	Floater.close( 'new' );
}

function closeFloater( )
{
	Floater.close( 'new' );
}

function pageWidth( )
{
	return window.innerWidth != null ? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
}

function pageHeight( )
{
	return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null ? document.body.clientHeight : null;
}

function posLeft( )
{
	return typeof window.pageXOffset != 'undefined' ? window.pageXOffset : document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;
}

function posTop( )
{
	return typeof window.pageYOffset != 'undefined' ?  window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;
}

function posRight( )
{
	return posLeft( ) + pageWidth( );
}

function posBottom( )
{
	return posTop( ) + pageHeight( );
}

function getElementLeft(Elem) {
	xPos = Elem.offsetLeft;
	tempEl = Elem.offsetParent;
  	while (tempEl != null) {
  		xPos += tempEl.offsetLeft;
  		tempEl = tempEl.offsetParent;
 	}
	return xPos;
}

function getElementTop(Elem) {
	yPos = Elem.offsetTop;
	tempEl = Elem.offsetParent;
	while (tempEl != null) {
  		yPos += tempEl.offsetTop;
  		tempEl = tempEl.offsetParent;
	}
	return yPos;
}

function getElementHeight(Elem) {
	if (op5) { 
		xPos = Elem.style.pixelHeight;
	} else {
		xPos = Elem.offsetHeight;
	}
	return xPos;
}

function getElementWidth(Elem) {
	if (op5) {
		xPos = Elem.style.pixelWidth;
	} else {
		xPos = Elem.offsetWidth;
	}
	return xPos;
}

function getElementsByClass( searchClass, node )
{
	var classElements = new Array();
	if( node == null )
	{
		node = document;
	}
	
	for( i = 0, j = 0; i < node.childNodes.length; i++ )
	{
		if( node.childNodes[i].className == searchClass )
		{
			classElements[j] = node.childNodes[i];
			j++;
		}
	}

	return classElements;
}

