
<!-- use this comment tag to hide the enclosed code from old browsers.

/******************  Detect Version  ********************/

var debug = false;
var overrideFlash = false;

// These Variables can be used in the outside world as indicators of various plugins
var hasSWDirector = false; // has the Shockwave Director
var versionSWDirector = ""; // version of the Shockwave Director - 7.0 or up
var hasFlash = false; // has Macromedia Flash
var versionFlash = ""; // version of the Shockwave Director - 5.0 or up

//***************************
// A few variables to help figure out what platform we're on

var allPlugins = navigator.plugins;
var arraylength = allPlugins.length;

var ie  = (navigator.appName.toLowerCase().indexOf("microsoft") != -1);
var ns  = (navigator.appName.toLowerCase().indexOf("netscape") != -1);
var win = (navigator.platform.toLowerCase().indexOf("win") != -1);
var mac = (navigator.platform.toLowerCase().indexOf("mac") != -1);
var browserVer = parseFloat(ie ? navigator.appVersion.substring(navigator.appVersion.toLowerCase().indexOf("msie") + 4) : navigator.appVersion);

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

//***************************
// For detecting the shockwave plugin for Netscape.
// This function can return a boolean or a floating point value.
// If you supply a reqVer value (number) it will return true or false
// depending on if that version or higher was found.
// If you don't supply a parameter it will return the found version number.

function detectNsVer() {
  // This function returns a floating point value which should be the version of the Shockwave plugin or 0.0
  // This function only returns useful information if called from Netscape or IE Mac 5.0+

  if (!navigator.plugins) return (""); // IE Mac 4.5 and lower don't have a plugins array.

  // Set these local variables to avoid the Netscape 4 crashing bug.
  thearray = navigator.plugins
  arraylen = thearray.length

	if (debug)  alert ("Plugins found - " + arraylen);
  // Step through each plugin in the array.
  for (i=0; i < arraylen; i++) {
    // Set these local variables to avoid the Netscape 4 crashing bug.
    theplugin = thearray[i]
    thename   = theplugin.name
    thedesc   = theplugin.description

	if (debug)  alert ("detectNsVer: Name - " + thename + "; Desc - " + thedesc);
	// If the plugin is Shockwave...
    if (thename.indexOf("Shockwave") != -1 && thename.indexOf("Director") != -1) {
      // ...extract the version information
      versionString = thedesc.substring(thedesc.indexOf("version ") + 8);
      if (versionString.indexOf(".") > 0) {
        versionMajor = versionString.substring(0,versionString.indexOf("."));
        versionMinor = versionString.substring(versionString.indexOf(".") + 1);
        if (versionMinor.indexOf(".") > 0)
          versionMinor = versionMinor.substring(0,versionString.indexOf("."))
                         + versionMinor.substring(versionMinor.indexOf(".") + 1);   
        versionString = parseInt(versionMajor) + "." + versionMinor;
      }
      versionSWDirector = versionString;
    } 
    if (thename.indexOf("Shockwave") != -1 && thename.indexOf("Flash") != -1) {
      // ...extract the version information
	  versionFlash = thedesc.substring(thedesc.indexOf(".") - 1);
    } 
  }
  return ("");
}

//***************************
// For detecting the ActiveX for ie win.
// Requires vbscript function (VBGetShockwaveVer) above to be included on
// the page to do the actual checking.
// Returns version found or "" (blank string).
// This function will return String version value.

function shockwaveDetectAxVer() {
  // this function returns a floating point value which should be the version of the Shockwave control or 0.0
  // this function should only be called from Internet Explorer for Windows

  if (ie && win) {
    // loop backwards through the versions until we get a bite
    for (i=8;i>0;i--) {
      versionString = VBGetShockwaveVer(i);
      if (versionString != "0.0") {
        // if we get 1.0 we assume it is actually 6.0
        versionNumStr = (versionString == "1.0" ? "6.0" : versionString)
		if (debug) alert("versionString: " + versionString );
        return (versionNumStr);
      }
    }
  }
  return ("");
}

//***************************
// For detecting the ActiveX for ie win.
// Requires vbscript function (VBGetShockwaveVer) above to be included on
// the page to do the actual checking.
// Returns version found or "" (blank string).
// This function will return String version value.

function flashDetectAxVer() {
  // this function should only be called from Internet Explorer for Windows

  if (ie && win) {
    // loop backwards through the versions until we get a bite
    for (i=9;i>0;i--) {
      versionString = VBGetFlashVer(i);
	  if (debug) alert("versionString: " + versionString);
      if (versionString != "0.0") {
        return (versionString);
      }
    }
  }
  return ("");
}

function canDetectShockwave() {
  // Determine the browser version
  var browserVer = parseFloat(ie ?
                     navigator.appVersion.substring(navigator.appVersion.toLowerCase().indexOf("msie") + 4) :
                     navigator.appVersion);

	if (debug)  alert ("Browser Version : " + browserVer + ",  " + ie  + ",  " + win  + ",  " + ns  + ",  " + mac );

  // Return the appropriate value based on the browser, version and platform
  if (ie && win) return (browserVer >= 4.0) // Works in Windows IE 4.0 and better
  if (ie && mac) return (browserVer >= 5.0) // Works in Mac IE 5.0 and better 
  if (ns)        return (browserVer >= 3.0) // Works in Netscape 3.0 and better

  // If none of the above conditions matched, the browser is
  // unknown and likely doesn't support detection
  return false;
}

if (canDetectShockwave()) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');

	document.write('Function VBGetShockwaveVer(i) \n');
	document.write('  on error resume next \n');
	document.write('  Dim swControl, swVersion \n');
	document.write('  swVersion = "0.0" \n');
  
	document.write('  set swControl = CreateObject("SWCtl.SWCtl." + CStr(i)) \n');
	document.write('  if (IsObject(swControl)) then \n');
	document.write('    swVersion = CStr(i) + ".0" \n');
	document.write('    swVersion = CStr(swControl.ShockwaveVersion("")) \n');
	document.write('  end if \n');

	document.write('  VBGetShockwaveVer = swVersion \n');
	document.write('End Function \n');

	document.write('Function VBGetFlashVer(i) \n');
	document.write('	on error resume next \n');
	document.write('	Dim flashVersion, flashControl \n');
	document.write('	flashVersion = "0.0" \n');
  
	document.write('	set flashControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i)) \n');
	document.write('	if (IsObject(flashControl)) then \n');
	document.write('		flashVersion = CStr(i) + ".0" \n');
	document.write('	end if \n');

	document.write('  VBGetFlashVer = flashVersion \n');
	document.write('End Function \n');

	document.write('</SCRIPT\> \n');

	if (debug)  alert ("In for detecting SW");
	if (ie && win) {
		versionSWDirector = shockwaveDetectAxVer();
		versionFlash = flashDetectAxVer();
	if (debug)  alert ("Flash Version: " + versionFlash);
	} else {
		detectNsVer();
	}

	hasSWDirector = (versionSWDirector.length > 0 && (parseFloat(versionSWDirector) >= 7.0));
	
	hasFlash = (versionFlash.length > 0 && (parseFloat(versionFlash) >= 6.0));
	
	if (overrideFlash == true) {
		if (debug)  alert ("Overriding Flash - assuming HTML version.");
		hasFlash = false;
		hasSWDirector = false;
	}
}

function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

/******************  Resizer  ********************/
var initWidth =327;
var initHeight = 380;
var height = screen.height;
var width = screen.width;
var leftpos = (width  - initWidth) / 2;
var toppos = (height - initHeight) / 2;

function openWindow(fileName)
{
    if (win && ie)
    {
        newHeight = initHeight + 40;
        newWidth = initWidth + 12;
    }
    else if (mac && ie)
    {
        newHeight = initHeight + 20;
        newWidth = initWidth + 13;
    }
    else if (mac & ns)
    {
        newHeight = initHeight + 25;
        newWidth = initWidth + 10;
    }
    else
    {
        newHeight = initHeight + 10;
        newWidth = initWidth + 10;
    }
    window.open(fileName,'GBE_UCD_WIN','alwaysRaised=no,scrollbars=no,status=no,toolbar=no,resizable=0,location=no,menu=no,width='+newWidth+',height='+newHeight+',left='+leftpos+',top='+toppos);
}

function openWindow2(fileName)
{
    window.open(fileName,'GBE_UCD_WIN_2','scrollbars=1,status=0,toolbar=no,resizable=0,location=no,menu=no,width=776,height=590,left=' + ((width  - 776) / 2) + ',top=' + ((height - 590) / 2));
}

function resizeWindow(w, h)
{
    var name = navigator.appName
    if (win && ie)
    {
        newHeight = h + 40;
        newWidth = w + 12;
    }
    else if (mac && ie)
    {
        newHeight = h + 35;
        newWidth = w + 32;
    }
    else if (mac & ns)
    {
        newHeight = h +40;
        newWidth = w + 32;
    }
    else
    {
        newHeight = h + 36;
        newWidth = w + 10;
    }
    
    var height = screen.height;
    var width = screen.width;
    var leftpos = (width - newWidth) / 2;
    var toppos = (height - newHeight) / 2; 
    self.moveTo(leftpos, toppos);
    self.resizeTo(newWidth, newHeight);
    self.focus();
}

function sizeChange(){
	var x=document.getElementById('resizableRow').offsetHeight;
	var y=document.getElementById('resizableRow').offsetWidth;
	var w = window;
	if (win && ie){
		resizeWindow(y+10,x+10);
	}
	else if (mac && ie){
		resizeWindow(y+5,x+30);
	}
	else if (win && ns){
		self.resizeTo(y+15,x+40);
	}

	else{
		self.resizeTo(y+10,x+30);		
	}
	
}


