sfHover = function() {
	var sfEls = document.getElementById("navList").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function buildMenu(strActivePages)
{
	objMenu=document.getElementById('navList');
	
	//Home
	objMenu.appendChild(listItemLink("", "home.html", "Home", strActivePages));
	
	//About CTY
	objAboutCTY = listItemLink("", "overview-flash.html", "Connect-CTY", strActivePages);
	objUL = document.createElement("ul");
	//
	objUL.appendChild(listItemLink("","overview-flash.html#","Overview Flash Demo", strActivePages));
	//
	objUL.appendChild(listItemLink("","how-it-works.html","How it Works", strActivePages));
	//
	objUL.appendChild(listItemLink("","data-integration.html","Data Integration", strActivePages));
	objUL.appendChild(listItemLink("","autodialers.html","Dialer vs. ASP", strActivePages));
	objUL.appendChild(listItemLink("","client-care.html","Client Care", strActivePages));
	//
	objFAQs = listItemLink("","faqs.html","FAQ's", strActivePages);
	objUL3 = document.createElement("ul");
	objUL3.appendChild(listItemLink("","pdf/CTY_FAQ_L.pdf","FAQ's PDF", strActivePages));
	objFAQs.appendChild(objUL3);
	objUL.appendChild(objFAQs);
	//
	objAboutCTY.appendChild(objUL);
	objMenu.appendChild(objAboutCTY);
	
	//Partnerships
	objMenu.appendChild(listItemLink("", "partnerships.html", "Partnerships", strActivePages));
	
	//Testimonials
	objUL = null;
	objUL2 = null;
	objUL3 = null;
	objTestimonials = listItemLink("", "testimonials.html", "Testimonials", strActivePages);
	objUL = document.createElement("ul");
	objCaseStudies = listItemLink("", "#", "Case Studies", strActivePages);
	objUL2 = document.createElement("ul");
	objUL2.appendChild(listItemLink("", "pdf/CTY_CS_BarringtonHills.pdf", "Barrington Hills Case Study PDF", strActivePages));
	objUL2.appendChild(listItemLink("", "pdf/CTY_CS_StJames_L.pdf", "St. James Case Study PDF", strActivePages));
	objUL2.appendChild(listItemLink("", "pdf/CTY_St_Charles_Case_Study.pdf", "Hurricane Katrina Report PDF", strActivePages));
	objUL2.appendChild(listItemLink("", "pdf/CTY_CS-Somerville_L.pdf", "Somerville Case Study PDF", strActivePages));
	objCaseStudies.appendChild(objUL2);
	objUL.appendChild(objCaseStudies);
	objTestimonials.appendChild(objUL);
	objMenu.appendChild(objTestimonials);
	objUL = null;
	objUL2 = null;	
	
	//try-now
	objMenu.appendChild(listItemLink("", "try-now.asp", "Try Now", strActivePages));

	
	//About NTI
	objAboutNTI = listItemLink("", "http://www.blackboardconnect.com/about/overview.asp", "About Us", strActivePages);
	objUL = document.createElement("ul");
	objUL.appendChild(listItemLink("", "http://www.blackboardconnect.com/about/pressRoom.asp", "Press Center", strActivePages));
	objUL.appendChild(listItemLink("", "http://www.blackboardconnect.com/about/employment.asp", "Employment", strActivePages));
	objUL.appendChild(listItemLink("", "http://www.blackboardconnect.com/about/team.asp", "About The Team", strActivePages));
	objAboutNTI.appendChild(objUL);
	objMenu.appendChild(objAboutNTI);
	objUL = null;
	
	//Contact Us
	objMenu.appendChild(listItemLink("", "contact-us.asp", "Contact Us", strActivePages));
	
	//prompt('', objMenu.innerHTML);
	
	

}

function listItemLink(strClass, strURL, strLinkDisplay, strActivePages)
{
	objListItem = document.createElement("li");
	//see if the current URL is contained in strActivePages and add the active CSS class if it is
	//alert(strURL + "\n" + strActivePages + "\n" + strActivePages.indexOf(strURL));
	if(strActivePages.indexOf(strURL)>-1)
	{
		//strClass += " nav_active";
		if(strLinkDisplay=="Connect-CTY")
		{
			objListItem.setAttribute("id" , "ntiThing_active");
		}
		else
		{
			objListItem.setAttribute("id" , "nav_active");
		}
	}
	else
	{
		if(strLinkDisplay=="Connect-CTY")
		{
			objListItem.setAttribute('id', 'ntiThing');
		}
	}
	if(strClass.length>0)
	{
		objListItem.setAttribute("class" , strClass);
	}
	
	objLink = document.createElement("a");
	objLink.setAttribute("href", strURL);
	
	//open new window for off-site links
	if(strURL.indexOf("http://") > -1)
	{
			objLink.setAttribute("target" , "_new");
	}

	if(strLinkDisplay=="Connect-CTY")
	{
		objLink.innerHTML = "About <span class='connect_cty_left'>Connect</span><span class='connect_cty_right'>-CTY</span>";
	}
	else
	{
		objTextNode = document.createTextNode(strLinkDisplay);
		objLink.appendChild(objTextNode);
	}
	
	
	objListItem.appendChild(objLink);
	
	return objListItem;
	
}





function makePullquote()
{
	var spans = document.getElementsByTagName('span');
	for (i = 0;  i < spans.length;  i++) 
	{	
		if(spans[i].className == "pullme")  
		{
			var pullquote = document.createElement('blockquote');
			pullquote.innerHTML = spans[i].innerHTML;  
			spans[i].parentNode.insertBefore(pullquote,null);
			spans[i].innerHTML="";
		}	
	}
}

function openPrivacy()
{
	openWin("http://www.blackboardconnect.com/about/privacy.asp", "NTIPrivacy", "", 600, 400); 

}

function openTOS()
{
	openWin("http://www.blackboardconnect.com/about/termsofuse.asp", "NTITOS", "", 600, 400); 
}

function openWin(inURL, inName, inFeatures, inWidth, inHeight)
{
	var strURL = "";
	var strFeatures = "";
	var intWidth = 0;
	var intHeight = 0;
	var intLeft = 0;
	var intTop = 0;
	var strName = "";
	
	if (inURL == null)
		return;
	
	strURL = "" + inURL;
	if (inName != null)
		strName = "" + inName;
	
	if (inFeatures != null)
		strFeatures = "" + inFeatures;
	
	if (inWidth != null)
		if (!isNaN(parseInt(inWidth, 10)))
			intWidth = parseInt(inWidth, 10);
	
	if (inHeight != null)
		if (!isNaN(parseInt(inHeight, 10)))
			intHeight = parseInt(inHeight, 10);
	
	if (intWidth == 0)
		intWidth = 500;		// Default
		
	if (intHeight == 0)
		intHeight = 400;	// Default
	
	strFeatures = strFeatures.toLowerCase();
	
	if (strFeatures.indexOf("scrollbars") == -1)
	{
		if (strFeatures.length > 0)
			strFeatures = strFeatures + ",";
		strFeatures = strFeatures + "scrollbars=1";
	}//end if
	if (strFeatures.indexOf("resizable") == -1)
	{
		if (strFeatures.length > 0)
			strFeatures = strFeatures + ",";
		strFeatures = strFeatures + "resizable=1";
	}//end if
	
	if (window.screen != null)
	{
		intLeft = (window.screen.width / 2) - (intWidth / 2);
		intTop = (window.screen.height / 2) - (intHeight / 2);
	
	}//end if
	
	strFeatures = "width=" + intWidth + ",height=" + intHeight + "," + strFeatures;
	strFeatures = strFeatures + ",left=" + intLeft + ",top=" + intTop;
	
	return window.open(strURL, strName, strFeatures);
	
}

