//Open a registration popup
windowOpen = false;							//A thumbnail window is, by default, NOT open.
newWindow = "";
function reg_pop(u, winName){

	//alert(u)
	var windowName = "large";
	var w = 538;
	var h = 640;	
		
	if (arguments.length>=2){
		windowName = arguments[1];
		windowOpen = false;		
		newWindow = "";
	}
	
	if (newWindow !=""){
		newWindow = window.open(u,windowName,"width=" + w + ",height=" + h + ",scrollbars,resizable");
		if (newWindow.opener == null) newWindow.opener = window;
		if (!newWindow.closed){
					
			newWindow.focus();
			return;
		}
	}
	//alert ("Width: " + x + "\nHeight: " + y);
	newWindow = window.open(u,windowName,"width=" + w + ",height=" + h + ",scrollbars,resizable");
	if (newWindow.opener == null) newWindow.opener = window;
	newWindow.focus();
}

function regwide_pop(u, winName, win_width, win_height){
	//alert(u)
	var windowName = "large";
	
	if (arguments.length>2){
		var w = ((Number(win_width.toString())+"")!="NaN")?win_width:740;
		var h = ((Number(win_height.toString())+"")!="NaN")?win_height:640;
	}else{
		var w = 740;
		var h = 640;	
	}
		
	if (arguments.length>=2){
		windowName = arguments[1];
		windowOpen = false;		
		newWindow = "";
	}
	
	if (newWindow !=""){
		newWindow = window.open(u,windowName,"width=" + w + ",height=" + h + ",scrollbars,resizable");
		if (newWindow.opener == null) newWindow.opener = window;
		if (!newWindow.closed){
					
			newWindow.focus();
			return;
		}
	}
	//alert ("Width: " + x + "\nHeight: " + y);
	newWindow = window.open(u,windowName,"width=" + w + ",height=" + h + ",scrollbars,resizable");
	if (newWindow.opener == null) newWindow.opener = window;
	newWindow.focus();
}

function PageQuery(q) {
	if(q.length > 1) this.q = q.substring(1, q.length);
	else this.q = null;
	
	this.keyValuePairs = new Array();
		
	if(q) {
		for(var i=0; i < this.q.split("&").length; i++) {
			this.keyValuePairs[i] = this.q.split("&")[i];
		}
	}
	
	this.getKeyValuePairs = function() { return this.keyValuePairs; }
	this.getValue = function(s) {
		for(var j=0; j < this.keyValuePairs.length; j++) {
			if(this.keyValuePairs[j].split("=")[0] == s)
			return this.keyValuePairs[j].split("=")[1];
		}
		return false;
	}
		
	this.getParameters = function() {
		var a = new Array(this.getLength());
		for(var j=0; j < this.keyValuePairs.length; j++) {
		a[j] = this.keyValuePairs[j].split("=")[0];
		}
		return a;
	}
	
	this.getLength = function() { return this.keyValuePairs.length; } 
}

function queryString(key){
	var page = new PageQuery(window.location.search); 
	return unescape(page.getValue(key)); 
}

function displayItem(key){
	if(queryString(key)=='false') 
	{
		document.write("you didn't enter a ?name=value querystring item.");
	}else{
		document.write(queryString(key));
	}
}

function getUrlHash(){
	var str="";
	str = str + window.location.hash;
	if (str == "null" || str=="undefined"){str="";}
	return str
}

function metaRefresh(reg_url){
	str = "";
	str = str + "<meta http-equiv=\"refresh\" content=\"0;url=" + reg_url + "\">";
	document.write(str);
}

function appendAlltoUrl(page){
	var urlstring = ""
	for (var i=0; i<page.keyValuePairs.length; i++){
		urlstring += page.keyValuePairs[i] + "=" + page.getValue(page.keyValuePairs[i]);
		
		if (i!= page.keyValuePairs.length-1){
			urlstring += "&";
		}
	}

	return urlstring;
}

function onClickRefresh(reg_url){

	var myString = new String(reg_url);
	rExp = /\&/gi;
	var newString = new String ("|||");
	var results = myString.replace(rExp, newString);
	
	myString = new String(results)
	rExp = /\=/gi;
	var newString = new String ("***");
	var results = myString.replace(rExp, newString);
	
	window.location.href="http://www.lehman.com/pub/2006MarketingSupport/metarefesh.html?reg_url="+results;
	//window.location.href="http://njisgnt08:8600/DESIGN/tawana_test/metarefresh.asp?reg_url="+results;
}

function LibBrowser(){}

LibBrowser.prototype.typeOfBrowser = function typeOfBrowser(){
// Ultimate client-side JavaScript client sniff. Version 3.03
// (C) Netscape Communications 1999-2001.  Permission granted to reuse and dithis.stribute.
// Revised 17 May 99 to add is_nav5up and is_ie5up (see below).
// Revised 20 Dec 00 to add is_gecko and change is_nav5up to is_nav6up
//                      also added support for IE5.5 Opera4&5 HotJava3 AOLTV
// Revised 22 Feb 01 to correct Javascript Detection for IE 5.x, Opera 4, 
//                      correct Opera 5 detection
//                      add support for winME and win2k
//                      synch with browser-type-oo.js
// Revised 26 Mar 01 to correct Opera detection
// Revised 02 Oct 01 to add IE6 detection

// Everything you always wanted to know about your JavaScript client
// but were afraid to ask. Creates "is_" variables indicating:
// (1) browser vendor:
//     is_nav, is_ie, is_opera, is_hotjava, is_webtv, is_TVNavigator, is_AOLTV
// (2) browser version number:
//     is_major (integer indicating major version number: 2, 3, 4 ...)
//     is_minor (float   indicating full  version number: 2.02, 3.01, 4.04 ...)
// (3) browser vendor AND major version number
//     is_nav2, is_nav3, is_nav4, is_nav4up, is_nav6, is_nav6up, is_gecko, is_ie3,
//     is_ie4, is_ie4up, is_ie5, is_ie5up, is_ie5_5, is_ie5_5up, is_ie6, is_ie6up, is_hotjava3, is_hotjava3up,
//     is_opera2, is_opera3, is_opera4, is_opera5, is_opera5up
// (4) JavaScript version number:
//     is_js (float indicating full JavaScript version number: 1, 1.1, 1.2 ...)
// (5) OS platform and version:
//     is_win, is_win16, is_win32, is_win31, is_win95, is_winnt, is_win98, is_winme, is_win2k
//     is_os2
//     is_mac, is_mac68k, is_macppc
//     is_unix
//     is_sun, is_sun4, is_sun5, is_suni86
//     is_irix, is_irix5, is_irix6
//     is_hpux, is_hpux9, is_hpux10
//     is_aix, is_aix1, is_aix2, is_aix3, is_aix4
//     is_linux, is_sco, is_unixware, is_mpras, is_reliant
//     is_dec, is_sinix, is_freebsd, is_bsd
//     is_vms
//
// See http://www.it97.de/JavaScript/JS_tutorial/bstat/navobj.html and
// http://www.it97.de/JavaScript/JS_tutorial/bstat/Browseraol.html
// for detailed lists of userAgent this.strings.
//
// Note: you don't want your Nav4 or IE4 code to "turn off" or
// stop working when new versions of browsers are released, so
// in conditional code forks, use is_ie5up ("IE 5.0 or greater") 
// is_opera5up ("Opera 5.0 or greater") instead of is_ie5 or is_opera5
// to check version in code which you want to work on future
// versions.
	this.str="";
	
    // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();
	this.str = this.str + "agt: " + agt + "\n";
    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    this.is_major = parseInt(navigator.appVersion);
    this.is_minor = parseFloat(navigator.appVersion);
	this.str = this.str + "is_minor: " + this.is_minor + "\n";
	this.str = this.str + "is_minor: " + this.is_minor + "\n";

	
    // Note: Opera and WebTV spoof Navigator.  We do this.strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    this.is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    this.is_nav2 = (this.is_nav && (this.is_major == 2));
    this.is_nav3 = (this.is_nav && (this.is_major == 3));
    this.is_nav4 = (this.is_nav && (this.is_major == 4));
    this.is_nav4up = (this.is_nav && (this.is_major >= 4));
    this.is_navonly      = (this.is_nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    this.is_nav6 = (this.is_nav && (this.is_major == 5));
    this.is_nav6up = (this.is_nav && (this.is_major >= 5));
    this.is_gecko = (agt.indexOf('gecko') != -1);
    this.is_firefox = (agt.indexOf('firefox') != -1);

	this.str = this.str + "is_nav: " + this.is_nav + "\n";
	this.str = this.str + "is_nav2: " + this.is_nav2 + "\n";
	this.str = this.str + "is_nav3: " + this.is_nav3 + "\n";
	this.str = this.str + "is_nav4: " + this.is_nav4 + "\n";
	this.str = this.str + "is_nav4up: " + this.is_nav4up + "\n";
	this.str = this.str + "is_navonly: " + this.is_navonly + "\n";
	this.str = this.str + "is_nav6: " + this.is_nav6 + "\n";
	this.str = this.str + "is_nav6up: " + this.is_nav6up + "\n";
	this.str = this.str + "is_gecko: " + this.is_gecko + "\n";
	this.str = this.str + "is_firefox: " + this.is_firefox + "\n";

    this.is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    this.is_ie3    = (this.is_ie && (this.is_major < 4));
    this.is_ie4    = (this.is_ie && (this.is_major == 4) && (agt.indexOf("msie 4")!=-1) );
    this.is_ie4up  = (this.is_ie && (this.is_major >= 4));
    this.is_ie5    = (this.is_ie && (this.is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    this.is_ie5_5  = (this.is_ie && (this.is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
    this.is_ie5up  = (this.is_ie && !this.is_ie3 && !this.is_ie4);
    this.is_ie5_5up =(this.is_ie && !this.is_ie3 && !this.is_ie4 && !this.is_ie5);
    this.is_ie6    = (this.is_ie && (this.is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
    this.is_ie6up  = (this.is_ie && !this.is_ie3 && !this.is_ie4 && !this.is_ie5 && !this.is_ie5_5);

	this.str = this.str + "is_ie: " + this.is_ie + "\n";
	this.str = this.str + "is_ie3: " + this.is_ie3 + "\n";
	this.str = this.str + "is_ie4: " + this.is_ie4 + "\n";
	this.str = this.str + "is_ie4up: " + this.is_ie4up + "\n";
	this.str = this.str + "is_ie5: " + this.is_ie5 + "\n";
	this.str = this.str + "is_ie5_5: " + this.is_ie5_5 + "\n";
	this.str = this.str + "is_ie5_5up: " + this.is_ie5_5up + "\n";
	this.str = this.str + "is_ie6: " + this.is_ie6 + "\n";
	this.str = this.str + "is_ie6up: " + this.is_ie6up + "\n";

    // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
    // or if this is the first browser window opened.  Thus the
    // variables is_aol, is_aol3, and is_aol4 aren't 100% reliable.
    this.is_aol   = (agt.indexOf("aol") != -1);
    this.is_aol3  = (this.is_aol && this.is_ie3);
    this.is_aol4  = (this.is_aol && this.is_ie4);
    this.is_aol5  = (agt.indexOf("aol 5") != -1);
    this.is_aol6  = (agt.indexOf("aol 6") != -1);

 	this.str = this.str + "is_aol: " + this.is_aol + "\n";
	this.str = this.str + "is_aol3: " + this.is_aol3 + "\n";
	this.str = this.str + "is_aol4: " + this.is_aol4 + "\n";
	this.str = this.str + "is_aol5: " + this.is_aol5 + "\n";
	this.str = this.str + "is_aol6: " + this.is_aol6 + "\n";

    this.is_opera = (agt.indexOf("opera") != -1);
    this.is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
    this.is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
    this.is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
    this.is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
    this.is_opera5up = (this.is_opera && !this.is_opera2 && !this.is_opera3 && !this.is_opera4);

 	this.str = this.str + "is_opera: " + this.is_opera + "\n";
	this.str = this.str + "is_opera2: " + this.is_opera2 + "\n";
	this.str = this.str + "is_opera3: " + this.is_opera3 + "\n";
	this.str = this.str + "is_opera4: " + this.is_opera4 + "\n";
	this.str = this.str + "is_opera5: " + this.is_opera5 + "\n";
	this.str = this.str + "is_opera5up: " + this.is_opera5up + "\n";

    this.is_webtv = (agt.indexOf("webtv") != -1); 
	this.str = this.str + "is_webtv: " + this.is_webtv + "\n";

    this.is_TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
    this.is_AOLTV = this.is_TVNavigator;

	this.str = this.str + "is_TVNavigator: " + this.is_TVNavigator + "\n";
	this.str = this.str + "is_AOLTV: " + this.is_AOLTV + "\n";

    this.is_hotjava = (agt.indexOf("hotjava") != -1);
    this.is_hotjava3 = (this.is_hotjava && (this.is_major == 3));
    this.is_hotjava3up = (this.is_hotjava && (this.is_major >= 3));

	this.str = this.str + "is_hotjava: " + this.is_hotjava + "\n";
	this.str = this.str + "is_hotjava3: " + this.is_hotjava3 + "\n";
	this.str = this.str + "is_hotjava3up: " + this.is_hotjava3up + "\n";

    // *** JAVASCRIPT VERSION CHECK ***
    this.is_js;
    if (this.is_nav2 || this.is_ie3) this.is_js = 1.0;
    else if (this.is_nav3) this.is_js = 1.1;
    else if (this.is_opera5up) this.is_js = 1.3;
    else if (this.is_opera) this.is_js = 1.1;
    else if ((this.is_nav4 && (this.is_minor <= 4.05)) || this.is_ie4) this.is_js = 1.2;
    else if ((this.is_nav4 && (this.is_minor > 4.05)) || this.is_ie5) this.is_js = 1.3;
    else if (this.is_hotjava3up) this.is_js = 1.4;
    else if (this.is_nav6 || this.is_gecko) this.is_js = 1.5;
    // NOTE: In the future, update this code when newer versions of JS
    // are released. For now, we try to provide some upward compatibility
    // so that future versions of Nav and IE will show they are at
    // *least* JS 1.x capable. Always check for JS version compatibility
    // with > or >=.
    else if (this.is_nav6up) this.is_js = 1.5;
    // NOTE: ie5up on mac is 1.4
    else if (this.is_ie5up) this.is_js = 1.3

    // HACK: no idea for other browsers; always check for JS version with > or >=
    else this.is_js = 0.0;

    // *** PLATFORM ***
    this.is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
    // NOTE: On Opera 3.0, the userAgent this.string includes "Windows 95/NT4" on all
    //        Win32, so you can't distinguish between Win95 and WinNT.
    this.is_win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));

    // is this a 16 bit compiled version?
    this.is_win16 = ((agt.indexOf("win16")!=-1) || 
               (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) || 
               (agt.indexOf("windows 16-bit")!=-1) );  

    this.is_win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
                    (agt.indexOf("windows 16-bit")!=-1));

    this.is_winme = ((agt.indexOf("win 9x 4.90")!=-1));
    this.is_win2k = ((agt.indexOf("windows nt 5.0")!=-1));

	this.str = this.str + "is_js: " + this.is_js + "\n";
	this.str = this.str + "is_win: " + this.is_win + "\n";
	this.str = this.str + "is_win95: " + this.is_win95 + "\n";
	this.str = this.str + "is_win16: " + this.is_win16 + "\n";
	this.str = this.str + "is_win31: " + this.is_win31 + "\n";
	this.str = this.str + "is_winme: " + this.is_winme + "\n";
	this.str = this.str + "is_win2k: " + this.is_win2k + "\n";


    // NOTE: Reliable detection of Win98 may not be possible. It appears that:
    //       - On Nav 4.x and before you'll get plain "Windows" in userAgent.
    //       - On Mercury client, the 32-bit version will return "Win98", but
    //         the 16-bit version running on Win98 will still return "Win95".
    this.is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
    this.is_winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
    this.is_win32 = (this.is_win95 || this.is_winnt || this.is_win98 || 
                    ((this.is_major >= 4) && (navigator.platform == "Win32")) ||
                    (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));

    this.is_os2   = ((agt.indexOf("os/2")!=-1) || 
                    (navigator.appVersion.indexOf("OS/2")!=-1) ||   
                    (agt.indexOf("ibm-webexplorer")!=-1));

    this.is_mac    = (agt.indexOf("mac")!=-1);
    // hack ie5 js version for mac
    if (this.is_mac && this.is_ie5up) is_js = 1.4;
    this.is_mac68k = (this.is_mac && ((agt.indexOf("68k")!=-1) || 
                               (agt.indexOf("68000")!=-1)));
    this.is_macppc = (this.is_mac && ((agt.indexOf("ppc")!=-1) || 
                                (agt.indexOf("powerpc")!=-1)));

	this.str = this.str + "is_win98: " + this.is_win98 + "\n";
	this.str = this.str + "is_winnt: " + this.is_winnt + "\n";
	this.str = this.str + "is_win32: " + this.is_win32 + "\n";
	this.str = this.str + "is_os2: " + this.is_os2 + "\n";
	this.str = this.str + "is_mac: " + this.is_mac + "\n";
	this.str = this.str + "is_mac68k: " + this.is_mac68k + "\n";
	this.str = this.str + "is_macppc: " + this.is_macppc + "\n";

    this.is_sun   = (agt.indexOf("sunos")!=-1);
    this.is_sun4  = (agt.indexOf("sunos 4")!=-1);
    this.is_sun5  = (agt.indexOf("sunos 5")!=-1);
    this.is_suni86= (this.is_sun && (agt.indexOf("i86")!=-1));
    this.is_irix  = (agt.indexOf("irix") !=-1);    // SGI
    this.is_irix5 = (agt.indexOf("irix 5") !=-1);
    this.is_irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
    this.is_hpux  = (agt.indexOf("hp-ux")!=-1);
    this.is_hpux9 = (this.is_hpux && (agt.indexOf("09.")!=-1));
    this.is_hpux10= (this.is_hpux && (agt.indexOf("10.")!=-1));
    this.is_aix   = (agt.indexOf("aix") !=-1);      // IBM
    this.is_aix1  = (agt.indexOf("aix 1") !=-1);    
    this.is_aix2  = (agt.indexOf("aix 2") !=-1);    
    this.is_aix3  = (agt.indexOf("aix 3") !=-1);    
    this.is_aix4  = (agt.indexOf("aix 4") !=-1);    
    this.is_linux = (agt.indexOf("inux")!=-1);
    this.is_sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
    this.is_unixware = (agt.indexOf("unix_system_v")!=-1); 
    this.is_mpras    = (agt.indexOf("ncr")!=-1); 
    this.is_reliant  = (agt.indexOf("reliantunix")!=-1);
    this.is_dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) || 
           (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) || 
           (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1)); 
    this.is_sinix = (agt.indexOf("sinix")!=-1);
    this.is_freebsd = (agt.indexOf("fre<>ebsd")!=-1);
    this.is_bsd = (agt.indexOf("bsd")!=-1);
    this.is_unix  = ((agt.indexOf("x11")!=-1) || this.is_sun || this.is_irix || this.is_hpux || 
                 this.is_sco || this.is_unixware || this.is_mpras || this.is_reliant || 
                 this.is_dec || this.is_sinix || this.is_aix || this.is_linux || this.is_bsd || this.is_freebsd);

    this.is_vms   = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));

	this.str = this.str + "is_sun: " + this.is_sun + "\n";
	this.str = this.str + "is_sun4: " + this.is_sun4 + "\n";
	this.str = this.str + "is_sun5: " + this.is_sun5 + "\n";
	this.str = this.str + "is_suni86: " + this.is_suni86 + "\n";
	this.str = this.str + "is_irix: " + this.is_irix + "\n";
	this.str = this.str + "is_irix5: " + this.is_irix5 + "\n";
	this.str = this.str + "is_irix6: " + this.is_irix6 + "\n";
	this.str = this.str + "is_hpux: " + this.is_hpux + "\n";
	this.str = this.str + "is_hpux9: " + this.is_hpux9 + "\n";
	this.str = this.str + "is_hpux10: " + this.is_hpux10 + "\n";
	this.str = this.str + "is_aix: " + this.is_aix + "\n";
	this.str = this.str + "is_aix1: " + this.is_aix1 + "\n";
	this.str = this.str + "is_aix2: " + this.is_aix2 + "\n";
	this.str = this.str + "is_aix3: " + this.is_aix3 + "\n";
	this.str = this.str + "is_aix4: " + this.is_aix4 + "\n";
	this.str = this.str + "is_linux: " + this.is_linux + "\n";
	this.str = this.str + "is_sco: " + this.is_sco + "\n";
	this.str = this.str + "is_unixware: " + this.is_unixware + "\n";
	this.str = this.str + "is_mpras: " + this.is_mpras + "\n";
	this.str = this.str + "is_reliant: " + this.is_reliant + "\n";
	this.str = this.str + "is_dec: " + this.is_dec + "\n";
	this.str = this.str + "is_sinix: " + this.is_sinix + "\n";
	this.str = this.str + "is_freebsd: " + this.is_freebsd + "\n";
	this.str = this.str + "is_bsd: " + this.is_bsd + "\n";
	this.str = this.str + "is_unix: " + this.is_unix + "\n";
	this.str = this.str + "is_vms: " + this.is_vms + "\n";
}
