﻿//<![CDATA[
/******************************************************************************
*******************************************************************************
	VARIABLES Specific to Web Environment
*******************************************************************************
******************************************************************************/
var _web = 
{
    DefaultPage : 'default.aspx',
    AppPath : (typeof AppPath == 'undefined') ? '' : AppPath
};

/******************************************************************************
*******************************************************************************
	VARIABLES
*******************************************************************************
******************************************************************************/
var _browser = 
{
    Name :
    ((navigator.userAgent.toLowerCase().indexOf('msie') > -1 && navigator.userAgent.toLowerCase().indexOf('america online') == -1)) ? 'IE' :
    ((navigator.userAgent.toLowerCase().indexOf('bot') > -1) || (navigator.userAgent.toLowerCase().indexOf('slurp') > -1)) ? 'BOT' :
    (navigator.userAgent.toLowerCase().indexOf('w3c') > -1) ? 'W3C' :
    (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) ? 'Firefox' :
    (navigator.userAgent.toLowerCase().indexOf('netscape') > -1) ? 'Netscape' :
    (navigator.userAgent.toLowerCase().indexOf('safari') > -1) ? 'Safari' :
    ((navigator.userAgent.toLowerCase().indexOf('america online') > -1) || navigator.userAgent.toLowerCase().indexOf('aol') > -1) ? 'AOL' :
    (navigator.userAgent.toLowerCase().indexOf('opera') > -1) ? 'Opera' : 'Unknown'
};

var _app = 
{
	SID : function() { return _cookie.Get('_sid'); },
    Domain : window.location.host,
    SitePath : function()
    {
		var sp = (window.location.href.indexOf(_web.AppPath) > -1) ? window.location.protocol + '//' + window.location.host + _web.AppPath : window.location.protocol + '//' + window.location.host + '/';
		
		sp = sp.toLowerCase();
		
		return sp;
	},
    CDir : window.location.pathname.replace(window.location.pathname.substring(window.location.pathname.lastIndexOf('/') + 1), '').substring(1),
    CPage : (window.location.pathname.replace(_web.AppPath, '') == '') ? _web.DefaultPage : (window.location.pathname.replace(_web.AppPath, '').charAt(0) == '/') ? window.location.pathname.replace(_web.AppPath, '').substring(1) : window.location.pathname.replace(_web.AppPath, ''),
    IE : (_browser.Name == 'IE') ? true : false,
    FF : (_browser.Name == 'Firefox') ? true : false,
    NS : (_browser.Name == 'Netscape') ? true : false,
    SF : (_browser.Name == 'Safari') ? true : false,
    AO : (_browser.Name == 'AOL') ? true : false,
    OP : (_browser.Name == 'Opera') ? true : false,
    Debug : false,
    Print : false,
    Height : 0,
    Width : 0,
    xwin : null,
    swin : null,
    awin : null,
    cwin : null,
    rwin : null,
    ewin : null,
	dt : function()
	{
		var tdt = new Date();
		
		return tdt.getMonth() + 1 + '/' + tdt.getDate() + '/' + tdt.getFullYear();
	},
	TDY : function()
	{
		var tdt = new Date();
		
		return tdt.getMonth() + 1 + '/' + tdt.getDate() + '/' + tdt.getFullYear() + ' ' + tdt.getHours() + ':' + tdt.getMinutes() + ':' + tdt.getSeconds();
	},
    MonthsARR : new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'),
    DaysARR : new Array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat')
};

var _doc = 
{
    NO : 0,
    PU : 1,
    FR : 2,
    Height : 0,
    Width : 0
};

var _win = 
{
    Height : 0,
    Width : 0
};

/******************************************************************************
*******************************************************************************
	UTILITIES
*******************************************************************************
******************************************************************************/
var _util = 
{
    SetHW : function()
    {
	    var fName = 'Function:  _util.SetHW()';

	    try
	    {
			if(_app.OP)
			{
				_app.Height = self.innerHeight;
				_app.Width = self.innerWidth;
			}
			else
			{
				_app.Height = document.documentElement.clientHeight;
				_app.Width = document.documentElement.clientWidth;
			}

			if(_app.OP)
			{
				_doc.Height = window.outerHeight;
				_doc.Width = window.outerWidth;
			}
			else
			{
				_doc.Height = document.documentElement.scrollHeight;
				_doc.Width = document.documentElement.scrollWidth;
			}

			if(_app.OP)
			{
				_win.Height = self.innerHeight;
				_win.Width = self.innerWidth;
			}
			else
			{
				_win.Height = screen.height;
				_win.Width = screen.width;
			}

			if(_doc.Height < _app.Height) { _doc.Height = _app.Height; }
			if(_doc.Width < _app.Width) { _doc.Width = _app.Width; }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },
    
    isNumeric : function(Value)
    {
	    var fName = 'Function:  _util.isNumeric(' + Value + ')';

	    try
	    {
		    var validChars = '-0123456789';
		    var ch = '';

		    for(var i = 0;  i < Value.length;  i++)
		    {
			    ch = Value.charAt(i);
			    
			    if(ch.indexOf(validChars) == -1) return false;
		    }
		    
		    return true;
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());

		    return false;
	    }
    },

    isAlpha : function(Value)
    {
	    var fName = 'Function:  _util.isAlpha(' + Value + ')';

	    try
	    {
		    var validChars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
		    var ch = '';

		    for(var i = 0;  i < Value.length;  i++)
		    {
			    ch = Value.charAt(i);
			    
			    if(ch.indexOf(validChars) == -1) return false;
		    }
		    
		    return true;
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());

		    return false;
	    }
    },

    isAlphaNumeric : function(Value)
    {
	    var fName = 'Function:  _util.isAlphaNumeric(' + Value + ')';

	    try
	    {
		    var validChars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
		    var ch = '';

		    for(var i = 0;  i < Value.length;  i++)
		    {
			    ch = Value.charAt(i);
			    
			    if(ch.indexOf(validChars) == -1) return false;
		    }
		    
		    return true;
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());

		    return false;
	    }
    },
    
    isEnter : function(ev)
    {
	    var fName = 'Function:  _util.isEnter(' + ev + ')';

	    try
	    {
	        if(ev.keyCode == 13)
	        {
	            return true;
	        }
		    else
		    {
			    return false;
		    }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());

		    return false;
	    }
    }

};

/******************************************************************************
*******************************************************************************
	OBJECTS
*******************************************************************************
******************************************************************************/
var _obj = 
{
    Type : function(Object, Document)
    {
	    var fName = 'Function:  _obj.Type(' + Object + ', ' + Document + ')';
    	
	    try
	    {
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Object] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Sets function variables.
		    **********************************************************************/
		    var obj = null;
    		
		    /**********************************************************************
			    Gets the requested data.
		    **********************************************************************/
	        switch(Document)
	        {
	            case _doc.NO:
				    obj = document.getElementById(Object);
				    break;
	            
	            case _doc.PU:
				    obj = window.opener.document.getElementById(Object);
				    break;
	            
	            case _doc.FR:
				    obj = window.parent.document.getElementById(Object);
				    break;
				    
                default:
	        }

		    return obj.tagName;
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
    		
		    return null;
	    }
    },
    
    OK : function(Object, Document)
    {
	    var fName = 'Function:  _obj.OK(' + Object + ', ' + Document + ')';
    	
	    try
	    {
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Object] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Gets the requested data.
		    **********************************************************************/
	        switch(Document)
	        {
	            case _doc.NO:
				    if(document.getElementById(Object) == null) { return false; }
				    break;
	            
	            case _doc.PU:
				    if(window.opener.document.getElementById(Object) == null) { return false; }
				    break;
	            
	            case _doc.FR:
				    if(window.parent.document.getElementById(Object) == null) { return false; }
				    break;
				    
                default:
	        }

		    return true;
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },
    
    isEnabled : function(Object, Document)
    {
	    var fName = 'Function:  _obj.isEnabled(' + Object + ', ' + Document + ')';
    	
	    try
	    {
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Object] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Gets the requested data.
		    **********************************************************************/
	        switch(Document)
	        {
	            case _doc.NO:
		            return !document.getElementById(Object).disabled;
				    break;
	            
	            case _doc.PU:
		            return !window.opener.document.getElementById(Object).disabled;
				    break;
	            
	            case _doc.FR:
		            return !window.parent.document.getElementById(Object).disabled;
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
    		
		    return null;
	    }
    },
    
    SetEnabled : function(Object, TF, Document)
    {
	    var fName = 'Function:  _obj.SetEnabled(' + Object + ', ' + Document + ')';
    	
	    try
	    {
		    if(typeof TF == 'undefined') TF = true;
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Object] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Sets the requested data.
		    **********************************************************************/
	        switch(Document)
	        {
	            case _doc.NO:
		            document.getElementById(Object).disabled = !TF;
				    break;
	            
	            case _doc.PU:
		            window.opener.document.getElementById(Object).disabled = !TF;
				    break;
	            
	            case _doc.FR:
		            window.parent.document.getElementById(Object).disabled = !TF;
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
    		
		    return null;
	    }
    },
    
    isChecked : function(Object, Document)
    {
	    var fName = 'Function:  _obj.isChecked(' + Object + ', ' + Document + ')';
    	
	    try
	    {
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Object] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Gets the requested data.
		    **********************************************************************/
	        switch(Document)
	        {
	            case _doc.NO:
		            return document.getElementById(Object).checked;
				    break;
	            
	            case _doc.PU:
		            return window.opener.document.getElementById(Object).checked;
				    break;
	            
	            case _doc.FR:
		            return window.parent.document.getElementById(Object).checked;
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
    		
		    return null;
	    }
    },
    
    SetChecked : function(Object, TF, Document)
    {
	    var fName = 'Function:  _obj.SetChecked(' + Object + ', ' + Document + ')';
    	
	    try
	    {
		    if(typeof TF == 'undefined') TF = 'true';
		    if(typeof Document == 'undefined') Document = _doc.NO;
		    
		    if(TF == 'true') { TF = 1; } else { TF = 0; }

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Object] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Sets the requested data.
		    **********************************************************************/
	        switch(Document)
	        {
	            case _doc.NO:
        		    document.getElementById(Object).checked = TF;
				    break;
	            
	            case _doc.PU:
        		    window.opener.document.getElementById(Object).checked = TF;
				    break;
	            
	            case _doc.FR:
        		    window.parent.document.getElementById(Object).checked = TF;
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
    		
		    return null;
	    }
    },
    
    GetIndex : function(Object, Document)
    {
	    var fName = 'Function:  _obj.GetIndex(' + Object + ', ' + Document + ')';
    	
	    try
	    {
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Object] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Gets the requested data.
		    **********************************************************************/
	        switch(Document)
	        {
	            case _doc.NO:
		            return document.getElementById(Object).selectedIndex;
				    break;
	            
	            case _doc.PU:
		            return window.opener.document.getElementById(Object).selectedIndex;
				    break;
	            
	            case _doc.FR:
		            return window.parent.document.getElementById(Object).selectedIndex;
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
    		
		    return null;
	    }
    },
    
    SetIndex : function(Object, Index, Document)
    {
	    var fName = 'Function:  _obj.SetIndex(' + Object + ', ' + Index + ', ' + Document + ')';
    	
	    try
	    {
		    if(typeof Index == 'undefined') Index = -1;
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Object] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Sets the requested data.
		    **********************************************************************/
	        switch(Document)
	        {
	            case _doc.NO:
		            document.getElementById(Object).selectedIndex = Index;
				    break;
	            
	            case _doc.PU:
		            window.opener.document.getElementById(Object).selectedIndex = Index;
				    break;
	            
	            case _doc.FR:
		            window.parent.document.getElementById(Object).selectedIndex = Index;
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
    		
		    return null;
	    }
    },
    
    HiLite : function(ListObject, TextObject, Seed, Document)
    {
		var fName = 'Function:  _obj.HiLite(' + ListObject + ', ' + TextObject + ', ' + Seed + ', ' + Document + ')';

		try
		{
		    if(typeof Seed == 'undefined') Seed = 0;
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof ListObject == 'undefined' || typeof TextObject == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing one or more parameters.');
			    return false;
		    }

		    /**********************************************************************
			    Sets the requested data.
		    **********************************************************************/
			var srch = this.GetData(TextObject, Document).toLowerCase();
			var srchlen = srch.length;
			var cnt = 0;
			var txt = '';
			var val = '';
			var chstr = '';

			if(srch == '')
			{
				this.SetIndex(ListObject, -1, Document);
			}
			else
			{
				switch(Document)
				{
					case _doc.NO:
						cnt = document.getElementById(ListObject).options.length;
						break;
		            
					case _doc.PU:
						cnt = window.opener.document.getElementById(ListObject).options.length;
						break;
		            
					case _doc.FR:
						cnt = window.parent.document.getElementById(ListObject).options.length;
						break;
					    
					default:
				}

				for(var x = 0; x < cnt; x++)
				{
    				this.SetIndex(ListObject, -1, Document);

					switch(Document)
					{
						case _doc.NO:
							txt = document.getElementById(ListObject).options[x].text;
							val = document.getElementById(ListObject).options[x].value;
							break;
			            
						case _doc.PU:
							txt = window.opener.document.getElementById(ListObject).options[x].text;
							val = window.opener.document.getElementById(ListObject).options[x].value;
							break;
			            
						case _doc.FR:
							txt = window.parent.document.getElementById(ListObject).options[x].text;
							val = window.parent.document.getElementById(ListObject).options[x].value;
							break;
						    
						default:
					}
			        
					chstr = txt.substring(Seed, (Seed + srchlen)).toLowerCase();
					
					if(chstr == srch)
					{
        				this.SetIndex(ListObject, x, Document);

						x = cnt;
					}
				}
			}
		}
		catch(e)
		{
			if(_app.Debug) alert(fName + '\n\n' + e.toString());
		}
    },

    Focus : function(Object, Document)
    {
	    var fName = 'Function:  _obj.Focus(' + Object + ', ' + Document + ')';

	    try
	    {
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided
		    **********************************************************************/
		    if(typeof Object == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Object] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Validates Object
		    **********************************************************************/
		    if(!this.OK(Object, Document))
		    {
			    if(_app.Debug) alert(fName + '\n\nObject [' + Object + '] is not valid.');
			    return false;
		    }

		    /**********************************************************************
			    Gets the requested data.
		    **********************************************************************/
	        switch(Document)
	        {
	            case _doc.NO:
                    document.getElementById(Object).focus();
				    break;
	            
	            case _doc.PU:
                    window.opener.document.getElementById(Object).focus();
				    break;
	            
	            case _doc.FR:
                    window.parent.document.getElementById(Object).focus();
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },

    Select : function(Object, Document)
    {
	    var fName = 'Function:  _obj.Select(' + Object + ', ' + Document + ')';

	    try
	    {
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided
		    **********************************************************************/
		    if(typeof Object == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Object] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Validates Object
		    **********************************************************************/
		    if(!this.OK(Object, Document))
		    {
			    if(_app.Debug) alert(fName + '\n\nObject [' + Object + '] is not valid.');
			    return false;
		    }

		    /**********************************************************************
			    Gets the requested data.
		    **********************************************************************/
	        switch(Document)
	        {
	            case _doc.NO:
                    document.getElementById(Object).focus();
                    document.getElementById(Object).select();
				    break;
	            
	            case _doc.PU:
                    window.opener.document.getElementById(Object).focus();
                    window.opener.document.getElementById(Object).select();
				    break;
	            
	            case _doc.FR:
                    window.parent.document.getElementById(Object).focus();
                    window.parent.document.getElementById(Object).select();
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },
    
    Move : function(Object, Top, Left, Height, Width, Document)
    {
	    var fName = 'Function:  _obj.Move(' + Object + ', ' + Top + ', ' + Left + ', ' + Height + ', ' + Width + ', ' + Document + ')';

	    try
	    {
		    if(typeof Height == 'undefined') Height = -1;
		    if(typeof Width == 'undefined') Width = -1;
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined' || typeof Top == 'undefined' || typeof Left == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing one or more parameters.');
			    return false;
		    }
		    /*
		    if(!_util.isNumeric(Top) || !_util.isNumeric(Left) || !_util.isNumeric(Height) || !_util.isNumeric(Width))
		    {
			    if(_app.Debug) alert(fName + '\n\Non-Numeric parameter value(s).');
			    return false;
		    }
		    */

		    /**********************************************************************
			    Validates Object.
		    **********************************************************************/
		    if(!this.OK(Object, Document))
		    {
			    if(_app.Debug) alert(fName + '\n\nObject [' + Object + '] is not valid.');
			    return false;
		    }
    		
		    /**********************************************************************
			    Adds 'Position' value if not present.
		    **********************************************************************/
            if(this.GetStyle(Object, 'position', Document) == '' || (this.GetStyle(Object, 'position', Document) != 'absolute' && this.GetStyle(Object, 'position', Document) != 'relative'))
            {
                this.SetStyle(Object, 'position', 'absolute', Document);
            }

		    /**********************************************************************
			    Sets the requested data.
		    **********************************************************************/
            this.SetStyle(Object, 'top', Top + 'px', Document);
            this.SetStyle(Object, 'left', Left + 'px', Document);
            if(Height != -1) this.SetStyle(Object, 'height', Height + 'px', Document);
            if(Width != -1) this.SetStyle(Object, 'width', Width + 'px', Document);
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },

    PoSi : function(Object, Document)
    {
	    var fName = 'Function:  _obj.PoSi(' + Object + ', ' + Document + ')';

	    try
	    {
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing one or more parameters.');
			    return false;
		    }

		    /**********************************************************************
			    Validates Object.
		    **********************************************************************/
		    if(!this.OK(Object, Document))
		    {
			    if(_app.Debug) alert(fName + '\n\nObject [' + Object + '] is not valid.');
			    return false;
		    }
    		
		    /**********************************************************************
			    Gets the requested data.
		    **********************************************************************/
	        switch(Document)
	        {
	            case _doc.NO:
                    return { Top:document.getElementById(Object).style['top'].replace('px', ''),
                        Left:document.getElementById(Object).style['left'].replace('px', ''),
                        Height:document.getElementById(Object).style['height'].replace('px', ''),
                        Width:document.getElementById(Object).style['width'].replace('px', '') };
				    break;
	            
	            case _doc.PU:
                    return { Top:window.opener.document.getElementById(Object).style['top'].replace('px', ''),
                        Left:window.opener.document.getElementById(Object).style['left'].replace('px', ''),
                        Height:window.opener.document.getElementById(Object).style['height'].replace('px', ''),
                        Width:window.opener.document.getElementById(Object).style['width'].replace('px', '') };
				    break;
	            
	            case _doc.FR:
                    return { Top:window.parent.document.getElementById(Object).style['top'].replace('px', ''),
                        Left:window.parent.document.getElementById(Object).style['left'].replace('px', ''),
                        Height:window.parent.document.getElementById(Object).style['height'].replace('px', ''),
                        Width:window.parent.document.getElementById(Object).style['width'].replace('px', '') };
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },

    GetStyle : function(Object, Style, Document)
    {
	    var fName = 'Function:  _obj.GetStyle(' + Object + ', ' + Style + ', ' + Document + ')';

	    try
	    {
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined' || typeof Style == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing one or more parameters.');
			    return false;
		    }

		    /**********************************************************************
			    Validates Object.
		    **********************************************************************/
		    if(!this.OK(Object, Document))
		    {
			    if(_app.Debug) alert(fName + '\n\nObject [' + Object + '] is not valid.');
			    return false;
		    }
    		
		    /**********************************************************************
			    Gets the requested data.
		    **********************************************************************/
	        switch(Document)
	        {
	            case _doc.NO:
                    return document.getElementById(Object).style[Style];
				    break;
	            
	            case _doc.PU:
                    return window.opener.document.getElementById(Object).style[Style];
				    break;
	            
	            case _doc.FR:
                    return window.parent.document.getElementById(Object).style[Style];
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },

    SetStyle : function(Object, Style, Value, Document)
    {
	    var fName = 'Function:  _obj.SetStyle(' + Object + ', ' + Style + ', ' + Value + ', ' + Document + ')';

	    try
	    {
		    if(typeof Value == 'undefined') Value = '';
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined' || typeof Style == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing one or more parameters.');
			    return false;
		    }

		    /**********************************************************************
			    Validates Object.
		    **********************************************************************/
		    if(!this.OK(Object, Document))
		    {
			    if(_app.Debug) alert(fName + '\n\nObject [' + Object + '] is not valid.');
			    return false;
		    }
    		
		    /**********************************************************************
			    Sets the requested data.
		    **********************************************************************/
	        switch(Document)
	        {
	            case _doc.NO:
                    document.getElementById(Object).style[Style] = Value;
				    break;
	            
	            case _doc.PU:
                    window.opener.document.getElementById(Object).style[Style] = Value;
				    break;
	            
	            case _doc.FR:
                    window.parent.document.getElementById(Object).style[Style] = Value;
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },

    SetMask : function(Object, Value, Document)
    {
	    var fName = 'Function:  _obj.SetMask(' + Object + ', ' + Value + ', ' + Document + ')';

	    try
	    {
		    if(typeof Value == 'undefined') Value = '';
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing one or more parameters.');
			    return false;
		    }

		    /**********************************************************************
			    Validates Object.
		    **********************************************************************/
		    if(!this.OK(Object, Document))
		    {
			    if(_app.Debug) alert(fName + '\n\nObject [' + Object + '] is not valid.');
			    return false;
		    }
    		
		    /**********************************************************************
			    Sets the requested data.
		    **********************************************************************/
		    if(this.GetData(Object, Document) == '')
		    {
	            switch(Document)
	            {
	                case _doc.NO:
                        document.getElementById(Object).style['backgroundImage'] = 'url(' + Value + ')';
				        break;
    	            
	                case _doc.PU:
                        window.opener.document.getElementById(Object).style['backgroundImage'] = 'url(' + Value + ')';
				        break;
    	            
	                case _doc.FR:
                        window.parent.document.getElementById(Object).style['backgroundImage'] = 'url(' + Value + ')';
				        break;
    				    
                    default:
	            }
            }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },

    GetAttribute : function(Object, Attribute, Document)
    {
	    var fName = 'Function:  _obj.GetAttribute(' + Object + ', ' + Attribute + ', ' + Document + ')';

	    try
	    {
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined' || typeof Attribute == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing one or more parameters.');
			    return false;
		    }

		    /**********************************************************************
			    Validates Object.
		    **********************************************************************/
		    if(!this.OK(Object, Document))
		    {
			    if(_app.Debug) alert(fName + '\n\nObject [' + Object + '] is not valid.');
			    return false;
		    }
    		
		    /**********************************************************************
			    Gets the requested data.
		    **********************************************************************/
	        switch(Document)
	        {
	            case _doc.NO:
                    return document.getElementById(Object).getAttribute(Attribute);
				    break;
	            
	            case _doc.PU:
                    return window.opener.document.getElementById(Object).getAttribute(Attribute);
				    break;
	            
	            case _doc.FR:
                    return window.parent.document.getElementById(Object).getAttribute(Attribute);
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },

    /******************************************************************************
	    Sets the attribute value of an object
		    - Input			Object:     Page Control
		                    Attribute:  Attribute to set
						    Value:      Value to set *
						    Document:     Current (default), Opened, Frame

        * NOTE: Use .fc. (IE ONLY) when applying a javascript-based value.
    ******************************************************************************/
    SetAttribute : function(Object, Attribute, Value, Document)
    {
	    var fName = 'Function:  _obj.SetAttribute(' + Object + ', ' + Attribute + ', ' + Value + ', ' + Document + ')';

	    try
	    {
		    if(typeof Value == 'undefined') Value = '';
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined' || typeof Attribute == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing one or more parameters.');
			    return false;
		    }

		    /**********************************************************************
			    Validates Object.
		    **********************************************************************/
		    if(!this.OK(Object, Document))
		    {
			    if(_app.Debug) alert(fName + '\n\nObject [' + Object + '] is not valid.');
			    return false;
		    }
    		
		    /**********************************************************************
			    Sets the requested data.
		    **********************************************************************/
	        switch(Document)
	        {
	            case _doc.NO:
	                if(Value.indexOf('.fc.') == 0)
	                {
	                    if(_app.IE || _app.AO)
	                    {
                            document.getElementById(Object).setAttribute(Attribute, function() { eval(Value.replace('.fc.', '')) });
	                    }
	                    else
	                    {
                            document.getElementById(Object).setAttribute(Attribute, Value.replace('.fc.', ''));
	                    }
	                }
	                else
	                {
                        document.getElementById(Object).setAttribute(Attribute, Value);
	                }
				    break;
	            
	            case _doc.PU:
	                if(Value.indexOf('.fc.') == 0)
	                {
	                    if(_app.IE || _app.AO)
	                    {
                            window.opener.document.getElementById(Object).setAttribute(Attribute, function() { eval(Value.replace('.fc.', '')) });
	                    }
	                    else
	                    {
                            window.opener.document.getElementById(Object).setAttribute(Attribute, Value.replace('.fc.', ''));
	                    }
	                }
	                else
	                {
                        window.opener.document.getElementById(Object).setAttribute(Attribute, Value);
	                }
				    break;
	            
	            case _doc.FR:
	                if(Value.indexOf('.fc.') == 0)
	                {
	                    if(_app.IE || _app.AO)
	                    {
                            window.parent.document.getElementById(Object).setAttribute(Attribute, function() { eval(Value.replace('.fc.', '')) });
	                    }
	                    else
	                    {
                            window.parent.document.getElementById(Object).setAttribute(Attribute, Value.replace('.fc.', ''));
	                    }
	                }
	                else
	                {
                        window.parent.document.getElementById(Object).setAttribute(Attribute, Value);
	                }
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },

    SetButtonBG : function(Object, OO)
    {
	    var fName = 'Function:  _obj.SetButtonBG(' + Object + ', ' + OO + ')';
	    
	    try
	    {
		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined' || typeof OO == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing one or more parameters.');
			    return false;
		    }

		    /**********************************************************************
			    Validates Object.
		    **********************************************************************/
		    if(!this.OK(Object))
		    {
			    if(_app.Debug) alert(fName + '\n\nObject [' + Object + '] is not valid.');
			    return false;
		    }
    		
		    /**********************************************************************
			    Sets the requested data.
		    **********************************************************************/
		    var attr = '';
		    
		    if(_app.IE || _app.AO)
		    {
		        attr = 'className';
		    }
		    else
		    {
		        attr = 'class';
		    }

	        if(OO == 'on')
	        {
		        this.SetStyle(Object, 'background', '#ffffff');
		        this.SetStyle(Object, 'color', '#cc3333');
	        }

	        if(OO == 'off')
	        {
		        if(this.GetAttribute(Object, attr) == 'Button')
		        {
			        this.SetStyle(Object, 'background', '#dcdcdc');
			        this.SetStyle(Object, 'color', '#000000');
		        }
		        if(this.GetAttribute(Object, attr) == 'BlueButton')
		        {
			        this.SetStyle(Object, 'background', '#0099cc');
			        this.SetStyle(Object, 'color', '#ffffff');
		        }
		        if(this.GetAttribute(Object, attr) == 'GreenButton')
		        {
			        this.SetStyle(Object, 'background', '#33cc33');
			        this.SetStyle(Object, 'color', '#ffffff');
		        }
		        if(this.GetAttribute(Object, attr) == 'RedButton')
		        {
			        this.SetStyle(Object, 'background', '#cc3333');
			        this.SetStyle(Object, 'color', '#ffffff');
		        }
		        if(this.GetAttribute(Object, attr) == 'YellowButton')
		        {
			        this.SetStyle(Object, 'background', '#ffff00');
			        this.SetStyle(Object, 'color', '#cc3333');
		        }
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },

    FlashButton : function(Object, Count)
    {
	    var fName = 'Function:  _obj.FlashButton(' + Object + ', ' + Count + ')';
	    
	    try
	    {
		    if(typeof Count == 'undefined') Count = 0;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing one or more parameters.');
			    return false;
		    }

		    /**********************************************************************
			    Validates Object.
		    **********************************************************************/
		    if(!this.OK(Object))
		    {
			    if(_app.Debug) alert(fName + '\n\nObject [' + Object + '] is not valid.');
			    return false;
		    }
    		
		    /**********************************************************************
			    Sets function variables.
		    **********************************************************************/
		    var bg = this.GetStyle(Object, 'color');
		    var fc = this.GetStyle(Object, 'backgroundColor');
		    
		    /**********************************************************************
			    Sets the requested data.
		    **********************************************************************/
		    if(Count > 5)
		    {
			    this.SetStyle(Object, 'background', fc);
			    this.SetStyle(Object, 'color', bg);
		    }
		    else
		    {
			    this.SetStyle(Object, 'background', bg);
			    this.SetStyle(Object, 'color', fc);
    			
			    Count += 1;
			    
			    setTimeout('_obj.FlashButton(\'' + Object + '\', ' + Count + ');', 250);
		    }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },

	GetData : function(Object, Document)
	{
	    var fName = 'Function:  _obj.GetData(' + Object + ', ' + Document + ')';

	    try
	    {
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Object] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Validates Object
		    **********************************************************************/
		    if(!this.OK(Object, Document))
		    {
			    if(_app.Debug) alert(fName + '\n\nObject [' + Object + '] is not valid.');
			    return false;
		    }

		    /**********************************************************************
			    Gets the Object type.
		    **********************************************************************/
		    var oType = this.Type(Object, Document);
    		
		    /**********************************************************************
			    Gets the requested data.
		    **********************************************************************/
	        switch(Document)
	        {
	            case _doc.NO:
			        if(oType == 'INPUT' || oType == 'SELECT' || oType == 'TEXTAREA') return document.getElementById(Object).value;
			        else if(oType == 'IMG') return document.getElementById(Object).src;
			        //else if(oType == 'A') return document.getElementById(Object).href;
			        else if(oType == 'FORM') return document.getElementById(Object).action;
			        else return document.getElementById(Object).innerHTML;
				    break;
	            
	            case _doc.PU:
			        if(oType == 'INPUT' || oType == 'SELECT' || oType == 'TEXTAREA') return window.opener.document.getElementById(Object).value;
			        else if(oType == 'IMG') return window.opener.document.getElementById(Object).src;
			        //else if(oType == 'A') return window.opener.document.getElementById(Object).href;
			        else if(oType == 'FORM') return window.opener.document.getElementById(Object).action;
			        else return window.opener.document.getElementById(Object).innerHTML;
				    break;
	            
	            case _doc.FR:
			        if(oType == 'INPUT' || oType == 'SELECT' || oType == 'TEXTAREA') return window.parent.document.getElementById(Object).value;
			        else if(oType == 'IMG') return window.parent.document.getElementById(Object).src;
			        //else if(oType == 'A') return window.parent.document.getElementById(Object).href;
			        else if(oType == 'FORM') return window.parent.document.getElementById(Object).action;
			        else return window.parent.document.getElementById(Object).innerHTML;
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
	},

	SetData : function(Object, Value, Document)
	{
	    var fName = 'Function:  _obj.SetData(' + Object + ', ' + Value + ', ' + Document + ')';

	    try
	    {
    		if(typeof Value == 'undefined') Value = '';
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Object == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Object] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Validates Object
		    **********************************************************************/
		    if(!this.OK(Object, Document))
		    {
			    if(_app.Debug) alert(fName + '\n\nObject [' + Object + '] is not valid.');
			    return false;
		    }

		    /**********************************************************************
			    Gets the Object type.
		    **********************************************************************/
		    var oType = this.Type(Object, Document);
    		
		    /**********************************************************************
			    Sets the requested data.
		    **********************************************************************/
	        switch(Document)
	        {
	            case _doc.NO:
			        if(oType == 'INPUT' || oType == 'SELECT' || oType == 'TEXTAREA') document.getElementById(Object).value = Value;
			        else if(oType == 'IMG') document.getElementById(Object).src = Value;
			        //else if(oType == 'A') document.getElementById(Object).href = Value;
			        else if(oType == 'FORM') document.getElementById(Object).action = Value;
			        else if(oType == 'FRAME') document.getElementById(Object).src = Value;
			        else if(oType == 'IFRAME') document.getElementById(Object).src = Value;
			        else document.getElementById(Object).innerHTML = Value;
				    break;
	            
	            case _doc.PU:
			        if(oType == 'INPUT' || oType == 'SELECT' || oType == 'TEXTAREA') window.opener.document.getElementById(Object).value = Value;
			        else if(oType == 'IMG') window.opener.document.getElementById(Object).src = Value;
			        //else if(oType == 'A') window.opener.document.getElementById(Object).href = Value;
			        else if(oType == 'FORM') window.opener.document.getElementById(Object).action = Value;
			        else if(oType == 'FRAME') window.opener.document.getElementById(Object).src = Value;
			        else if(oType == 'IFRAME') window.opener.document.getElementById(Object).src = Value;
			        else window.opener.document.getElementById(Object).innerHTML = Value;
				    break;
	            
	            case _doc.FR:
			        if(oType == 'INPUT' || oType == 'SELECT' || oType == 'TEXTAREA') window.parent.document.getElementById(Object).value = Value;
			        else if(oType == 'IMG') window.parent.document.getElementById(Object).src = Value;
			        //else if(oType == 'A') window.parent.document.getElementById(Object).href = Value;
			        else if(oType == 'FORM') window.parent.document.getElementById(Object).action = Value;
			        else if(oType == 'FRAME') window.parent.document.getElementById(Object).src = Value;
			        else if(oType == 'IFRAME') window.parent.document.getElementById(Object).src = Value;
			        else window.parent.document.getElementById(Object).innerHTML = Value;
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
	},

    xForm : function(Object, Action, Document)
    {
	    var fName = 'Function:  _obj.xForm(' + Object + ', ' + Action + ', ' + Document + ')';

	    try
	    {
		    if(typeof Action == 'undefined') Action = '';
		    if(typeof Document == 'undefined') Document = _doc.NO;

		    /**********************************************************************
			    Verifies ALL parameters required are provided
		    **********************************************************************/
		    if(typeof Object == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Object] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Validates Object
		    **********************************************************************/
		    if(!this.OK(Object, Document))
		    {
			    if(_app.Debug) alert(fName + '\n\nObject [' + Object + '] is not valid.');
			    return false;
		    }

		    /**********************************************************************
			    Gets the requested data.
		    **********************************************************************/
            if(Action != '') this.SetData(Object, Action, Document);

	        switch(Document)
	        {
	            case _doc.NO:
		            document.getElementById(Object).submit();
				    break;
	            
	            case _doc.PU:
		            window.opener.document.getElementById(Object).submit();
				    break;
	            
	            case _doc.FR:
		            window.parent.document.getElementById(Object).submit();
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    }

};

/******************************************************************************
*******************************************************************************
	PAGE
*******************************************************************************
******************************************************************************/
var _pg = 
{
    SetButtonStyles : function()
    {
	    var fName = 'Function:  _pg.SetButtonStyles()';

	    try
	    {
		    /**********************************************************************
			    Sets the requested data.
		    **********************************************************************/
		    var oLinks;
		    var oButtons;
		    var i = 0;
		    var attr = '';
		    
		    if(_app.IE || _app.AO)
		    {
		        attr = 'className';
		    }
		    else
		    {
		        attr = 'class';
		    }

		    oLinks = document.getElementsByTagName('A');

		    if(oLinks.length)
		    {
			    for (i = 0; i < oLinks.length; i++)
			    {
			        oLinks[i].setAttribute('onmouseover', function() { window.status = ''; return true; });
			    }
			}

		    oButtons = document.getElementsByTagName('INPUT');

		    if(oButtons.length)
		    {
			    for (i = 0; i < oButtons.length; i++)
			    {
				    if(oButtons[i].type == 'submit' || oButtons[i].type == 'button')
				    {
				        _obj.SetAttribute(oButtons[i].id, 'onmouseover', '.fc._obj.SetButtonBG(this.id, \'on\');');
				        _obj.SetAttribute(oButtons[i].id, 'onmouseout', '.fc._obj.SetButtonBG(this.id, \'off\');');
    					
					    if(_obj.GetAttribute(oButtons[i].id, attr) == 'Button')
					    {
						    _obj.SetStyle(oButtons[i].id, 'background', '#dcdcdc');
						    _obj.SetStyle(oButtons[i].id, 'color', '#000000');
					    }
					    if(_obj.GetAttribute(oButtons[i].id, attr) == 'BlueButton')
					    {
						    _obj.SetStyle(oButtons[i].id, 'background', '#0099cc');
						    _obj.SetStyle(oButtons[i].id, 'color', '#ffffff');
					    }
					    if(_obj.GetAttribute(oButtons[i].id, attr) == 'GreenButton')
					    {
						    _obj.SetStyle(oButtons[i].id, 'background', '#33cc33');
						    _obj.SetStyle(oButtons[i].id, 'color', '#ffffff');
					    }
					    if(_obj.GetAttribute(oButtons[i].id, attr) == 'RedButton')
					    {
						    _obj.SetStyle(oButtons[i].id, 'background', '#cc3333');
						    _obj.SetStyle(oButtons[i].id, 'color', '#ffffff');
					    }
					    if(_obj.GetAttribute(oButtons[i].id, attr) == 'YellowButton')
					    {
						    _obj.SetStyle(oButtons[i].id, 'background', '#ffff00');
						    _obj.SetStyle(oButtons[i].id, 'color', '#cc3333');
					    }
				    }
			    }
		    }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },
    
    FocusWindows : function()
    {
	    var fName = 'Function:  _pg.FocusWindows()';

	    try
	    {
		    if(_app.xwin) { if(!_app.xwin.closed) _app.xwin.focus(); }
		    if(_app.swin) { if(!_app.swin.closed) _app.swin.focus(); }
		    if(_app.awin) { if(!_app.awin.closed) _app.awin.focus(); }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },
    
    CloseWindows : function()
    {
	    var fName = 'Function:  _pg.CloseWindows()';

	    try
	    {
		    if(_app.xwin) { if(!_app.xwin.closed) _app.xwin.close(); }
		    if(_app.swin) { if(!_app.swin.closed) _app.swin.close(); }
		    if(_app.awin) { if(!_app.awin.closed) _app.awin.close(); }
		    if(_app.cwin) { if(!_app.cwin.closed) _app.cwin.close(); }
		    if(_app.rwin) { if(!_app.rwin.closed) _app.rwin.close(); }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },

    nav2 : function(Page, NewWindow, Height, Width, Attributes)
    {
	    var fName = 'Function:  _pg.nav2(' + Object + ', ' + NewWindow + ', ' + Height + ', ' + Width + ', ' + Attributes + ')';

	    try
	    {
			var ExWindow = false;
			
	        if(typeof NewWindow == 'undefined')
	        {
		        if(typeof NewWindow == 'undefined') NewWindow = false;
	        }
	        else
	        {
		        if(NewWindow == 'ex')
		        {
					ExWindow = true;
		            NewWindow = true;
		            Attributes = 'resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes,location=yes,status=yes,directories=yes';
		        }
		        if(NewWindow == 'ix')
		        {
					ExWindow = false;
		            NewWindow = true;
		            //Attributes = 'resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes,location=yes,status=yes,directories=yes';
		        }
	        }
	        if(typeof Height == 'undefined') Height = 600;
	        if(typeof Width == 'undefined') Width = 800;
	        if(typeof Attributes == 'undefined') Attributes = 'resizable=no,scrollbars=no,menubar=no,toolbar=no,location=no,status=no,directories=no';
		    
		    /**********************************************************************
			    Verifies ALL parameters required are provided
		    **********************************************************************/
		    if(typeof Page == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Page] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Sets function variables.
		    **********************************************************************/
	        var exp = 'http';
	        var wTop = (_win.Height / 2) - (Height / 2);
	        var wLeft = (_win.Width / 2) - (Width / 2);
        	
	        if(!Page.match(exp)) Page = _app.SitePath() + Page;
	        
	        if(NewWindow)
	        {
        		if(ExWindow)
        		{
					if(_app.ewin) { if(!_app.ewin.closed) _app.ewin.close(); }

					_app.ewin = window.open(Page, 'EWIN' + _app.SID(), 'top=' + wTop + ',left=' + wLeft + ',height=' + Height + ',width=' + Width + ',' + Attributes);					_app.ewin.focus();
        		}
        		else
        		{
					if(_app.xwin) { if(!_app.xwin.closed) _app.xwin.close(); }

					if(Page.indexOf('?') > -1)
					{
						Page = Page.replace('?', '?_sid=' + _app.SID() + '&dt=' + _app.TDY() + '&');
					}
					else
					{
						Page += '?_sid=' + _app.SID() + '&dt=' + _app.TDY();
					}

					_app.xwin = window.open(Page, 'XWIN' + _app.SID(), 'top=' + wTop + ',left=' + wLeft + ',height=' + Height + ',width=' + Width + ',' + Attributes);					_app.xwin.focus();
        		}
	        }
	        else
	        {
		        document.location = Page;
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },

    nav2s : function(Page)
    {
	    var fName = 'Function:  _pg.nav2s(' + Page + ')';

	    try
	    {
		    /**********************************************************************
			    Verifies ALL parameters required are provided
		    **********************************************************************/
		    if(typeof Page == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Page] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Sets function variables.
		    **********************************************************************/
	        var exp = 'http';
	        var wTop = (_win.Height / 2) - (120 / 2);
	        var wLeft = (_win.Width / 2) - (350 / 2);
        	
	        if(!Page.match(exp)) Page = _app.SitePath() + Page;

	        if(_app.swin) { if(!_app.swin.closed) _app.swin.close(); }
    		
	        if(Page.indexOf('?') > -1)
	        {
		        Page = Page.replace('?', '?_sid=' + _app.SID() + '&dt=' + _app.TDY() + '&');
	        }
	        else
	        {
		        Page += '?_sid=' + _app.SID() + '&dt=' + _app.TDY();
	        }
    		
	        _app.swin = window.open(Page, 'SWIN' + _app.SID(), 'top=' + wTop + ',left=' + wLeft + ',height=120,width=350,resizable=no,scrollbars=no,menubar=no,toolbar=no,location=no,status=no,directories=no,personalbar=no,dialog,minimizable=no,modal=yes');	        _app.swin.focus();
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },

    nav2a : function(Page)
    {
	    var fName = 'Function:  _pg.nav2a(' + Page + ')';

	    try
	    {
		    /**********************************************************************
			    Verifies ALL parameters required are provided
		    **********************************************************************/
		    if(typeof Page == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Page] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Sets function variables.
		    **********************************************************************/
	        var exp = 'http';
	        var wTop = (_win.Height / 2) - (400 / 2);
	        var wLeft = (_win.Width / 2) - (350 / 2);
        	
	        if(!Page.match(exp)) Page = _app.SitePath() + Page;

	        if(_app.awin) { if(!_app.awin.closed) _app.awin.close(); }
    		
	        if(Page.indexOf('?') > -1)
	        {
		        Page = Page.replace('?', '?_sid=' + _app.SID() + '&dt=' + _app.TDY() + '&');
	        }
	        else
	        {
		        Page += '?_sid=' + _app.SID() + '&dt=' + _app.TDY();
	        }
    		
	        _app.awin = window.open(Page, 'AWIN' + _app.SID(), 'top=' + wTop + ',left=' + wLeft + ',height=400,width=350,resizable=yes,scrollbars=yes,menubar=no,toolbar=no,location=no,status=no,directories=no,personalbar=no');	        _app.awin.focus();
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },

    nav2c : function(Page, Height, Width)
    {
	    var fName = 'Function:  _pg.nav2c(' + Page + ', ' + Height + ', ' + Width + ')';

	    try
	    {
	        if(typeof Height == 'undefined') Height = 600;
	        if(typeof Width == 'undefined') Width = 800;

		    /**********************************************************************
			    Verifies ALL parameters required are provided
		    **********************************************************************/
		    if(typeof Page == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Page] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Sets function variables.
		    **********************************************************************/
	        var exp = 'http';
	        var wTop = (_win.Height / 2) - (Height / 2);
	        var wLeft = (_win.Width / 2) - (Width / 2);
        	
	        if(!Page.match(exp)) Page = _app.SitePath() + Page;

	        if(_app.cwin) { if(!_app.cwin.closed) _app.cwin.close(); }
    		
	        if(Page.indexOf('?') > -1)
	        {
		        Page = Page.replace('?', '?_sid=' + _app.SID() + '&dt=' + _app.TDY() + '&');
	        }
	        else
	        {
		        Page += '?_sid=' + _app.SID() + '&dt=' + _app.TDY();
	        }
    		
	        _app.cwin = window.open(Page, 'CWIN' + _app.SID(), 'top=' + wTop + ',left=' + wLeft + ',height=' + Height + ',width=' + Width + ',resizable=no,scrollbars=no,menubar=no,toolbar=no,location=no,status=no,directories=no,personalbar=no,dialog,minimizable=no,modal=yes');	        _app.cwin.focus();
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },

    nav2r : function(Page)
    {
	    var fName = 'Function:  _pg.nav2r(' + Page + ')';

	    try
	    {
		    /**********************************************************************
			    Verifies ALL parameters required are provided
		    **********************************************************************/
		    if(typeof Page == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing [Page] parameter.');
			    return false;
		    }

		    /**********************************************************************
			    Sets function variables.
		    **********************************************************************/
	        var exp = 'http';
        	
	        if(!Page.match(exp)) Page = _app.SitePath() + Page;

	        if(_app.rwin) { if(!_app.rwin.closed) _app.rwin.close(); }
    		
	        if(Page.indexOf('?') > -1)
	        {
		        Page = Page.replace('?', '?_sid=' + _app.SID() + '&dt=' + _app.TDY() + '&');
	        }
	        else
	        {
		        Page += '?_sid=' + _app.SID() + '&dt=' + _app.TDY();
	        }
    		
	        _app.rwin = window.open(Page, 'RWIN' + _app.SID(), 'top=0,left=0,height=' + _win.Height + ',width=' + _win.Width + ',resizable=yes,scrollbars=yes,menubar=yes,toolbar=yes,location=yes,status=yes,directories=yes');	        _app.rwin.focus();
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },
    
	Lock : function(Document)
	{
	    var fName = 'Function:  _pg.Lock(' + Document + ')';

	    try
	    {
		    if(typeof Document == 'undefined') Document = _doc.NO;

			if(_obj.OK('dDisabled', Document))
			{
				_util.SetHW();
				
				_obj.Move('dDisabled', 0, 0, _app.Height, _app.Width, Document);
				_obj.SetStyle('dDisabled', 'visibility', 'visible', Document);
			}

	        switch(Document)
	        {
	            case _doc.NO:
					document.onkeypress = function() { return false; };
				    break;
	            
	            case _doc.PU:
					window.opener.document.onkeypress = function() { return false; };
				    break;
	            
	            case _doc.FR:
					window.parent.document.onkeypress = function() { return false; };
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
	},
    
	UnLock : function(Document)
	{
	    var fName = 'Function:  _pg.UnLock(' + Document + ')';

	    try
	    {
		    if(typeof Document == 'undefined') Document = _doc.NO;

			if(_obj.OK('dDisabled', Document))
			{
				_obj.SetStyle('dDisabled', 'visibility', 'hidden', Document);
				_obj.Move('dDisabled', 0, 0, 0, 0, Document);
			}

	        switch(Document)
	        {
	            case _doc.NO:
					document.onkeypress = function() { return true; };
				    break;
	            
	            case _doc.PU:
					window.opener.document.onkeypress = function() { return true; };
				    break;
	            
	            case _doc.FR:
					window.parent.document.onkeypress = function() { return true; };
				    break;
				    
                default:
	        }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
	},
	
	isLocked : function()
	{
	    var fName = 'Function:  _pg.isLocked()';

	    try
	    {
		    if(_app.xwin) { if(!_app.xwin.closed) { _app.xwin.focus(); return; } }
		    if(_app.swin) { if(!_app.swin.closed) { _app.swin.focus(); return; } }
		    if(_app.awin) { if(!_app.awin.closed) { _app.awin.focus(); return; } }

			_pg.UnLock();
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
	}

};

var _cookie = 
{
    Get : function(Name)
    {
	    var fName = 'Function:  _cookie.Get(' + Name + ')';

	    try
	    {
            var start = document.cookie.indexOf(Name + '=');
            var len = start + Name.length + 1;
            
            if((!start) && (Name != document.cookie.substring(0, Name.length))) { return null; }
            if(start == -1) { return null; }
            
            var end = document.cookie.indexOf(';', len);
            
            if(end == -1) end = document.cookie.length;
            
            return unescape(document.cookie.substring(len, end));
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
		    
		    return null;
	    }
    },

    Set : function(Name, Value, Expires, Path, Domain, Secure)
    {
	    var fName = 'Function:  _cookie.Set(' + Name + ', ' + Value + ', ' + Expires + ', ' + Path + ', ' + Domain + ', ' + Secure + ')';

	    try
	    {
            var today = new Date();
            
            today.setTime(today.getTime());
            
            if(Expires) { Expires = Expires * 1000 * 60 * 60 * 24; }
            
            var expires_date = new Date(today.getTime() + (Expires));
            
            document.cookie = Name + '=' + escape(Value) + ((Expires) ? ';expires=' + expires_date.toGMTString() : '') + ((Path) ? ';path=' + Path : ';path=/' ) + ((Domain) ? ';domain=' + Domain : '') + ((Secure) ? ';secure' : '');
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    },

    Del : function(Name, Path, Domain)
    {
	    var fName = 'Function:  _cookie.Del(' + Name + ', ' + Path + ', ' + Domain + ')';

	    try
	    {
            if(this.Get(Name)) { document.cookie = Name + '=' + ((Path) ? ';path=' + Path : ';path=/') + ((Domain) ? ';domain=' + Domain : '') + ';expires=Thu, 01-Jan-1970 00:00:01 GMT'; }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
    }
};

var _AJAX = 
{
    /**************************
        Response Data
    ***************************
    status
    responseText
    responseXML
    statusText
    **************************/

	Post : function(Reqeuest, URL, Data, CallBack, Asynch)
	{
	    var fName = 'Function:  _AJAX.Post([Reqeuest], ' + URL + ', ' + Data + ', [CallBack], ' + Asynch + ')';

	    try
	    {
            if(typeof CallBack == 'undefined') CallBack = null;
            if(typeof Asynch == 'undefined') Asynch = true;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Reqeuest == 'undefined' || typeof URL == 'undefined' || typeof Data == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing one or more parameters.');
			    return false;
		    }

 		    if(Reqeuest != null)
 		    {
		        if(Data.indexOf('_sid=') == -1)
		        {
					if(Data.length == 0)
					{
						Data = '_sid=' + _app.SID() + '&dt=' + _app.TDY();
					}
					else
					{
						Data += '&_sid=' + _app.SID() + '&dt=' + _app.TDY();
					}
		        }
        		
 		        Reqeuest.open('POST', URL, Asynch);
	            Reqeuest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
	            Reqeuest.setRequestHeader('Content-length', Data.length);
	            Reqeuest.setRequestHeader('Connection', 'close');
        	 	
 		        if(Asynch)
 		        {
 			        Reqeuest.onreadystatechange = function()
 			        {
 				        if(Reqeuest.readyState == 4 && Reqeuest.status == 200)
 				        {
					        if(CallBack != null) { CallBack(Reqeuest); }
 				        }
 			        }
 		        }
        	 	
 		        Reqeuest.send(Data);

 		        if(!Asynch)
 		        {
 			        if(Reqeuest.status == 200)
 			        {
				        if(CallBack != null) { CallBack(Reqeuest); }
			        }
 		        }
 		    }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
	},

	Get : function(Reqeuest, URL, CallBack, Asynch)
	{
	    var fName = 'Function:  _AJAX.Get([Reqeuest], ' + URL + ', [CallBack], ' + Asynch + ')';

	    try
	    {
            if(typeof CallBack == 'undefined') CallBack = null;
            if(typeof Asynch == 'undefined') Asynch = true;

		    /**********************************************************************
			    Verifies ALL parameters required are provided.
		    **********************************************************************/
		    if(typeof Reqeuest == 'undefined' || typeof URL == 'undefined')
		    {
			    if(_app.Debug) alert(fName + '\n\nMissing one or more parameters.');
			    return false;
		    }

 		    if(Reqeuest != null)
 		    {
		        if(URL.indexOf('?') > -1)
		        {
			        URL = URL.replace('?', '?_sid=' + _app.SID() + '&dt=' + _app.TDY() + '&');
		        }
		        else
		        {
			        URL += '?_sid=' + _app.SID() + '&dt=' + _app.TDY();
		        }
		        
 		        Reqeuest.open('GET', URL, Asynch);
	            Reqeuest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
	            Reqeuest.setRequestHeader('Content-length', '0');
	            Reqeuest.setRequestHeader('Connection', 'close');
        	 	
 		        if(Asynch)
 		        {
 			        Reqeuest.onreadystatechange = function()
 			        {
 				        if(Reqeuest.readyState == 4 && Reqeuest.status == 200)
 				        {
				            if(CallBack != null) { CallBack(Reqeuest); }
 				        }
 			        }
 		        }
        	 	
 		        Reqeuest.send(null);

 		        if(!Asynch)
 		        {
 			        if(Reqeuest.status == 200)
 			        {
				        if(CallBack != null) { CallBack(Reqeuest); }
			        }
 		        }
 		    }
	    }
	    catch(e)
	    {
		    if(_app.Debug) alert(fName + '\n\n' + e.toString());
	    }
	},

	Request : function()
	{
 		try { return new XMLHttpRequest(); } catch(e) {}
		try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) {}
		try { return new ActiveXObject('Microsoft.XMLHTTP'); } catch (e) {}
		return null;
	}
};


/******************************************************************************
*******************************************************************************
	Environment specific functions
*******************************************************************************
******************************************************************************/
//document.oncontextmenu = function() { return false; };

var dt = new Date();

if(!_cookie.Get('_sid')) { _cookie.Set('_sid', dt.getTime().toString() + (1 + Math.floor((Math.random() * 9999999999))).toString()); }
//]]>

