//-----------------------------------------------------------------------------
//
// uberscript.js
// Created: 		11/28/2000 - Rick Stoelinga / James Moriarty
//
// This is the uberscript customization file.  It allows selection of only those
// scripts required for a project.
//
//-----------------------------------------------------------------------------
//
// detection module included in this script for modular selection by browser class
// classes are detemined by following table:
//		class5  - full implementation of the DOM model
//			PC  - IE 5 thru 5.5, NS 6
//			Mac - IE 5 thru 5.5, NS 6
//		class4  - implementation of dhtml
//			PC  - IE 4 upto IE 5, NS 4.09 upto NS 6
//			Mac - IE 4.5 upto IE 5, NS 4.09 upto NS 6
//		class3	- Older browsers
//			PC  - IE 3 upto IE 4, NS below 4.09
//			Mac - IE 3 upto IE 4.5, NS below 4.09
//		class0  - All other cases, including Opera and other browsers
//			PC  - IE below 3
//			Mac - IE below 3
//
//-----------------------------------------------------------------------------
function ubDetect() {
    var agent   = navigator.userAgent.toLowerCase();
    this.major  = parseInt(navigator.appVersion);
    this.minor  = parseFloat(navigator.appVersion);

    this.ns     = ((agent.indexOf('mozilla')   != -1) &&
                  (agent.indexOf('spoofer')    == -1) &&
                  (agent.indexOf('compatible') == -1) &&
                  (agent.indexOf('opera')      == -1) &&
                  (agent.indexOf('webtv')      == -1));
    this.ns2    = (this.ns && (this.major      ==  2));
    this.ns3    = (this.ns && (this.major      ==  3));
    this.ns4    = (this.ns && (this.major      ==  4));
    this.ns6    = (this.ns && (this.major      >=  5));

    this.ie     = ((agent.indexOf("msie")      != -1) &&
                  (agent.indexOf("opera")      == -1));
    this.ie3    = (this.ie && (this.major      <   4));
    this.ie4    = (this.ie && (this.major      ==  4) &&
                  (agent.indexOf("msie 5.0")   == -1) &&
                  (agent.indexOf("msie 5.1")   == -1) &&
                  (agent.indexOf("msie 5.5")   == -1));
    this.ie5    = (this.ie && (this.major      ==  4) &&
                  (agent.indexOf("msie 5.0")   != -1));
    this.ie51   = (this.ie && (this.major      ==  4) &&
                  (agent.indexOf("msie 5.1")   != -1));
    this.ie55   = (this.ie && (this.major      ==  4) &&
                  (agent.indexOf("msie 5.5")   != -1));
    this.ieX    = (this.ie && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie55);

    this.op     = (agent.indexOf('opera')      != -1);
    this.op5    = ((this.op && this.major       ==  4) &&
                  (agent.indexOf("msie 5.0")   != -1));

    this.mac = navigator.appVersion.indexOf('Mac') != -1;
    this.win = agent.indexOf('win') != -1;
	this.min = (this.ns||this.ie);
	
	this.class5 = (this.ns6||this.ie5||this.ie51||this.ie55||this.op5);
	this.class4 = ( (this.ie45||(this.ie4 && !this.mac))  ||  (this.ns4 && this.minor >= 4.06) ); 
	//this.class4 = (this.ie45||(this.ie4 && !this.mac)||(this.ns4 && !(this.minor >= 4 || this.minor <= 4.0))); // change note : 4.09
	this.class3 = (this.ie3||this.ns3||this.ie3||(this.ie4 && this.mac)||(this.ns4 && (this.minor >= 4) && (this.minor <= 4.0))); // change note : 4.09
	this.class2 = (this.ie2||this.ns2);
	this.class0 = !(this.class2||this.class3||this.class4||this.class5)
}
ubB = new ubDetect()
ub = new Object();
//-----------------------------------------------------------------------------
// capabilities modules
//-----------------------------------------------------------------------------
// plugin detection
//  ** NOT YET IMPLEMENTED **
ub.plug = new Object();
// requires:
//  ** NOT YET IMPLEMENTED **
ub.plug.flash = 0;
// requires:
//  ** NOT YET IMPLEMENTED **
ub.plug.quicktime = 0;
// requires:
//  ** NOT YET IMPLEMENTED **
ub.plug.realaudio = 0;
// requires:
//  ** NOT YET IMPLEMENTED **
ub.plug.winmedia = 0;
//-----------------------------------------------------------------------------
// utility modules
//-----------------------------------------------------------------------------
// data validation
// requires: none
ub.dataval = 0;
// urlencode
// requires: none
ub.urlencode = 0;
// window object and popups
// requires: none
ub.win = 1;
// image rollover
// requires: none
ub.imgrollover = 1;
// cookies
// requires: none
ub.cookies = 0;
//-----------------------------------------------------------------------------
// div modules
//-----------------------------------------------------------------------------
// div initialization
// requires: none
if (ubB.class5)
	ub.divinit_class5 = 1;
else
	ub.divinit = 1;
// div move
// requires: divinit
if (ubB.class5)
	ub.divmove_class5 = 1;
else
	ub.divmove = 1;
// div slide
// requires: divinit
ub.divslide = 1;
// div clipping
// requires: divinit
if (ubB.class5)
	ub.divclip_class5 = 1;
else
	ub.divclip = 1;
// div writing
// requires: divinit
ub.divwrite = 1;
//-----------------------------------------------------------------------------
// css modules
//-----------------------------------------------------------------------------
// generic and div stylesheet writing
// requires: none
ub.csswrite = 1;
//-----------------------------------------------------------------------------
// specialty modules
//-----------------------------------------------------------------------------
// vertical scrolling marquee
// requires: divinit, divmove, divslide, divclip, csswrite
ub.vertmarquee = 1;
// div scrollers
// requires:
//  ** NOT YET IMPLEMENTED **
ub.divscroll = 0;
//  ** NOT YET IMPLEMENTED **
ub.divmultiscroll = 0;
//-----------------------------------------------------------------------------
// form modules
//-----------------------------------------------------------------------------
// security
// requires: dataval
ub.frmsecure = 0;
// custom for fields
// requires: 
//  ** NOT YET IMPLEMENTED **
ub.frmcustom = 0;

//-----------------------------------------------------------------------------
// module gathering
	// change notes: added the js/ directory to the src
//-----------------------------------------------------------------------------
for (module in ub) {
	currentModule = eval("ub." + module);
	if (typeof currentModule == "object") {
		for (submodule in currentModule)
			if (eval("ub." + module + "." + submodule)) document.write ("<script language='javascript' src='scripts/uberinc_" + module + "_" + submodule + ".js'></script>");
	} else {
		if (currentModule) document.write ("<script language='javascript' src='scripts/uberinc_" + module + ".js'></script>");
	}
}
