<!--Hide from incompatible browsers
//----------------------------------------------
//-- Code to display Co-branding images
//-- This Script must be placed at the bottom of the HTML page it will be used on between the </BODY> and </HTML> tags.
//-- Author:	Mike Kliegl
//-- Created:	10/19/2000
//-- Modified:	10/20/2000
//----------------------------------------------

//-- DATA  -------------------------------------
//-- 2-Dim array of co-branding domains (domain name/identifier, image name)
	var ImageList = new Array();
	    ImageList[0] = new Array("cnbc", "cnbcCobranda.jpg", "cnbcCobrandb.jpg");
	    ImageList[1] = new Array("insure", "insureCobranda.gif", "insureCobrandb.gif");
	var IMG_WIDTH = 257;
	var IMG_HEIGHT = 62;
	var IMG_PLACEHOLDER_ID 	= "cobranda";
	var IMG_PLACEHOLDER_ID2 = "cobrandb";
//----------------------------------------------

//----------------------------------------------
//-- Main function to check to see if the referrer was a co-branding site. If so, display the image.
//-- Parameters:
//-- sCobrand - string identifying the name of the image to change
//-- width - width of new image
//-- height - height of new image
//----------------------------------------------

function setCobrand()
{

	var referrer;
	var imLocationArray;


	//-- Get the URL of the referring site
	referrer = document.referrer;

	if ((referrer != ""))
	{
		//-- Retrieve Location of Co-brand image
		imLocationArray = referrerLookup(referrer);

		if (imLocationArray != 0)
		{
			if (document.cobranda != null)
			{
				document.cobranda.src = imLocationArray[1];
				document.cobrandb.src = imLocationArray[2];
			}
		}
	}
}

//------------------------------------------------
//-- Function to look through the current cookies. Returns a string of the
//-- value of the specified cookie if it exists; null if not.
//-- Parameter:
//-- sName - Name of the cookie to search for
//------------------------------------------------

function __getCookie(sName)
{
	var sCookie 	= document.cookie;
	var prefix 	= sName + "=";
	var begin 	= sCookie.indexOf("; " + prefix);

	if(begin == -1)
	{
		begin = sCookie.indexOf(prefix);
		if(begin != 0) return null;
	}
	else
		begin += 2;
	var end = sCookie.indexOf(";", begin);
	if(end == -1)
		end = sCookie.length;
	return unescape(sCookie.substring(begin + prefix.length, end));
}

//------------------------------------------------
//-- Extracts the domain information from a URL
//------------------------------------------------

function getDomainInfo(sURL)
{
	var start = sURL.indexOf("http://") + 7;
	var end = sURL.indexOf("/", start);
	var sDomain = sURL.substring(start, end);
	return sDomain;
}

//------------------------------------------------
//-- Lookup the referring domain name in the array and return a path
//-- to the image location
//------------------------------------------------

function referrerLookup(sURL)
{
	var sName = new Array();

	if ((sURL != "") || (sURL != null))
	{
		sURL = getDomainInfo(sURL);

		for(var i=0; i<ImageList.length; i++)
		{
			if(sURL.indexOf(ImageList[i][0]) != -1)
			{
				sName[1] = "/images/" + ImageList[i][1];
				sName[2] = "/images/" + ImageList[i][2];
				return sName;
			}
		}
		return 0;
	}
	else
		return 0;
}


//--Execute Co-branding Script
//window.onload = setCobrand;
//window.onresize = setCobrand;
setCobrand();

// -->