sImgPath = "/images/";
var is_linkobj;

//~RD function to check for expandable menu
//If there is a background color rollover change
//Should revert back to default background
function checkBlockBackground(defaultColor,cat,highlight)
{
	//alert(document.getElementById(cat).style.display);
	if (document.getElementById(cat).style.display !='none')
	{
		//document.getElementById(cat).style.backgroundColor = defaultColor
		//alert(document.getElementById(cat).style.backgroundColor);
		return defaultColor
	}else{
		//document.getElementById(cat).style.backgroundColor = highlight
		return highlight
	}
}

function PrintFormat(){
	var sUrl="/cms/templates/so/print.asp" + document.location.search
	var oWin=window.open(sUrl,"EmailFriend","width=600,height=600").focus()
}

function EmailFriend(){
	var sUrl="/cms/email.asp?src=" + document.location.href;
	var oWin=window.open(sUrl,"EmailFriend","width=500,height=500").focus()
}

function GlossaryDefinition(Term){
	var sUrl="/cms/templates/so/glossary.asp" + document.location.search ;
	if(Term){sUrl+="#" + Term;}
	var oWin=window.open(sUrl,"Glossary","width=500,height=400").focus()
}

var gCopyright="<a href='/copyright' target='_new'>&copy; Copyright 2007 Merrill Lynch &amp; Co., Inc.</a>";

function SetFormAction(FormObject){
	
	if(FormObject.rdrtools[0].checked){
		FormObject.action='/QuickQuote.htm';
		FormObject.wsUrl.value="http://localhost/Merrill/SO/1/MdInc2.aspx";
		checkValue('QuickQuote','Enter symbol');
		var oObject = document.getElementById('QuickQuote');
		oObject.disabled = false;
		var oObject = document.getElementById('FullQuote');
		oObject.disabled = true;
		var oObject = document.getElementById('Symbol');
		oObject.disabled = true;
		
	};
	if(FormObject.rdrtools[1].checked){
		checkValue('FullQuote','Enter symbol');
		var oObject = document.getElementById('QuickQuote');
		oObject.disabled = true;
		var oObject = document.getElementById('FullQuote');
		oObject.disabled = false;
		var oObject = document.getElementById('Symbol');
		oObject.disabled = true;
		FormObject.action='http://askmerrill.ml.com/markets_chart/1%2C2260%2C%2C00.html?Action=on'
	};
	if(FormObject.rdrtools[2].checked){
		checkValue('Symbol','Enter company name');
		var oObject = document.getElementById('QuickQuote');
		oObject.disabled = true;
		var oObject = document.getElementById('FullQuote');
		oObject.disabled = true;
		var oObject = document.getElementById('Symbol');
		oObject.disabled = false;
		FormObject.action='/SymbolLookup.htm'
		FormObject.wsUrl.value="http://localhost/Merrill/SO/1/MdInc3.aspx";
		};
	FormObject.quoteslookup.value=FormObject.qqsymbol.value;
	FormObject.q.value=FormObject.qqsymbol[1].value;
}

function SetFormActionInd(FormObject){
	if(FormObject.rdrtools[0].checked){
		FormObject.action='/USMarketIndices.htm';
		FormObject.wsUrl.value="http://localhost/Merrill/SO/1/MdInc4.aspx";
	}
	if(FormObject.rdrtools[1].checked){
		FormObject.action='/SymbolLookup.htm';
		FormObject.wsUrl.value="http://localhost/Merrill/SO/1/MdInc3.aspx";
	}
}

function SetFormActionQFI(FormObject){
	/* 	0 = quick,1 = full,2 = market indice {exposed field name = quoteslookup}*/
	if(FormObject.rdrtools[0].checked){
		FormObject.action='/QuickQuote.htm';
		FormObject.wsUrl.value="http://localhost/Merrill/SO/1/MdInc2.aspx";
	};
	if(FormObject.rdrtools[1].checked){
		FormObject.action='http://askmerrill.ml.com/markets_chart/1%2C2260%2C%2C00.html?Action=on'
	};
	if(FormObject.rdrtools[2].checked){
		FormObject.action='/USMarketIndices.htm'
		FormObject.wsUrl.value="http://localhost/Merrill/SO/1/MdInc4.aspx";
		};
	FormObject.qqsymbol.value=FormObject.quoteslookup.value;
	FormObject.q.value=FormObject.quoteslookup.value;
}


/* Login Object */
function login() {
	this.Cookie = GetCookie;
	this.CookieDelete = DeleteCookie;
	this.CookieSet = SetCookie;
	this.SelectSite = selectsite;
	this.SiteSelected = new Number(-1);
	this.SiteUrl = new String('');
	this.SiteName = new String('');
}


function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg) {
	  this.SiteSelected = getCookieVal (j);
	  if(this.SiteSelected == -1) {
		this.SiteSelected = 0;
		}
      return this.SiteSelected;
    }
	i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }

  return 0;
}

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}


function DeleteCookie (name,path,domain) {
    document.cookie = name + "=" + null +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}


function selectsite() 
{
	var oLoginBox = document.getElementById("loginopt");
	
	this.SiteSelected = oLoginBox.selectedIndex;

	this.SiteUrl = oLoginBox.options[this.SiteSelected].value;
	this.SiteName = oLoginBox.options[this.SiteSelected].text;

	if (this.SiteSelected == -1||this.SiteUrl == "0") {
		this.SiteUrl = oLoginBox.options[oLoginBox.options.length-1].value;
		window.location.replace(this.SiteUrl);
		return;
	}	
	
	
	var dexpdate = new Date ();
	//FixCookieDate (dexpdate); // Correct for Mac date bug - call only once for given Date object!
	dexpdate.setTime (dexpdate.getTime() + (5000*24 * 60 * 60 * 1000)); 
	this.CookieSet('login', this.SiteSelected, dexpdate);
	
	
	if (this.SiteSelected == 1||this.SiteSelected == 2||this.SiteSelected == 3||this.SiteSelected == 4||this.SiteSelected == 5||this.SiteSelected == 6||this.SiteSelected == 8||this.SiteSelected == 9||this.SiteSelected == 10||this.SiteSelected == 11||this.SiteSelected == 17||this.SiteSelected == 18||this.SiteSelected == 19||this.SiteSelected == 7||this.SiteSelected == 16) {
		document.location.href=(this.SiteUrl);
	}else{
		window.open(this.SiteUrl);
	}
	
}

var oLogin = new login();


/* Initialize */
function login_init() {
	//oLogin.CookieDelete('login');
	if (document.getElementById("loginopt")) {
		document.getElementById("loginopt").selectedIndex = oLogin.Cookie("login");
	}
}

window.onload = login_init;

function expandcollapse(oItem) {

	var oParent = (oItem.parentNode || oItem.parentElement);
	oSpans = oParent.getElementsByTagName('span');

	if(oSpans[0].style.display == 'none') { 
		for(i=0;i < oSpans.length;i++) {
			oSpans[i].style.display= 'inline';
		}
		oParent.getElementsByTagName('img')[0].src= sImgPath + 'r_arrowdown.gif';
	}
	else{
		for(i=0;i <oSpans.length;i++) {
			oSpans[i].style.display= 'none';
		}
		oParent.getElementsByTagName('img')[0].src= sImgPath + 'arrow_red.gif';
	}
}


function checkValue(sInputId, sDefaultText) {
		
		var oInput = document.getElementById(sInputId);
	
		if (oInput.value == sDefaultText) {
			oInput.value = '';
			return true;
		}
		else {
			return true;
		}
}



function checkValue2(sInputId, sDefaultText) {
		
		var oInput = document.getElementById(sInputId);
	
		if (oInput.value == sDefaultText||oInput.value == '') {
			form1.action='/BranchOfficeLocator.htm';
			return false;
		}
		else {
			form1.action='/BranchOfficeLocator.htm';
			return true;
		}
}




function validateForm() {


	var myMessage = ""
	
	if (form1.Email.value == "") myMessage += "Email Address, ";
	
	
	if (myMessage.length > 0) {
		myMessage = myMessage.slice(0, myMessage.length-2);
		alert("The following fields have not been filled out: " + myMessage + ". Please fill out all the required fields.");
		return false;
	}
	return true;
}

function validateForm2() {

	var myMessage = ""
	
	if (form2.Email.value == "") myMessage += "Email Address, ";
	
	
	if (myMessage.length > 0) {
		myMessage = myMessage.slice(0, myMessage.length-2);
		alert("The following fields have not been filled out: " + myMessage + ". Please fill out all the required fields.");
		return false;
	}
	return true;
}


function validateForm3() {

	var myMessage = ""
	
	if (form3.Email.value == "") myMessage += "Email Address, ";
	
	
	if (myMessage.length > 0) {
		myMessage = myMessage.slice(0, myMessage.length-2);
		alert("The following fields have not been filled out: " + myMessage + ". Please fill out all the required fields.");
		return false;
	}
	return true;
}

function validateForm4() {

	var myMessage = ""

	if (form4.Email.value == "") myMessage += "Email Address, ";
	
	
	if (myMessage.length > 0) {
		myMessage = myMessage.slice(0, myMessage.length-2);
		alert("The following fields have not been filled out: " + myMessage + ". Please fill out all the required fields.");
		return false;
	}
	return true;
}


function validateForm5() {

	var myMessage = ""
	
	if (form5.Email.value == "") myMessage += "Email Address, ";
	
	
	if (myMessage.length > 0) {
		myMessage = myMessage.slice(0, myMessage.length-2);
		alert("The following fields have not been filled out: " + myMessage + ". Please fill out all the required fields.");
		return false;
	}
	return true;
}



function validateForm6() {

	var myMessage = ""
	
	if (form6.Email.value == "") myMessage += "Email Address, ";
	
	
	if (myMessage.length > 0) {
		myMessage = myMessage.slice(0, myMessage.length-2);
		alert("The following fields have not been filled out: " + myMessage + ". Please fill out all the required fields.");
		return false;
	}
	return true;
}



function validateForm7() {

	var myMessage = ""
	
	if (form7.Email.value == "") myMessage += "Email Address, ";
	
	
	if (myMessage.length > 0) {
		myMessage = myMessage.slice(0, myMessage.length-2);
		alert("The following fields have not been filled out: " + myMessage + ". Please fill out all the required fields.");
		return false;
	}
	return true;
}


function validateForm8() {

	var myMessage = ""
	
	if (form8.Email.value == "") myMessage += "Email Address, ";

	
	if (myMessage.length > 0) {
		myMessage = myMessage.slice(0, myMessage.length-2);
		alert("The following fields have not been filled out: " + myMessage + ". Please fill out all the required fields.");
		return false;
	}
	return true;
}


//Careers Challenge Microsite Registration Form
function submitIt(form) {
		if (form.teamname.value==""){alert("Please complete all fields");return false}
		if (form.school.value==""){alert("Please complete all fieldsl");return false}
		if (form.team_email.value==""){alert("Please complete all fields");return false}
		
	// 1st person	
		if (form.salute1.value=="0"){alert("Please complete all fields");return false}
		if (form.lname1.value==""){alert("Please complete all fields");return false}
		if (form.fname1.value==""){alert("Please complete all fields");return false}
		if (form.phone1.value==""){alert("Please complete all fields");return false}
		if (form.email1.value==""){alert("Please complete all fields");return false}
		if (form.addrstA1.value==""){alert("Please complete all fields");return false}
		if (form.addrcity1.value==""){alert("Please complete all fields");return false}
		if (form.addrzip1.value==""){alert("Please complete all fields");return false}
		if (form.addrcountry1.value==""){alert("Please complete all fields");return false}
		if (form.gradyear1.value==""){alert("Please complete all fields");return false}


	// 2nd person	
		if (form.salute2.value=="0"){alert("Please complete all fields");return false}
		if (form.lname2.value==""){alert("Please complete all fields");return false}
		if (form.fname2.value==""){alert("Please complete all fields");return false}
		if (form.phone2.value==""){alert("Please complete all fields");return false}
		if (form.email2.value==""){alert("Please complete all fields");return false}
		if (form.addrstA2.value==""){alert("Please complete all fields");return false}
		if (form.addrcity2.value==""){alert("Please complete all fields");return false}
		if (form.addrzip2.value==""){alert("Please complete all fields");return false}
		if (form.addrcountry2.value==""){alert("Please complete all fields");return false}
		if (form.gradyear2.value==""){alert("Please complete all fields");return false}

		
	// 3rd person	
		if (form.salute3.value=="0"){alert("Please complete all fields");return false}
		if (form.lname3.value==""){alert("Please complete all fields");return false}
		if (form.fname3.value==""){alert("Please complete all fields");return false}
		if (form.phone3.value==""){alert("Please complete all fields");return false}
		if (form.email3.value==""){alert("Please complete all fields");return false}
		if (form.addrstA3.value==""){alert("Please complete all fields");return false}
		if (form.addrcity3.value==""){alert("Please complete all fields");return false}
		if (form.addrzip3.value==""){alert("Please complete all fields");return false}
		if (form.addrcountry3.value==""){alert("Please complete all fields");return false}
		if (form.gradyear3.value==""){alert("Please complete all fields");return false}
		
		
		// 4th person	
		if (form.salute4.value=="0"){alert("Please complete all fields");return false}
		if (form.lname4.value==""){alert("Please complete all fields");return false}
		if (form.fname4.value==""){alert("Please complete all fields");return false}
		if (form.phone4.value==""){alert("Please complete all fields");return false}
		if (form.email4.value==""){alert("Please complete all fields");return false}
		if (form.addrstA4.value==""){alert("Please complete all fields");return false}
		if (form.addrcity4.value==""){alert("Please complete all fields");return false}
		if (form.addrzip4.value==""){alert("Please complete all fields");return false}
		if (form.addrcountry4.value==""){alert("Please complete all fields");return false}
		if (form.gradyear4.value==""){alert("Please complete all fields");return false}

		
		if (!form.agree.checked){alert("You have to agree to the rules!");return false}

	
		return true
		}
		
//IPCG Product Inquiries
function IPCGProductForm() {
	

	    var myMessage = ""
	    if (form.name.value.length==0) myMessage += "Name\n";
        if (form.email.value.length==0) myMessage += "Email\n";
		if (form.select.options[0].selected) myMessage += "I am a resident of\n";
		if (form.selectinvest.options[0].selected) myMessage += "How much would you like to invest?\n";
		if (!form.radio_client[0].checked && !form.radio_client[1].checked) myMessage += "Are you a Merrill Client?\n";
		
		if (myMessage.length > 0) {

                        myMessage = myMessage.slice(0, myMessage.length-1);
                        alert("The following fields have not been filled out:\n\n" + myMessage + "\n\nPlease fill out all the required fields.");
                        return false;

            }
         var verify_email = form.email.value
			if ((verify_email.indexOf('@') < 0) || ((verify_email.charAt(verify_email.length-4) != '.') && (verify_email.charAt(verify_email.length-3) != '.')))
				{alert("Please enter a valid email address: you@yourdomain.com");
				form.email.select();
				return false;		
        
         }
		 return true;
		 }




//Login Menu Code Start
function hideLayerQB(whichLayer) {
	if (document.getElementById) {
		// this is the way the standards work
		document.getElementById(whichLayer).style.visibility = "hidden";
	}
	else if (document.all) {
		// this is the way old msie versions work
		document.all[whichlayer].style.visibility = "hidden";		
	}
	else if (document.layers) {
		// this is the way nn4 works
		document.layers[whichLayer].visibility = "hidden";
	}
}

function showLayerQB(whichLayer) {
	if (document.getElementById) {
		// this is the way the standards work
		document.getElementById(whichLayer).style.visibility = "visible";
	}
	else if (document.all) {
		// this is the way old msie versions work
		document.all[whichlayer].style.visibility = "visible";
	}
	else if (document.layers) {
		// this is the way nn4 works
		document.layers[whichLayer].visibility = "visible";
	}
}

function handleClick(whichClick) {
	if (whichClick == "hide it") {
		// then the user wants to hide the layer
		hideLayerQB("boxthing");
	}
	else if (whichClick == "show it") {
		// then the user wants to show the layer
		showLayerQB("boxthing");
	}
	if (whichClick == "hide error") {
		// then the user wants to hide the layer
		hideLayerQB("errorthing");
	}
	else if (whichClick == "show error") {
		// then the user wants to show the layer
		showLayerQB("errorthing");
	}
}
//Login Menu Code End


// Navigation Image Swap Javascript Start
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
// Navigation Image Swap Javascript End


//Simple Show Layer Function
function showLayer(theLayer)
{
	document.getElementById(theLayer).style.display = "block"
}

//Simple Show Layer Function
function hideLayer(theLayer)
{
	document.getElementById(theLayer).style.display = "none"
}

function hideExpandables(){
	document.getElementById('individuals').style.display = 'none';
	if (document.getElementById('smallmidsized')){
		document.getElementById('smallmidsized').style.display = 'none';
	}
	//document.getElementById('smallmidsized').style.display = 'none';
	if (document.getElementById('institutions')){
		document.getElementById('institutions').style.display = 'none';
	}
	//document.getElementById('institutions').style.display = 'none';
	//document.getElementById('financial').style.display = 'none';
}

function removeVspace(){
	document.expandind.vspace= 0;
	if (document.getElementById('expandsmall')){
		document.expandsmall.vspace= 0;
	}
	//document.expandsmall.vspace= 0;
	if (document.getElementById('expandinst')){
		document.expandinst.vspace= 0;
	}
	//document.expandfin.vspace= 0;		
}

function addVspace(){
	turnUpArrows();
	if (document.getElementById('expandind')){
		document.expandind.vspace= 5;
	}
	if (document.getElementById('expandsmall')){
		document.expandsmall.vspace= 5;
	}
	//document.expandsmall.vspace= 5;
	if (document.getElementById('expandinst')){
		document.expandinst.vspace= 5;
	}
	//document.expandfin.vspace= 5;		
}

function turnUpArrows(theImage){
	if (theImage != 'ind') {
		document.expandind.src = "src/expandable_nav_ind_off.gif";
	}
	if (document.getElementById('expandsmall')){
		if (theImage != 'small') {
			document.expandsmall.src = "src/expandable_nav_small_off.gif";
		}
	}
	//document.expandsmall.src = "src/expandable_nav_small_off.gif";
	if (document.getElementById('expandinst')){
		if (theImage != 'inst') {
			document.expandinst.src = "src/expandable_nav_inst_off.gif";
		}
	}
	if (theImage != 'fin') {
		//document.expandfin.src = "src/expandable_nav_fin_off.gif";		
	}
}

function turnDownArrow(theImage){
	eval("document.expand" + theImage + ".src = 'src/expandable_nav_" + theImage + "_on.gif'");
	turnUpArrows(theImage);
}

function expandableMenu(category){

isCurrentBlocked = eval("document.getElementById('" + category + "').style.display");
	if(isCurrentBlocked == "block"){
		isCurrentBlocked = true;
	}
	else{
		isCurrentBlocked = false;
	}
	switch(category)
	{
		case "individuals":
		hideExpandables();
		if(isCurrentBlocked){
			addVspace();
			hideLayer(category);
		}
		else{
			turnDownArrow('ind');			
			removeVspace();
			showLayer(category);			
		}
		break;
		case "smallmidsized":
		hideExpandables();
		if(isCurrentBlocked){
			addVspace();
			hideLayer(category);
		}
		else{
			turnDownArrow('small');			
			removeVspace();

			showLayer(category);
		}				
		break;
		case "institutions":
		hideExpandables();
		if(isCurrentBlocked){
			addVspace();
			hideLayer(category);
		}
		else{
			removeVspace();
			turnDownArrow('inst');			
			showLayer(category);
		}		
		break;
		case "financial":
		hideExpandables();
		if(isCurrentBlocked){
			addVspace();		
			hideLayer(category);
		}
		else{
			removeVspace();
			turnDownArrow('fin');			
			showLayer(category);
		}		
		break;		
	}
}
function expandableMenuMore(cat){
	hideExpandables();
	document.getElementById('individuals').style.display = 'inline';
	document.getElementById('more').style.display="none";
	document.getElementById('mainind').style.overflow="visible";
	document.getElementById('individualscell').style.height = "149px";
	document.expandsmall.src = "src/expandable_nav_small_off.gif";
	//turnUpArrows('small');
}
//~RD Added javascript for the new international site
function expandableMenuInt(category){

isCurrentBlocked = eval("document.getElementById('" + category + "').style.display");
	if(isCurrentBlocked == "inline"){
		isCurrentBlocked = true;
	}
	else{
		isCurrentBlocked = false;
	}
	switch(category)
	{
		case "individuals":
		//hideExpandables();
		if(isCurrentBlocked){
		}
		else{
		}
		break;
		case "smallmidsized":
		hideExpandables();
		if(isCurrentBlocked){
			document.getElementById('smallmidsized').style.display = "inline";
			document.getElementById('individuals').style.display = 'inline';
		}
		else{
			document.getElementById('smallmidsized').style.display = "inline";
			document.getElementById('smallmidsized').style.height = '108px';
			document.getElementById('smallmidsizedcell').style.height = '108px';
			document.getElementById('individuals').style.display = 'inline';
			document.getElementById('individualscell').style.height = "108px";
			document.getElementById('mainind').style.overflow="hidden";
			document.getElementById('more').style.display="inline";
			document.expandsmall.src = "src/expandable_nav_small_on.gif";
		}				
		break;
		case "institutions":
		hideExpandables();
		if(isCurrentBlocked){
			document.getElementById('institutions').style.display = "inline";
			document.getElementById('individuals').style.display = 'inline';
		}
		else{
			document.getElementById('institutions').style.display = "inline";
			document.getElementById('institutions').style.height = '108px';
			document.getElementById('institutionscell').style.height = '108px';
			document.getElementById('individuals').style.display = 'inline';
			document.getElementById('individualscell').style.height = "108px";
			document.getElementById('mainind').style.overflow="hidden";
			document.getElementById('more').style.display="inline";
			document.expandinst.src = "src/expandable_nav_inst_off.gif";
		}		
		break;
		case "financial":
		//hideExpandables();
		if(isCurrentBlocked){
			addVspace();		
			hideLayer(category);
		}
		else{
			removeVspace();
			turnDownArrow('fin');			
			showLayer(category);
		}		
		break;		
	}
}

function togglesite(sName) {

	if (sName == 'US') {
		document.getElementById('USSite').src = '/cms/src/us_site_on.gif'; 
		document.getElementById('IntSite').src = '/cms/src/international_site_off.gif'; 
		document.getElementById('OBInt').style.display = 'none'; 
		document.getElementById('OBDom').style.display = 'inline';
		document.getElementById('smallmidsized').parentElement.parentElement.style.display = 'inline';
	}
	else {
		document.getElementById('USSite').src = '/cms/src/us_site_off.gif'; 
		document.getElementById('IntSite').src = '/cms/src/international_site_on.gif'; 
		document.getElementById('OBInt').style.display = 'inline'; 
		document.getElementById('OBDom').style.display = 'none';
		document.getElementById('smallmidsized').parentElement.parentElement.style.display = 'none';
	}
		
}


/*Esp code drops in here*/
/*rel_tools.js*/
function switchSelecta(onId, offId) {
	document.getElementById(offId).style.display = 'none';
	document.getElementById(onId).style.display = 'inline';
	return true;
}


/*tab_tastic.js*/


//*** This library is copyright 2004 by Gavin Kistner, gavin@refinery.com
//*** It is covered under the license viewable at http://phrogz.net/JS/_ReuseLicense.txt
//*** Reuse or modification is free provided you abide by the terms of that license.
//*** (Including the first two lines above in your source code mostly satisfies the conditions.)

//*** Tabtastic -- see http://phrogz.net/JS/Tabstatic/index.html
//*** Version 1.0    20040430   Initial release.
//***         1.0.2  20040501   IE5Mac, IE6Win compat.
//***         1.0.3  20040501   Removed IE5Mac/Opera7 compat. (see http://phrogz.net/JS/Tabstatic/index.html#notes)
//***         1.0.4  20040521   Added scroll-back hack to prevent scrolling down to page anchor. Then commented out :)
/* SCRIPT TO CHANGE ROW COLORS ON MARKET INDICES */
var prevRow = null;  

function checkHash() {
	if(location.hash) {
		var sEl = document.getElementById("tr" + location.hash.substr(1));
		prevRow = sEl;
		for(i=sEl.firstChild; i; i=i.nextSibling) { 
			if(i.nodeType == 1) i.style.backgroundColor = "#EFE7CF";  
			if(i.className == "Symbolsm") i.className = "SymHiLite";
		}
	} else {
		//prevRow = document.getElementById("trDJIA");
		//prevRow.style.backgroundColor = "#EFE7CF";  
		for(i=prevRow.firstChild; i; i=i.nextSibling) { 
			if(i.nodeType == 1) i.style.backgroundColor = "#EFE7CF";  
			if(i.className == "Symbolsm") i.className = "SymHiLite";
		}
	}
}

function highlightRow(elName) { 
	//reset prevRow's color
	if(prevRow) {
		for(i=prevRow.firstChild; i; i=i.nextSibling) { 
			if(i.nodeType == 1) i.style.backgroundColor = "";  
			if(i.className == "SymHiLite") i.className = "Symbolsm";
		}
	}

	//highlight new row
	var e = document.getElementById(elName);
	for(i=e.firstChild; i; i=i.nextSibling) { 
		if(i.nodeType == 1) i.style.backgroundColor = "#EFE7CF";
		if(i.className == "Symbolsm") i.className = "SymHiLite";
	}
	prevRow = e;
}

/* END SCRIPT TO CHANGE ROW COLORS ON MARKET INDICES */
AttachEvent(window,'load',function(){
	var tocTag='ul',tocClass='tabset_tabs',tabTag='a',contentClass='tabset_content';


	function FindEl(tagName,evt){
		if (!evt && window.event) evt=event;
		if (!evt) return DebugOut("Can't find an event to handle in DLTabSet::SetTab",0);
		var el=evt.currentTarget || evt.srcElement;
		while (el && (!el.tagName || el.tagName.toLowerCase()!=tagName)) el=el.parentNode;
		return el;
	}

	function SetTabActive(tab){
		if (tab.tabTOC.activeTab){
			if (tab.tabTOC.activeTab==tab) return;
			KillClass(tab.tabTOC.activeTab,'active');
			if (tab.tabTOC.activeTab.tabContent) KillClass(tab.tabTOC.activeTab.tabContent,'tabset_content_active');
			//if (tab.tabTOC.activeTab.tabContent) tab.tabTOC.activeTab.tabContent.style.display='';
			if (tab.tabTOC.activeTab.prevTab) KillClass(tab.tabTOC.activeTab.previousTab,'preActive');
			if (tab.tabTOC.activeTab.nextTab) KillClass(tab.tabTOC.activeTab.nextTab,'postActive');
		}
		AddClass(tab.tabTOC.activeTab=tab,'active');
		if (tab.tabContent) AddClass(tab.tabContent,'tabset_content_active');				
		//if (tab.tabContent) tab.tabContent.style.display='block';
		if (tab.prevTab) AddClass(tab.prevTab,'preActive');
		if (tab.nextTab) AddClass(tab.nextTab,'postActive');
	}
	function SetTabFromAnchor(evt){
		//setTimeout('document.body.scrollTop='+document.body.scrollTop,1);
		SetTabActive(FindEl('a',evt).semanticTab);
	}

	
	function Init(){
		window.everyTabThereIsById = {};
		
		var anchorMatch = /#([a-z][\w.:-]*)$/i,match;
		var activeTabs = [];
		
		var tocs = document.getElementsByTagName(tocTag);
		for (var i=0,len=tocs.length;i<len;i++){
			var toc = tocs[i];
			if (!HasClass(toc,tocClass)) continue;

			var lastTab;
			var tabs = toc.getElementsByTagName(tabTag);
			for (var j=0,len2=tabs.length;j<len2;j++){
				var tab = tabs[j];
				if (!tab.href || !(match=anchorMatch.exec(tab.href))) continue;
				if (lastTab){
					tab.prevTab=lastTab;
					lastTab.nextTab=tab;
				}
				tab.tabTOC=toc;
				everyTabThereIsById[tab.tabID=match[1]]=tab;
				tab.tabContent = document.getElementById(tab.tabID);
				
				if (HasClass(tab,'active')) activeTabs[activeTabs.length]=tab;
				
				lastTab=tab;
			}
			AddClass(toc.getElementsByTagName('li')[0],'firstchild');
		}

		for (var i=0,len=activeTabs.length;i<len;i++){
			SetTabActive(activeTabs[i]);
		}

		for (var i=0,len=document.links.length;i<len;i++){
			var a = document.links[i];
			if (!(match=anchorMatch.exec(a.href))) continue;
			if (a.semanticTab = everyTabThereIsById[match[1]]) AttachEvent(a,'click',SetTabFromAnchor,false);
		}
		
		if ((match=anchorMatch.exec(location.href)) && (a=everyTabThereIsById[match[1]])) SetTabActive(a);
		
		//Comment out the next line and include the file directly if you need IE5Mac or Opera7 support.
		//AddStyleSheet('tab_tabtastic.css',0);
	}
	Init();
},false);

//*** This code is copyright 2003 by Gavin Kistner, gavin@refinery.com
//*** It is covered under the license viewable at http://phrogz.net/JS/_ReuseLicense.txt
//*** Reuse or modification is free provided you abide by the terms of that license.
//*** (Including the first two lines above in your source code satisfies the conditions.)


//***Cross browser attach event function. For 'evt' pass a string value with the leading "on" omitted
//***e.g. AttachEvent(window,'load',MyFunctionNameWithoutParenthesis,false);

function AttachEvent(obj,evt,fnc,useCapture){
	if (!useCapture) useCapture=false;
	if (obj.addEventListener){
		obj.addEventListener(evt,fnc,useCapture);
		return true;
	} else if (obj.attachEvent) return obj.attachEvent("on"+evt,fnc);
	else{
		MyAttachEvent(obj,evt,fnc);
		obj['on'+evt]=function(){ MyFireEvent(obj,evt) };
	}
} 

//The following are for browsers like NS4 or IE5Mac which don't support either
//attachEvent or addEventListener
function MyAttachEvent(obj,evt,fnc){
	if (!obj.myEvents) obj.myEvents={};
	if (!obj.myEvents[evt]) obj.myEvents[evt]=[];
	var evts = obj.myEvents[evt];
	evts[evts.length]=fnc;
}
function MyFireEvent(obj,evt){
	if (!obj || !obj.myEvents || !obj.myEvents[evt]) return;
	var evts = obj.myEvents[evt];
	for (var i=0,len=evts.length;i<len;i++) evts[i]();
}
//*** This code is copyright 2002-2003 by Gavin Kistner, gavin@refinery.com
//*** It is covered under the license viewable at http://phrogz.net/JS/_ReuseLicense.txt
//*** Reuse or modification is free provided you abide by the terms of that license.
//*** (Including the first two lines above in your source code satisfies the conditions.)

// Add a new stylesheet to the document;
// url [optional] A url to an external stylesheet to use
// idx [optional] The index in document.styleSheets to insert the new sheet before
function AddStyleSheet(url,idx){
	var css,before=null,head=document.getElementsByTagName("head")[0];

	if (document.createElement){
		if (url){
			css = document.createElement('link');
			css.rel  = 'stylesheet';
			css.href = url;
		} else css = document.createElement('style');
		css.media = 'all';
		css.type  = 'text/css';

		if (idx>=0){
			for (var i=0,ct=0,len=head.childNodes.length;i<len;i++){
				var el = head.childNodes[i];
				if (!el.tagName) continue;
				var tagName = el.tagName.toLowerCase();
				if (ct==idx){
					before = el;
					break;
				}
				if (tagName=='style' || tagName=='link' && (el.rel && el.rel.toLowerCase()=='stylesheet' || el.type && el.type.toLowerCase()=='text/css') ) ct++;
			}
		}
		head.insertBefore(css,before);

		return document.styleSheets[before?idx:document.styleSheets.length-1];
	} else return alert("I can't create a new stylesheet for you. Sorry.");
}
// e.g. var newBlankSheetAfterAllOthers = AddStyleSheet(); 
// e.g. var newBlankSheetBeforeAllOthers = AddStyleSheet(null,0);
// e.g. var externalSheetAfterOthers = AddStyleSheet('http://phrogz.net/JS/Classes/docs.css');
// e.g. var externalSheetBeforeOthers = AddStyleSheet('http://phrogz.net/JS/Classes/docs.css',0);


// Cross-browser method for inserting a new rule into an existing stylesheet.
// ss       - The stylesheet to stick the new rule in
// selector - The string value to use for the rule selector
// styles   - The string styles to use with the rule
function AddRule(ss,selector,styles){
	if (!ss) return false;
	if (ss.insertRule) return ss.insertRule(selector+' {'+styles+'}',ss.cssRules.length);
	if (ss.addRule){
		ss.addRule(selector,styles);
		return true;
	}
	return false;
}

// e.g. AddRule( document.styleSheets[0] , 'a:link' , 'color:blue; text-decoration:underline' );
// e.g. AddRule( AddStyleSheet() , 'hr' , 'display:none' );
//*** This code is copyright 2002-2003 by Gavin Kistner and Refinery; www.refinery.com
//*** It is covered under the license viewable at http://phrogz.net/JS/_ReuseLicense.txt
//*** Reuse or modification is free provided you abide by the terms of that license.
//*** (Including the first two lines above in your source code satisfies the conditions.)

//***Adds a new class to an object, preserving existing classes
function AddClass(obj,cName){ KillClass(obj,cName); return obj && (obj.className+=(obj.className.length>0?' ':'')+cName); }

//***Removes a particular class from an object, preserving other existing classes.
function KillClass(obj,cName){ return obj && (obj.className=obj.className.replace(new RegExp("^"+cName+"\\b\\s*|\\s*\\b"+cName+"\\b",'g'),'')); }

//***Returns true if the object has the class assigned, false otherwise.
function HasClass(obj,cName){ return (!obj || !obj.className)?false:(new RegExp("\\b"+cName+"\\b")).test(obj.className) }



function expandnavover(sId, sImg, sOver, sShort) {

	var oElement = document.getElementById(sId);
	var oCell = document.getElementById(sId + 'cell');
	var oImage = document.getElementById(sImg);
	
	if (oElement.style.display == 'none') {
		oCell.style.backgroundColor = sOver
		oImage.src = 'src/expandable_nav_' + sShort + '_over.gif';
		
	}
}

function expandnavout(sId, sImg, sOut, sShort) {

	var oElement = document.getElementById(sId);
	var oCell = document.getElementById(sId + 'cell');
	var oImage = document.getElementById(sImg);
	
	if (oElement.style.display == 'none') {
		oCell.style.backgroundColor = sOut
		oImage.src = 'src/expandable_nav_' + sShort + '_off.gif';
		
	}
}

//
// JavaScript Browser Sniffer
// Eric Krok, Andy King, Michel Plungjan Jan. 31, 2002
// see http://www.webreference.com/ for more information
//
//
 
// convert all characters to lowercase to simplify testing
var agt=navigator.userAgent.toLowerCase();
var appVer = navigator.appVersion.toLowerCase();

// *** BROWSER VERSION ***

var is_minor = parseFloat(appVer);
var is_major = parseInt(is_minor);

var is_opera = (agt.indexOf("opera") != -1);
var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
var is_opera6 = (agt.indexOf("opera 6") != -1 || agt.indexOf("opera/6") != -1); // new 020128- abk
var is_opera7 = (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1); // new 021205- dmr
var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);
var is_opera6up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5); // new020128
var is_opera7up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4 && !is_opera5 && !is_opera6); // new021205 -- dmr

// Note: On IE, start of appVersion return 3 or 4
// which supposedly is the version of Netscape it is compatible with.
// So we look for the real version further on in the string
// And on Mac IE5+, we look for is_minor in the ua; since 
// it appears to be more accurate than appVersion - 06/17/2004

var is_mac = (agt.indexOf("mac")!=-1);
var iePos  = appVer.indexOf('msie');
if (iePos !=-1) {
if(is_mac) {
var iePos = agt.indexOf('msie');
is_minor = parseFloat(agt.substring(iePos+5,agt.indexOf(';',iePos)));
}
else is_minor = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));
is_major = parseInt(is_minor);
}

// ditto Konqueror
                            
var is_konq = false;
var kqPos   = agt.indexOf('konqueror');
if (kqPos !=-1) {                 
is_konq  = true;
is_minor = parseFloat(agt.substring(kqPos+10,agt.indexOf(';',kqPos)));
is_major = parseInt(is_minor);
}                                 

var is_getElementById   = (document.getElementById) ? "true" : "false"; // 001121-abk
var is_getElementsByTagName = (document.getElementsByTagName) ? "true" : "false"; // 001127-abk
var is_documentElement = (document.documentElement) ? "true" : "false"; // 001121-abk

var is_safari = ((agt.indexOf('safari')!=-1)&&(agt.indexOf('mac')!=-1))?true:false;
var is_khtml  = (is_safari || is_konq);

var is_gecko = ((!is_khtml)&&(navigator.product)&&(navigator.product.toLowerCase()=="gecko"))?true:false;
var is_gver  = 0;
if (is_gecko) is_gver=navigator.productSub;

var is_moz   = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&
        (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1)  &&
        (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)     &&
        (is_gecko) && 
        ((navigator.vendor=="")||(navigator.vendor=="Mozilla")||(navigator.vendor=="Debian")));
var is_fb = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&
        (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1)  &&
        (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)     &&
        (is_gecko) && (navigator.vendor=="Firebird"));
var is_fx = ((agt.indexOf('mozilla/5')!=-1) && (agt.indexOf('spoofer')==-1) &&
        (agt.indexOf('compatible')==-1) && (agt.indexOf('opera')==-1)  &&
        (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)     &&
        (is_gecko) && (navigator.vendor=="Firefox"));
if ((is_moz)||(is_fb)||(is_fx)) {  // 032504 - dmr
var is_moz_ver = (navigator.vendorSub)?navigator.vendorSub:0;
if(!(is_moz_ver)) {
is_moz_ver = agt.indexOf('rv:');
is_moz_ver = agt.substring(is_moz_ver+3);
is_paren   = is_moz_ver.indexOf(')');
is_moz_ver = is_moz_ver.substring(0,is_paren);
}
is_minor = is_moz_ver;
is_major = parseInt(is_moz_ver);
}
var is_fb_ver = is_moz_ver;
var is_fx_ver = is_moz_ver;

var 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)
    && (!is_khtml) && (!(is_moz)) && (!is_fb) && (!is_fx));

// Netscape6 is mozilla/5 + Netscape6/6.0!!!
// Mozilla/5.0 (Windows; U; Win98; en-US; m18) Gecko/20001108 Netscape6/6.0
// Changed this to use navigator.vendor/vendorSub - dmr 060502   
// var nav6Pos = agt.indexOf('netscape6');
// if (nav6Pos !=-1) {
if ((navigator.vendor)&&
((navigator.vendor=="Netscape6")||(navigator.vendor=="Netscape"))&&
(is_nav)) {
is_major = parseInt(navigator.vendorSub);
// here we need is_minor as a valid float for testing. We'll
// revert to the actual content before printing the result. 
is_minor = parseFloat(navigator.vendorSub);
}

var is_nav2 = (is_nav && (is_major == 2));
var is_nav3 = (is_nav && (is_major == 3));
var is_nav4 = (is_nav && (is_major == 4));
var is_nav4up = (is_nav && is_minor >= 4);  // changed to is_minor for
                                    // consistency - dmr, 011001
var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                (agt.indexOf("; nav") != -1)) );

var is_nav6   = (is_nav && is_major==6);    // new 010118 mhp
var is_nav6up = (is_nav && is_minor >= 6); // new 010118 mhp

var is_nav5   = (is_nav && is_major == 5 && !is_nav6); // checked for ns6
var is_nav5up = (is_nav && is_minor >= 5);

var is_nav7   = (is_nav && is_major == 7);
var is_nav7up = (is_nav && is_minor >= 7);

var is_ie   = ((iePos!=-1) && (!is_opera) && (!is_khtml));
var is_ie3  = (is_ie && (is_major < 4));

var is_ie4   = (is_ie && is_major == 4);
var is_ie4up = (is_ie && is_minor >= 4);
var is_ie5   = (is_ie && is_major == 5);
var is_ie5up = (is_ie && is_minor >= 5);

var is_ie5_5  = (is_ie && (agt.indexOf("msie 5.5") !=-1)); // 020128 new - abk
var is_ie5_5up =(is_ie && is_minor >= 5.5);                // 020128 new - abk

var is_ie6   = (is_ie && is_major == 6);
var is_ie6up = (is_ie && is_minor >= 6);

// 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.

var is_aol   = (agt.indexOf("aol") != -1);
var is_aol3  = (is_aol && is_ie3);
var is_aol4  = (is_aol && is_ie4);
var is_aol5  = (agt.indexOf("aol 5") != -1);
var is_aol6  = (agt.indexOf("aol 6") != -1);
var is_aol7  = ((agt.indexOf("aol 7")!=-1) || (agt.indexOf("aol7")!=-1));
var is_aol8  = ((agt.indexOf("aol 8")!=-1) || (agt.indexOf("aol8")!=-1));

var is_webtv = (agt.indexOf("webtv") != -1);

// new 020128 - abk

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

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

// end new

// *** JAVASCRIPT VERSION CHECK ***
// Useful to workaround Nav3 bug in which Nav3
// loads <SCRIPT LANGUAGE="JavaScript1.2">.
// updated 020131 by dragle
var is_js;
if (is_nav2 || is_ie3) is_js = 1.0;
else if (is_nav3) is_js = 1.1;
else if ((is_opera5)||(is_opera6)) is_js = 1.3; // 020214 - dmr
else if (is_opera7up) is_js = 1.5; // 031010 - dmr
else if (is_khtml) is_js = 1.5;   // 030110 - dmr
else if (is_opera) is_js = 1.1;
else if ((is_nav4 && (is_minor <= 4.05)) || is_ie4) is_js = 1.2;
else if ((is_nav4 && (is_minor > 4.05)) || is_ie5) is_js = 1.3;
else if (is_nav5 && !(is_nav6)) is_js = 1.4;
else if (is_hotjava3up) is_js = 1.4; // new 020128 - abk
else if (is_nav6up) 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 (is_nav && (is_major > 5)) is_js = 1.4;
else if (is_ie && (is_major > 5)) is_js = 1.3;
else if (is_moz) is_js = 1.5;
else if (is_fb||is_fx) is_js = 1.5; // 032504 - dmr

// what about ie6 and ie6up for js version? abk

// HACK: no idea for other browsers; always check for JS version 
// with > or >=
else is_js = 0.0;
// HACK FOR IE5 MAC = js vers = 1.4 (if put inside if/else jumps out at 1.3)
if ((agt.indexOf("mac")!=-1) && is_ie5up) is_js = 1.4; // 020128 - abk

// Done with is_minor testing; revert to real for N6/7
if (is_nav6up) {
is_minor = navigator.vendorSub;
}

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

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

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

var is_winme = ((agt.indexOf("win 9x 4.90")!=-1));    // new 020128 - abk
var is_win2k = ((agt.indexOf("windows nt 5.0")!=-1) || (agt.indexOf("windows 2000")!=-1)); // 020214 - dmr
var is_winxp = ((agt.indexOf("windows nt 5.1")!=-1) || (agt.indexOf("windows xp")!=-1)); // 020214 - dmr

// 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".
var is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
var is_winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
var is_win32 = (is_win95 || is_winnt || is_win98 ||
        ((is_major >= 4) && (navigator.platform == "Win32")) ||
        (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));

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

var is_mac    = (agt.indexOf("mac")!=-1);
if (is_mac) { is_win = !is_mac; } // dmr - 06/20/2002
var is_mac68k = (is_mac && ((agt.indexOf("68k")!=-1) ||
                    (agt.indexOf("68000")!=-1)));
var is_macppc = (is_mac && ((agt.indexOf("ppc")!=-1) ||
                    (agt.indexOf("powerpc")!=-1)));

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

var is_vms   = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));
// additional checks, abk
var is_anchors = (document.anchors) ? "true":"false";
var is_regexp = (window.RegExp) ? "true":"false";
var is_option = (window.Option) ? "true":"false";
var is_all = (document.all) ? "true":"false";
// cookies - 990624 - abk
document.cookie = "cookies=true";
var is_cookie = (document.cookie) ? "true" : "false";
var is_images = (document.images) ? "true":"false";
var is_layers = (document.layers) ? "true":"false"; // gecko m7 bug?
// new doc obj tests 990624-abk
var is_forms = (document.forms) ? "true" : "false";
var is_links = (document.links) ? "true" : "false";
var is_frames = (window.frames) ? "true" : "false";
var is_screen = (window.screen) ? "true" : "false";

// java
var is_java = (navigator.javaEnabled());

// Flash checking code adapted from Doc JavaScript information; 
// see http://webref.com/js/column84/2.html

var is_Flash        = false;
var is_FlashVersion = 0;

if ((is_nav||is_opera||is_moz||is_fb||is_fx)||
(is_mac&&is_ie5up)) {
var plugin = (navigator.mimeTypes && 
        navigator.mimeTypes["application/x-shockwave-flash"] &&
        navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) ?
        navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
//      if (plugin) {
if (plugin&&plugin.description) {
is_Flash = true;
is_FlashVersion = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1));
}
}

if (is_win&&is_ie4up)
{
document.write(
'<scr' + 'ipt language=VBScript>' + '\n' +
'Dim hasPlayer, playerversion' + '\n' +
'hasPlayer = false' + '\n' +
'playerversion = 10' + '\n' +
'Do While playerversion > 0' + '\n' +
'On Error Resume Next' + '\n' +
'hasPlayer = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & playerversion)))' + '\n' +
'If hasPlayer = true Then Exit Do' + '\n' +
'playerversion = playerversion - 1' + '\n' +
'Loop' + '\n' +
'is_FlashVersion = playerversion' + '\n' +
'is_Flash = hasPlayer' + '\n' +
'<\/sc' + 'ript>'
);
}
   
//Redirect IE and NS older to upload page
if ((is_nav2||is_nav3||is_nav4||is_nav5||is_ie3||is_ie4) && !is_linkobj) {
	// exception for available AOL for MAC or available AOL for PC (which both tested ok)
	if (!is_aol||!is_mac)
	{
		incompCheckSeen=GetCookie("incompCheckSeen")
		incompSeen=GetCookie("incompSeen")
		if (incompSeen!="1"&&incompCheckSeen!="1")
			{document.location.href="/badBrowser.asp?url=" + document.location.href;}
	}
	
	
}


// flash object creation
function makeFlash() {
    var strObj = '';
    var splitter;
    var paramTags = '';
    var embedCounterParts = '';
    var questionMark = '';
    
    if(flashvars.length > 0)
        questionMark = '?';
        
    if(extraParams) {
        var eParams = extraParams.indexOf(",") > -1 ? extraParams.split(",") : extraParams.split("=");
        if(extraParams.indexOf(",") > -1) {
            for(var i=0; i < eParams.length; i++) {
                splitter = eParams[i].split("=");
                paramTags += '<param name="' + splitter[0] + '" value="' + splitter[1] + '" /> ';
                embedCounterParts += ' ' + splitter[0] + '="' + splitter[1] + '" ';
            }
        }
        else {
            if(navigator.vendor=="Firefox") {
                paramTags += '<param name="bgcolor" value="#ffffff" /> ';
                embedCounterParts += ' ';
            }
            else {
                paramTags += ' ';
                embedCounterParts += ' bgcolor="#ffffff"';
            }
            paramTags += '<param name="' + eParams[0] + '" value="' + eParams[1] + '" /> ';
            embedCounterParts += ' ' + eParams[0] + '="' + eParams[1] + '" ';
        }
    }
    
    strObj = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + version + '" width="' + width + '" height="' + height + '"';
    strObj += objectExtraParams + '>';
    
    if(paramTags.length > 0)
        strObj += paramTags;
    
    strObj += '<param name="movie" value="' + movie + questionMark + flashvars + '" /><param name="quality" value="' + quality + '" />';
    
    strObj += '<embed ';
    if(embedCounterParts.length > 0)
        strObj += embedCounterParts;
    
    strObj += embedExtraParams + 'src="' + movie + questionMark + flashvars + '" quality="' + quality + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed></object>';
    
    document.write(strObj);
}
