/*function getAbsoluteLeft(o)
{
	return Element.cumulativeOffset(o).left;

	var oParent;
	var oLeft = o.offsetLeft;
	
	while(o.offsetParent!=null)
	{
		oParent = o.offsetParent
		oLeft += oParent.offsetLeft
		o = oParent
	}
	return oLeft
}*/

/*function getAbsoluteTop(o)
{
	return Element.cumulativeOffset(o).top;

	var oParent;
	var oTop = o.offsetTop;
	
	while(o.offsetParent!=null)
	{
		oParent = o.offsetParent
		oTop += oParent.offsetTop
		o = oParent
	}
	return oTop
}*/

/*function getMouseXY(e) {
	if (!e) e = window.event;
	if (e.target) tempTarg = e.target;
	else if (e.srcElement) tempTarg = e.srcElement;
	// defeat Safari bug
	if (tempTarg.nodeType == 3) tempTarg = tempTarg.parentNode;
	
	if (document.all) // grab the x-y pos.s if browser is IE
	{
	    tempX = e.clientX + document.body.scrollLeft;
	    tempY = e.clientY + document.body.scrollTop;
	}
	else // grab the x-y pos.s if browser is NS
	{  
		tempX = e.pageX
		tempY = e.pageY
	}  
	// catch possible negative values in NS4
	if (tempX < 0) tempX = 0;
	if (tempY < 0) tempY = 0;
  
	return true
}*/

/*function highLightElement(element)
{
	// set row style to highLighted	style
	element.style.backgroundColor = "#4477AA";
	element.style.color = "#FFFFFF";
	element.style.cursor = "default";
}*/

/*var ns			=	(window.navigator.appName.toLowerCase() == "netscape");
var ie			=	(window.navigator.appName.toLowerCase() == "microsoft internet explorer");
var agt			=	navigator.userAgent.toLowerCase();
var is_major	=	parseInt(navigator.appVersion);
var is_ie4up	=	(ie && (is_major >= 4));*/

/*function visibleDivCentered(lyrname,lyrwidth,lyrheight,doc)
{
	var element = lyrname;
	
	if (!doc) doc = document;

	if($(element) != null)
	{
		$(element).style.left = Math.round(( doc.viewport.getScrollOffsets().left + doc.viewport.getWidth() - $(element).getWidth() ) / 2) + 'px';
		$(element).style.top = Math.round(( doc.viewport.getScrollOffsets().top + doc.viewport.getHeight() - $(element).getHeight() ) / 2) + 'px';
	}


	getwindowdims();
	// to center the window we need to know the window width and height	
	
	starty = getpagescrolly() + ((w_y / 2) - (lyrheight /2));
	startx = getpagescrollx() + ((w_x / 2) - (lyrwidth /2));


	visibleDiv(lyrname,startx,starty,doc);
}*/

/*function getpagescrollx()
{
	if(is_ie4up)return document.documentElement.scrollLeft;
	else return window.pageXOffset;
}*/

/*function getpagescrolly()
{
	if(is_ie4up)return document.documentElement.scrollTop;
	else return window.pageYOffset;
}*/


/*function getwindowdims()
{	
	w_y=(is_ie4up)?document.documentElement.clientHeight:window.innerHeight;
	w_x=(is_ie4up)?document.documentElement.clientWidth:window.innerWidth;
}*/

/*function visibleDiv(divname,x,y,doc)
{
	if (doc == null) doc = document;
	
	if (doc.getElementById(divname))
	{
    	if(x != null) doc.getElementById(divname).style.left = x + "px";
    	if(y != null)  doc.getElementById(divname).style.top = y + "px";

		doc.getElementById(divname).style.visibility = 'visible';
	}
}*/

/*function removeArrayItem(arr,arritem)
{
	var i = 0;
	
	while (i < arr.length)
	{
		if (arr[i] == arritem) arr.splice(i,1);
		else i++;
	}
}*/

function showMessage(message,classname,id)
{
	if (message.length > 0)
	{
		if (id == null) id = "messagediv";
		
		var newdiv = document.createElement('div');
  		newdiv.setAttribute('id',id);
  		newdiv.className = classname;
  		newdiv.innerHTML = message;
  		document.body.appendChild(newdiv);
   }
}

/*function getKeyCode(e)
{
	if (!e)
	{
		if (window.event) e = window.event;
		else return 0;
	}
  
	if (typeof(e.keyCode) == 'number') return e.keyCode; //DOM
	else if (typeof(e.which) == 'number') return e.which; //NS 4 compatible
	else if (typeof(e.charCode) == 'number') return e.charCode; //also NS 6+, Mozilla 0.9+
	else return 0; //total failure, we have no way of obtaining the key code
}*/
