/*
Small Business Office Management and Processing System (SBOMPS)
Copyright(C) 2006-2008 Graham Philips
SBOMPS is licensed under the GNU General Public License.
Please See license.html or http://www.gnu.org/licenses/gpl.txt for the full license
If there are problems, see http://sourceforge.net/projects/sbomps/ for support.

SBOMPS comes with ABSOLUTELY NO WARRANTY
  
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
*/

var IE = document.all?true:false

function formToggleAll(inputFormName)
{
	(window.isAlTicked=!window.isAlTicked);
	
	inputForm = document.getElementById(inputFormName)
	for(var i=0;inputForm.elements[i];i++)
	{
	if (inputForm.elements[i].type=='checkbox')
		{
			inputForm.elements[i].checked=window.isAlTicked;
		}
	}
}

function popdesc(e, style, xoffset, yoffset, title, desc)
{
    document.getElementById('tip').innerHTML = "<table class='"+style+"' border='0'><tr><td class='"+style+"title'>" + title + "</td></tr><tr><td class='"+style+"text'>" + desc + "</td></tr></table>";
	 
	if (IE)
	{
		coordX = event.clientX + document.body.scrollLeft;
		coordY = event.clientY + document.body.scrollTop;
	}
	else
	{
		coordX = e.pageX;
		coordY = e.pageY;
	}
	
     var t = document.getElementById('tip').style;
     t.left = coordX+xoffset+"px";
     t.top = coordY+yoffset+"px";
     t.visibility = 'visible';
}

function cleartip()
{
     document.getElementById('tip').style.visibility = 'hidden';
}

/* AJAX document loading code */

/* AJAX document loading code */

var url;
var xmlHttp;
var messagePrefix = "<p class=\"alertmessage\">";
var messageSuffix = "</p>";

function GetXmlHttpObject()
{ 
	var objXMLHttp = null;
	if (window.XMLHttpRequest)
	{
		objXMLHttp = new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	if (objXMLHttp === null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	} 
	return objXMLHttp;
}

function xmlHttpResponse(messageID,messageContent,displayID)
{
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
	{
		document.getElementById(messageID).innerHTML = messageContent;
		document.getElementById(displayID).innerHTML = xmlHttp.responseText;
	}
}

// -->