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 isArray(obj)
{
	try
	{
		if( obj.constructor.toString().indexOf("Array") == -1 )
		{
			return false;
		}
		else
		{
			return true;
		}
	}
	catch( e )
	{
		return false;
	}
}

function getElementHeight(Elem)
{
	var xPos = 0;

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

function getElementWidth(Elem)
{
	var yPos = 0;
	
	if( op5 )
	{
		yPos = Elem.style.pixelWidth;
	}
	else
	{
		yPos = Elem.offsetWidth;
	}

	return yPos;
}

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, isInline)
{
	xPos = Elem.offsetLeft;

	if( !isInline )
	{
		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 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;
}

function getChildNodes( node )
{
	var nodes = new Array();
	for( i = 0, j = 0; i < node.childNodes.length; i++ )
	{
		if( node.childNodes[i].tagName != undefined )
		{
			nodes[j] = node.childNodes[i];
			j++;
		}
	}

	return nodes;
}


