function ItzUtil()
{
    this.ns4        		= (document.layers)? true:false;
    this.ie4        		= (document.all)? true:false;

    if (window.XMLHttpRequest)  
    {
        this.http_request = new XMLHttpRequest();

        if (this.http_request.overrideMimeType) 
        {
            this.http_request.overrideMimeType('text/xml');
        }
    }	 
    else if (window.ActiveXObject) 
    {
        try 
        {
            this.http_request = new ActiveXObject('Msxml2.XMLHTTP');
        } 
        catch (e) 
        {
            try 
            {
                this.http_request = new ActiveXObject('Microsoft.XMLHTTP');
            }
            catch (e)
            { 
                alert('Error during instance creation: ' + e.description);
            }
        }
    }

    this.changeTabs = function(srcObject, srcStyle, destStyle)
    {
        var links = document.getElementsByTagName('a');
        var i;

        for(i=0; i< links.length; i++)
        {
            if(links[i].className == srcStyle)
            {
               links[i].className = destStyle;
            }
                
        }

         
        if(null != srcObject)
        {
            srcObject.className = srcStyle;
        }

    }

    this.getAjaxJSON = function(url, data)
    {
        this.http_request.open('POST', url, false);
        this.http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	this.http_request.send(data);
    
        eval(this.http_request.responseText);

        return(optionsObj);
    }

    this.getAjaxXML = function(url, data)
    {
        this.http_request.open('POST', url, false);
        this.http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	this.http_request.send(data);

        return(this.http_request.responseXML);
    }

    this.getAjaxText = function(url, data)
    {
        this.http_request.open('POST', url, false);
        this.http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	this.http_request.send(data);

        return(this.http_request.responseText);
    }

    this.cancelBubble = function(event)
    {
        if(typeof(event) == "undefined" && typeof(window.event) != "undefined") 
        {
            event = window.event;
        }

        if (typeof(window.event) != "undefined")
        {
            event.cancelBubble=true;
        }
        else 
        {
            event.stopPropagation();
        }

    }

    this.notNull = function(value)
    {
            if(null == value || value.length <= 0)
            {
                    return('');
            }

            return(value);
    }

    this.getObjectById = function(id)
    {
        return(document.getElementById(id));
    }

    this.showObjectById = function (id,display)
    { 
        if(display == true)
        {
            if(navigator.appName.indexOf('Microsoft') > -1) 
            {    			
                document.getElementById(id).style.display ='block';
            } 
            else 
            {
                document.getElementById(id).style.display ='table-row';
            }
        }
        else 
        {
           document.getElementById(id).style.display ='none';
        }

    }

    this.showObject = function (object,display)
    { 
        if(display == true)
        {
            if(navigator.appName.indexOf('Microsoft') > -1) 
            {    			
                object.style.display ='block';
            } 
            else 
            {
                object.style.display ='table-row';
            }
        }
        else 
        {
           object.style.display ='none';
        }
    }



    this.getWindowSize =  function()
    {
        var w = 0;
	var h = 0;

	if(!window.innerWidth)
	{
		if(!(document.documentElement.clientWidth == 0))
		{
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		}
		else
		{
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
	}
	else
	{
		w = window.innerWidth;
		h = window.innerHeight;
	}
	

       return({width:w,height:h});

    }

    this.getWindowCenter = function()
    {
	var hWnd = (arguments[0] != null) ? arguments[0] : {width:0,height:0};

	var tempX = 0;
	var tempY = 0;
	var offsetX = 0;
	var offsetY = 0;

	if(!window.pageYOffset)
	{
		if(!(document.documentElement.scrollTop == 0))
		{
			offsetY = document.documentElement.scrollTop;
			offsetX = document.documentElement.scrollLeft;
		}
		else
		{
			offsetY = document.body.scrollTop;
			offsetX = document.body.scrollLeft;
		}
	}
	else
	{
		offsetX = window.pageXOffset;
		offsetY = window.pageYOffset;
	}

	tempX = ((this.size().width-hWnd.width)/2)+offsetX;
	tempY = ((this.size().height-hWnd.height)/2)+offsetY;

	return({x:tempX,y:tempY});
    }


    this.getText = function(dom, field)
    {
            if(null == dom)
            {   
                    return('');
            }

            if(null == dom.getElementsByTagName(field))
            {   
                    return('');
            }

        if(dom.getElementsByTagName(field).length <= 0)
        {   
                    return('');
            }   

        if(dom.getElementsByTagName(field)[0].childNodes.length <= 0)
        {
                    return('');
            }

        return(dom.getElementsByTagName(field)[0].childNodes[0].nodeValue);
    }

        this.removeFirstZero = function(value)
        {
                var returnValue;

                returnValue = value;

                if(value.indexOf('0') == 0)
                {
                        returnValue = value.substring(1,value.length);
                }

                return(returnValue);
        }

        this.findX = function(obj)
        {
            var returnValue = 0;
    
            if(obj.offsetParent)
            {
                while(1) 
                {
                    returnValue += obj.offsetLeft;
                    
                    if(!obj.offsetParent)
                    {
                        break;
                    }

                    obj = obj.offsetParent;
                }
            }
            else if(obj.x)
            {
                returnValue += obj.x;
            }

            return(returnValue);
        }

        this.findY = function(obj)
        {
            var returnValue = 0;
    
            if(obj.offsetParent)
            {
                while(1) 
                {
                    returnValue += obj.offsetTop;
                    
                    if(!obj.offsetParent)
                    {
                        break;
                    }

                    obj = obj.offsetParent;
                }
            }
            else if(obj.y)
            {
                returnValue += obj.y;
            }

            return(returnValue);
        }
}

