//variables used to center pop-up windows


var Page_Arr = new Array(); 
//var Page_Location = location.href; 
var Page_Location = window.location.pathname;
var headerID;
Page_Arr = Page_Location.split("/"); 
var sitePageName = Page_Arr[(Page_Arr.length)-1]; 
sitePageName = sitePageName.toLowerCase();

//if(sitePageName.indexOf("#")>0)
//{
//sitePageName = sitePageName.replace("#","");
//}
var width = screen.width;
var height = screen.height;
var popUpWidth = 0;
var popUpHeight = 0;
var positionTop = 0;
var positionLeft = 0;




function openWindow(pageURL,windowName,pWidth,pHeight,pResize,pScrollbars) {
  positionTop = ((height/2) - (pHeight/2));
  positionLeft = ((width/2) - (pWidth/2));
  popup=window.open(pageURL,windowName, config='width=' + pWidth + ',height=' + pHeight + ',left=' + positionLeft + ',top=' + positionTop + ',resizable=' + pResize + ',menubar=0,location=0,directories=1,toolbar=0,scrollbars=' + pScrollbars + ',status=0'); 
	popup.focus();
}


function queryString(val){
	var q  = unescape(location.search.substr(1)).split('&');

	for(var i=0; i<q.length; i++) {
		var t=q[i].split('=');
		if (t[0].toLowerCase()==val.toLowerCase()) return t[1];
	}
	return '';
}


/*===================================
--end window popup function
=====================================*/

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

function readUserTextPreference() {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
}

function storeUserTextPreference() {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);

function displayTextZoom() {
	document.writeln("TEXT ZOOM <span style=\"letter-spacing:-0.5px;\"><a href=\"javascript:void(0);\" onclick=\"setActiveStyleSheet('Small Text', 1); return false;\" title=\"Switch to Small Text Size\" id=\"text-small\">A</a> <a href=\"javascript:void(0);\" onclick=\"setActiveStyleSheet('Medium Text', 1); return false;\" title=\"Switch to Medium Text Size\" id=\"text-medium\"><span style=\"font-size:13px;\">A</span></a> <a href=\"javascript:void(0);\" onclick=\"setActiveStyleSheet('Large Text', 1); return false;\" title=\"Switch to Large Text Size\" id=\"text-large\"><span style=\"font-size:15px;\">A</span></a></span>");
}

function printerFriendlyPage(siteStyle)
{ 
  var display_setting="toolbar=yes,location=no,directories=yes,menubar=yes,resizable=yes,"; 
      display_setting+="scrollbars=yes,width=650, height=600, left=100, top=25"; 
      
  var docprint=window.open("","",display_setting); 
   docprint.document.open(); 
   docprint.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
   

     docprint.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">');
   docprint.document.write('<html><head><title>' + document.title + '</title>'); 
   docprint.document.writeln('<link rel="stylesheet" type="text/css" href="' + siteStyle + 'bpv3.css"/>');
   docprint.document.writeln('<link type="text/javascript" href="' + siteStyle + 'common.css"/>');
   docprint.document.writeln('<link media="screen" rel="stylesheet" type="text/css" href="' + siteStyle + 'print.css"/>');
   docprint.document.writeln('<link media="print" rel="stylesheet" type="text/css" href="' + siteStyle + 'print.css"/>');
   docprint.document.write('</head><body onLoad="self.print()">');          
   docprint.document.write('<table width=\"100%\" border=\"0\">');
   docprint.document.write('<tr><td>');
   docprint.document.write('<div id=\"printHeader\">');
   docprint.document.write(document.getElementById('header').innerHTML);   
   docprint.document.write('</div>');
   docprint.document.write('</tr></td>');
   docprint.document.write('<tr><td>');
   docprint.document.write('<div id=\"printContent\" >');
   docprint.document.write(document.getElementById('printContent').innerHTML);  
    docprint.document.write('</div>');        
   docprint.document.write('</tr></td>');
   docprint.document.write('<tr><td>');
      docprint.document.write('<div id="printFooter">');
   docprint.document.write(document.getElementById('printFooter').innerHTML);    
     docprint.document.write('</div>');        
   docprint.document.write('</tr></td>');
   docprint.document.write('<tr><td>');
         docprint.document.write('<div id="printSubfooter">');
   docprint.document.write(document.getElementById('printSubfooter').innerHTML);   
     docprint.document.write('</div>');         
   docprint.document.write('</tr></td>');
   docprint.document.write('</table>');
   docprint.document.write('</body></html>'); 
   docprint.document.close(); 
   docprint.focus();
}

function bpv3OnLoad()
{
    ChangeSearchImage(document);
    var thisURL = window.location.host;
    
    if(thisURL!= null & thisURL.indexOf("lillydiabetes.com") == 0)
    {
        var hiddendiv = document.all['site_actions'];
        if(hiddendiv != null)
        {
	        hiddendiv.style.visibility = "hidden";
        }
    }
    
    applyFunction(document);
    
    //setLinkActive();

    attachRollOverFunctions(document);
    //CheckFlashPlayer(); //removed giant block to check for flash, no longer called
    ApplyGlossary(document);	
    //highLightTab_TopNavigations();
        
}
function bpv3OnUnload()
{
  
}


/*===================================
--start RadEditor button js
=====================================*/
// java script for web trend integration
function applyPopup( node )
{   
	if ( node.nodeType == 1 && node.tagName == "A" && node.id.indexOf("popup_") == 0)
	{	
		var linkNode = document.getElementById(node.id);
		linkNode.url = linkNode.href;
		//Commented the code as this was causing issue in interstitial page implementation where the code was getting removed on page edit
		//linkNode.href="#";
		linkNode.onclick=myOpenWindow;	
	}
}

function applyInline( node )
{
	if ( node.nodeType == 1 && node.tagName == "A" && node.id.indexOf("inline_") == 0)
	{
		var linkNode = document.getElementById(node.id);
		linkNode.url = linkNode.href;
		linkNode.onclick = myOpenWindowForInline;
	}
}

function myOpenWindowForInline(e)
{
	var linkNode;
    if(e==null)
    {
	    linkNode = window.event.srcElement;
    }
    else
    {

	    linkNode=e.target;
    }	

	while(linkNode!=null)
	{		   
	    if(linkNode.tagName=="A")
	    {
	    	//Modified the code for changing the height and width of Inetrstitial popup and removing the scrollbars and resize
	    	//applyWebTrendsOnInterstitial(linkNode);
		applyWebTrendsOnInterstitial(linkNode.url, getInnerText(linkNode));
		window.location=linkNode.url;
		break;
	    }
	    else
	    {
	        linkNode=linkNode.parentNode;
	    }
	}
	return false;
}

function myOpenWindowForPopup(e)
{
	var linkNode;
    if(e==null)
    {
	    linkNode = window.event.srcElement;
    }
    else
    {
	    linkNode=e.target;
    }	
	while(linkNode!=null)
	{		   
	    if(linkNode.tagName=="A")
	    {	      
	        window.showModalDialog(linkNode.url,'','dialogHeight:130px;dialogWidth:450px;dialogTop:px;dialogLeft:px;dialogRight:px;center:Yes;scroll:no;resizable:yes;status:no;');
	        
	        break;
	    }
	    else
	    {
	        linkNode=linkNode.parentNode;
	    }
	}
	return false;
}

function myOpenWindow(e)
{
	var linkNode;
    if(e==null)
    {
	    linkNode = window.event.srcElement;
    }
    else
    {
	    linkNode=e.target;
    }	
	while(linkNode!=null)
	{		   
	    if(linkNode.tagName=="A")
	    {
		applyWebTrendsOnInterstitial(linkNode.url, getInnerText(linkNode));
		openWindow(linkNode.url,'',380,325,'no','no');
	        break;
	    }
	    else
	    {
	        linkNode=linkNode.parentNode;
	    }
	}
	return false;
}
//Change Done for putting in functionality for WebTrends + Interstitial on 1 link

function applyWebTrendsOnInterstitial(url, text)
{
	var offsiteUrl = getParamsFromURL("URL",url);
	var dcsURL = getUrl(offsiteUrl);
	if(dcsURL[1] == '')
	{
		dcsURL[1] = '/';
	}
//	alert('DCS.dcssip----->' + dcsURL[0]);
//	alert('DCS.dcsuri---------->' + dcsURL[1]);
//	alert('WT.ti---------->'+ text);
	var domain = dcsURL[0].split("//")[1].split("/")[0] ;
//alert('DCS.dcssip----->' + domain );
//alert('DCS.dcsuri---------->' + dcsURL[1]);

	dcsMultiTrack('DCS.dcssip',domain ,'DCS.dcsuri',dcsURL[1],'WT.ti',text);
}



function applyWebTrends( node )
{
    if ( node.nodeType == 1 && node.tagName == "A" && node.id.indexOf("webtrends_") == 0)
    {
	    
	    var linkNode = document.getElementById(node.id);
		linkNode.url = linkNode.href;
	    	  
	    //linkNode.href="#";
	    linkNode.onclick=myCallWebTrends;
	    
    }
}

function getUrl(linkNodeUrl)
{
	var isUrlPathRelative = false;
	var url=linkNodeUrl;
	//Check if The URL is relative path or not
	//if yes, then send linkNodeUrl as dcsuri parameter.
	var urlBuf=url.split("//");
	if (urlBuf.length <= 1)
	{
	  url = window.location.href;	
	  urlBuf=url.split("//");
	  isUrlPathRelative = true
	}
	   var buf1=urlBuf[0];
	   var buf2=urlBuf[1];
	   var bufarr=buf2.split("/");
	   var buf3=bufarr[0];
	   var buf4=bufarr[1];
	   var start=url.indexOf(buf3)+buf3.length;
	   var nxt=url.substr(start);
	   var prv=url.substr(0,start);
	 
	   var dcsURL= new Array();
	   dcsURL[0] = prv;
	   if(isUrlPathRelative)
	   {
	      dcsURL[1] = linkNodeUrl;
	   }
	   else
	   {
 	      dcsURL[1] = nxt;
	   }	
	   return dcsURL;
}


function getInnerText(linkNode)
{
	var linkNodeText;
	var ua=navigator.userAgent.toLowerCase();
	if(ua.indexOf("firefox")>-1)
	{
		linkNodeText = linkNode.textContent;
	}
	else
	{
		linkNodeText = linkNode.innerText;
	}
	if(linkNodeText.length > 0)
	{
	    return linkNodeText;
	}
	var children = 	linkNode.childNodes;
    if(children.length>0)
    {
		for(var i = 0; i < children.length; i++)
    	{
    		if(children[i].tagName == "IMG")
    		{
			    return children[i].getAttribute('alt');
    		}
    	}

    }

}


function myCallWebTrends(e)
{
    var linkNode;
    if(e==null)
    {
	    linkNode = window.event.srcElement;
    }
    else
    {
	    linkNode=e.target;
    }
    while(linkNode!=null)
    {		   
        if(linkNode.tagName=="A")
        {
           var urlLink = getUrl(linkNode.url);
	   var urlText = getInnerText(linkNode);
    	    try{	               
        	//alert('DCS.dcssip----->' + urlLink[0]);
		//alert('DCS.dcsuri---------->' +  urlLink[1]);
		//alert('WT.ti---------->' + urlText);
		var domain = urlLink[0].split("//")[1].split("/")[0] ;
		//alert('DCS.dcssip----->' + domain );
		//alert('DCS.dcsuri---------->' +  urlLink[1]);

		dcsMultiTrack('DCS.dcssip',domain ,'DCS.dcsuri',urlLink[1],'WT.ti',urlText);
    	       }
	     catch(e)
	       {
	       }
            
            //window.location=linkNode.url;
            break;
        }
        else
        {
            linkNode=linkNode.parentNode;
        }
    }
}

function getParamsFromURL( name, url )
{  
    name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");  
    var regexS = "[\\?&]"+name+"=([^&#]*)";  
    var regex = new RegExp( regexS );  
    var results = regex.exec( url );  
    if( results == null )   
    {
	    return "";
    }
    else
    {
	    return results[1];
    }	
}


function getParams( name )
{  
    name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");  
    var regexS = "[\\?&]"+name+"=([^&#]*)";  
    var regex = new RegExp( regexS );  
    var results = regex.exec( window.location.href );  
    if( results == null )   
    {
	    return "";
    }
    else
    {
	    return results[1];
    }	
}

function myOpenWin(e)
{
    var linkNode;
    if(e==null)
    {
	    linkNode = window.event.srcElement;
    }
    else
    {
	    linkNode=e.target;
    }
    window.history.go(-1);
    openWindow(linkNode.url,'',640,480,'yes','yes');	
    return false;
}

		
function applyURL( node )
{
    var navigateurl = unescape(getParams('URL'));
    var interstitialType = getParams('InterstitialType');

    if (interstitialType == "inline")
    {
        if ( node.nodeType == 1 && node.tagName == "A" && node.id.toUpperCase().indexOf("YES") == 0)
        {
	        var linkNodeYes = document.getElementById(node.id);
	        linkNodeYes.href = navigateurl;
	        linkNodeYes.url = navigateurl;
	        linkNodeYes.onclick = myOpenWin;
        }
    	
        if ( node.nodeType == 1 && node.tagName == "A" && node.id.toUpperCase().indexOf("NO") == 0)
        {
	        var linkNodeNo = document.getElementById(node.id);
	        //linkNodeNo.href = "#";
	        linkNodeNo.onclick = goBack;
        }
    }
    else
    {
        if ( node.nodeType == 1 && node.tagName == "A" && node.id.toUpperCase().indexOf("YES") == 0)
        {
	        var linkNodeYes = document.getElementById(node.id);
	        linkNodeYes.href = navigateurl;
	        //Below code is used for IE browser to close the Interstitial Window. In other browsers, the interstital popup remains open
	       
			//var ua = navigator.userAgent.toLowerCase();
	        //if ( ua.indexOf( "msie" ) != -1 ) {
	        linkNodeYes.onclick = openExternalLink;
	        
	       // linkNodeYes.onclick = openExternalLink;
	       // }    
        }
    	
        if ( node.nodeType == 1 && node.tagName == "A" && node.id.toUpperCase().indexOf("NO") == 0)
        {
	        var linkNodeNo = document.getElementById(node.id);
	        linkNodeNo.href = "#";
	        linkNodeNo.onclick = closeWin;
        }
    }

}	
	
function openExternalLink(e)
{
    var linkNode;
    if(e==null)
    {
	    linkNode = window.event.srcElement;
    }
    else
    {
	    linkNode=e.target;
    }

    //Below code is used for IE browser to close the Interstitial Window. In other browsers, the interstital popup remains open
    var ua = navigator.userAgent.toLowerCase();
    if ( ua.indexOf( "firefox" ) > -1 ) 
    {
//alert("Link Node ->" + linkNode.href);	
	window.open(linkNode.href)
	}
	
	closeWin();
}




function goBack()
{
    window.history.go(-1);
    return false;
}

function closeWin()
{
  window.close();
}

function applyFunction( node )
{
    applyPopup(node);
    applyInline(node);
    applyWebTrends(node);
    applyURL(node);

    var children = node.childNodes;
    for ( var i = 0; i < children.length; i++ )
    {
        applyFunction( children[i] );
    }
}
function ShowForm(url)
{
    var rtnValue = window.showModalDialog(url,'','dialogHeight:130px;dialogWidth:450px;dialogTop:px;dialogLeft:px;dialogRight:px;center:Yes;scroll:yes;resizable:no;status:no;');
    return rtnValue;
}


/*===================================
--end RadEditor button
=====================================*/

function ChangeSearchImage(node)
{
	if((node.tagName == "A") || (node.tagName == "a"))
	{
	    
	    if(node.title == "Advanced Search")
	    {
	    
	       node.style.display = "none";
	       
	     
	    }
	}
	if((node.tagName == "IMG") || (node.tagName == "img"))
	{
	    if(node.title == "Go Search")
	    {
	        node.onmouseover="this.src='/PublishingImages/btn_search.gif'";
	        node.onmouseout="this.src='/PublishingImages/btn_search.gif'";
	        node.src = "/PublishingImages/btn_search.gif";
	        node.parentNode.parentNode.className = "ms-sbgo-bpv3";
	    }
	}
	
	
	if(window.location.href.toLowerCase().indexOf(window.location.host.toLowerCase()+"/pages/default.aspx")>0)
	{

	    if((node.tagName == "SPAN") || (node.tagName == "span"))
	    {
    	    
	        if(node.className == "breadcrumbCurrent")
	        {

    	     //  node.innerHTML = "<a class=\"ms-sitemapdirectional\" href=\"/Pages/default.aspx\">"+node.innerText+"</a>";
    	       node.style.display = "none";
	   
    	       
    	     
	        }
	    }
    	
    }
	//if((node.tagName == "DIV") || (node.tagName == "div"))
	//{
	    
	//    if(node.id == "bpv3_toolbar")
	//    {
	    
	//       node.style.display = "none";
	       
	//     
	//    }
	//      if(node.id == "breadcrumb")
	//    {
	//    
	//       node.style.display = "none";
	//       
	//     
	//    }

	//}
	
	var children = node.childNodes;
    for ( var i = 0; i < children.length; i++ )
    {
        ChangeSearchImage(children[i]);
    }
}

/*===================================
-- Begin image rollover functions
====================================*/
//Preload specified images on the page
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];}}
}
//Restore the specified image to its original state
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;
}
//Find image objects with specified IDs
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;
}
//Swap oringal image with specifed image
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];}
}
/*===================================
-- End image rollover functions
====================================*/

//writeImages writes out what image should be live on page load
function writeImages(){
	 var cookie = readCookie("style");
 	 var title = cookie ? cookie : getPreferredStyleSheet();
	//regularFont, largerFont, largestFont
	if(title==null || title=='regularFont'){
		return('<a href="#" onClick="javascript:styleSizer(\'regularFont\');"><img src="/PublishingImages/text_small_selected.gif" alt="Small text" id="smallTextButton" name="smallTextButton" width="17" height="25" style="padding-right: 1px;" /></a><a href="#" onClick="javascript:styleSizer(\'largerFont\');"><img src="/PublishingImages/text_medium.gif" alt="Medium text" id="mediumTextButton" name="mediumTextButton" width="17" height="25" style="padding-right: 1px;" /></a><a href="#" onClick="javascript:styleSizer(\'largestFont\');"><img src="/PublishingImages/text_large.gif" alt="Large text" id="largeTextButton" name="largeTextButton" width="21" height="25" style="padding-right: 1px;" /></a>');
	}else if(title=='largerFont'){
		return('<a href="#" onClick="javascript:styleSizer(\'regularFont\');"><img src="/PublishingImages/text_small.gif" alt="Small text" id="Img1" name="smallTextButton" width="17" height="25" style="padding-right: 1px;"  /></a><a href="#" onClick="javascript:styleSizer(\'largerFont\');"><img src="/PublishingImages/text_medium_selected.gif" alt="Medium text" id="Img2" name="mediumTextButton" width="17" height="25" style="padding-right: 1px;" /></a><a href="#" onClick="javascript:styleSizer(\'largestFont\');"><img src="/PublishingImages/text_large.gif" alt="Large text" id="Img3" name="largeTextButton" width="21" height="25" style="padding-right: 1px;" /></a>');
	}else if(title=='largestFont'){
		return('<a href="#" onClick="javascript:styleSizer(\'regularFont\');"><img src="/PublishingImages/text_small.gif" alt="Small text" id="Img4" name="smallTextButton" width="17" height="25" style="padding-right: 1px;" /></a><a href="#" onClick="javascript:styleSizer(\'largerFont\');"><img src="/PublishingImages/text_medium.gif" alt="Medium text" id="Img5" name="mediumTextButton" width="17" height="25" style="padding-right: 1px;" /></a><a href="#" onClick="javascript:styleSizer(\'largestFont\');"><img src="/PublishingImages/text_large_selected.gif" alt="Large text" id="Img6" name="largeTextButton" width="21" height="25" style="padding-right: 1px;" /></a>');
	}else{
		return('<a href="#" onClick="javascript:styleSizer(\'regularFont\');"><img src="/PublishingImages/text_small_selected.gif" alt="Small text" id="Img7" name="smallTextButton" width="17" height="25" style="padding-right: 1px;" /></a><a href="#" onClick="javascript:styleSizer(\'largerFont\');"><img src="/PublishingImages/text_medium.gif" alt="Medium text" id="Img8" name="mediumTextButton" width="17" height="25" style="padding-right: 1px;" /></a><a href="#" onClick="javascript:styleSizer(\'largestFont\');"><img src="/PublishingImages/text_large.gif" alt="Large text" id="Img9" name="largeTextButton" width="21" height="25" style="padding-right: 1px;" /></a>');
}
}

/* This funcion gets called when close button in diacionary flash is called */
function closeMe()
{
	//alert('being called');
	self.parent.Shadowbox.close();
}





function highLightTab_TopNavigations()
{

if(document.getElementById("navLevel1")!=null)	

  {  	
	
  aObj = document.getElementById('navLevel1').getElementsByTagName('a');
  
  for(i=0;i<aObj.length;i++) 
  {
     var pageLoc = document.location.href.toLowerCase();
    if(pageLoc.indexOf(aObj[i].href.toLowerCase())>=0) 
    {     
	
	var children = 	aObj[i].childNodes;	
    	if(children.length>0)
    	{
		for(var i = 0; i < children.length; i++)
    	{
    		if(children[i].tagName == "IMG")
    		{
			
			var current_src = children[i].getAttribute('src');
			var Source_Arr = new Array(); 			
			Source_Arr = current_src.split("/"); 
			var url = Source_Arr[(Source_Arr.length)-1]; 
			url = url.toLowerCase();
			url = url.replace("-off","-on");			
			children[i].src = "/PublishingImages/" + url;
			return;
    		}
    	}

    	}
	
    }
			
  }
 }

		

}



setLinkActive = function() {

if(document.getElementById("navLevel2")!=null)	

  {  	
	
  aObj = document.getElementById('navLevel2').getElementsByTagName('a');
  
  for(i=0;i<aObj.length;i++) 
  {
     var pageLoc = document.location.href.toLowerCase();
    if(pageLoc.indexOf(aObj[i].href.toLowerCase())>=0) 
    {     
	
	var children = 	aObj[i].childNodes;	
    	if(children.length>0)
    	{
		for(var i = 0; i < children.length; i++)
    	{
    		if(children[i].tagName == "IMG")
    		{
			
			var current_src = children[i].getAttribute('src');
			var Source_Arr = new Array(); 			
			Source_Arr = current_src.split("/"); 
			var url = Source_Arr[(Source_Arr.length)-1]; 
			url = url.toLowerCase();
			url = url.replace("-off","-on");			
			children[i].src = "/PublishingImages/" + url;
			highLightTab_BasedOnSideMenu(children[i].className);
			getHeaderIDValue(children[i].className);

			return;
    		}
    	}

    	}
	
    }
			
  }
 }

}

//if (window.attachEvent) window.attachEvent("onload", setLinkActive);

function getHeaderIDValue(class_Name)
{

if(class_Name=="clsLAD")
{
 headerID = "header1";
}
else if(class_Name=="clsCBS")
{
 headerID = "header2";
}
else if(class_Name=="clsNAF")
{
 headerID = "header3";
}
else if(class_Name=="clsDR")
{
 headerID = "header4";
}
else if(class_Name=="clsSI")
{
 headerID = "header5";
}
else if(class_Name=="clsAL")
{
 headerID = "header6";
}
else if(class_Name=="clsLP")
{
 headerID = "header7";
}

get_Header(headerID);

}



function highLightTab_BasedOnSideMenu(getClassName)
{

if(document.getElementById("navLevel1")!=null)	

  {  	
	
  aObj = document.getElementById('navLevel1').getElementsByTagName('a');
  
  for(i=0;i<aObj.length;i++) 
  {
     
    if(aObj[i].className==getClassName) 
    {     
	
	var children = 	aObj[i].childNodes;	
    	if(children.length>0)
    	{
		for(var i = 0; i < children.length; i++)
    	{
    		if(children[i].tagName == "IMG")
    		{
			
			var current_src = children[i].getAttribute('src');
			var Source_Arr = new Array(); 			
			Source_Arr = current_src.split("/"); 
			var url = Source_Arr[(Source_Arr.length)-1]; 
			url = url.toLowerCase();
			url = url.replace("-off","-on");			
			children[i].src = "/PublishingImages/" + url;
			return;
    		}
    	}

    	}
	
    }
			
  }
 }

		

}



















/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/

var offsetfrommouse=[20,-10]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0; //duration in seconds image should remain visible. 0 for always.
var currentimageheight = 0;	// maximum image size.

if (document.getElementById || document.all){
	document.write('<div id="trailimageid">');
	document.write('</div>');
}

function gettrailobj(){
if (document.getElementById)
return document.getElementById("trailimageid").style
else if (document.all)
return document.all.trailimageid.style
}

function gettrailobjnostyle(){
if (document.getElementById)
return document.getElementById("trailimageid")
else if (document.all)
return document.all.trailimageid
}


function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}


/* LOAD THE XML FILE */
var xmlDoc;
var glossarykey = "";
var glossarytitle = "";
var glossarydef = "";

/* Fix for Safari! */
if ((navigator.userAgent.indexOf('Safari') != -1))
{
	xmlHttp = new XMLHttpRequest();
	xmlHttp.open("GET", "/pages/glossary.xml", false);
	xmlHttp.send();
	xmlDoc = xmlHttp.responseXML;
}
else
{

	if (window.ActiveXObject)
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
	}
	else if (document.implementation.createDocument)
	{
		xmlDoc = document.implementation.createDocument("","",null);
	}

	if (xmlDoc != null)
	{
		xmlDoc.async = false;
		xmlDoc.load("/pages/glossary.xml");
	}
	else
	{
		glossarydef = "Sorry, your browser does not support the glossary feature on this website.";	
	}
	
}


/* PULL THE DEFINITION WHEN CALLED */
function pullDefinition() {
	
	var xmlLength = xmlDoc.getElementsByTagName("term").length;
	glossarytitle = "N/A";
	glossarydef = "There is no definition for this term yet.";
	
	for (var g = 0; g < xmlLength; g++) {
		
		if (xmlDoc.childNodes[0].getElementsByTagName("term")[g].attributes[0].nodeValue == glossarykey)
		{
			glossarytitle = xmlDoc.childNodes[0].getElementsByTagName("term")[g].attributes[1].nodeValue;
			glossarydef = xmlDoc.childNodes[0].getElementsByTagName("term")[g].attributes[2].nodeValue;
			break;
		}
	
	}
	
}

/* CONTROL THE GLOSSARY BOX */


function showtrail(term) {
	
	glossarykey = term;
	if (xmlDoc != null) {
		pullDefinition();
	}
	document.onmousemove=followmouse;
	
	newHTML = '<div id="glossaryDef">'
	
	newHTML += '<div id="glossaryTop">';
	
	newHTML += '</div>';
	
	newHTML += '<div id="glossaryWrap">';
	
	newHTML += '<div id="glossaryContent">';
	
	newHTML += '<strong>';
	newHTML += glossarytitle;
	newHTML += '</strong><br />';
	
	newHTML += glossarydef;
	
	newHTML += '</div>';
	
	newHTML += '</div>';
	
	newHTML += '<div id="glossaryBottom"></div>';
	
	newHTML += '</div>';

	gettrailobjnostyle().innerHTML = newHTML;
	gettrailobj().visibility="visible";

}


function hidetrail(){
	gettrailobj().visibility="hidden"
	document.onmousemove=""
	gettrailobj().left="-500px"

}

function followmouse(e){

	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

	/*
	if (document.all){
		gettrailobjnostyle().innerHTML = 'A = ' + truebody().scrollHeight + '<br>B = ' + truebody().clientHeight;
	} else {
		gettrailobjnostyle().innerHTML = 'C = ' + document.body.offsetHeight + '<br>D = ' + window.innerHeight;
	}
	*/

	if (typeof e != "undefined"){
		if (docwidth - e.pageX < 380){
			xcoord = e.pageX - xcoord - 300; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
		if (docheight - e.pageY < (currentimageheight + 110)){
			ycoord += e.pageY - Math.max(0,(110 + currentimageheight + e.pageY - docheight - truebody().scrollTop));
		} else {
			ycoord += e.pageY;
		}

	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < 380){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - 300; // Move to the left side of the cursor
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}
		if (docheight - event.clientY < (currentimageheight + 110)){
			ycoord += event.clientY + truebody().scrollTop - Math.max(0,(110 + currentimageheight + event.clientY - docheight));
		} else {
			ycoord += truebody().scrollTop + event.clientY;
		}
	}

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
		if(ycoord < 0) { ycoord = ycoord*-1; }
	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"

}







function ApplyGlossary(node)
{

	if((node.tagName == "A") || (node.tagName == "a"))
	{
		
	   if(node.name.indexOf("glo")>-1 )
	    {
	    	var nodename=node.name.substring(3);
	    	node.className="glossary";
	    	hEvnt(node,'onmouseover','showtrail("'+nodename+'")');
	    	hEvnt(node,'onmouseout','hidetrail()');
	    	node.href="javascript:;";
	    }
	 }
	 
	var children = node.childNodes;
    for ( var i = 0; i < children.length; i++ )
    {
        ApplyGlossary(children[i]);
    }

}
function hEvnt(obj,evtName,fnCall){
	 evtName=evtName.toLowerCase();  doCapture=false;  
	 
	 if (obj.addEventListener){    
	 //obj.addEventListener(evtName.replace('on',''),fnCall,doCapture);   
	 obj.addEventListener(evtName.replace('on',''),  function(){eval(fnCall);},false);  
	 }  
	 else if(obj.attachEvent){   obj.attachEvent(evtName,function(){eval(fnCall);}); 
	 //also do detachEvent later 
	 }  else{     eval(obj+"."+evtName +"="+ fnCall);  }  }
function uhEvt(obj,evtName,fnCall){
  evtName=evtName.toLowerCase();  doCapture=false;  
  if (obj.addEventListener){      obj.removeEventListener(evtName.replace('on',''),    function(){eval(fnCall);},doCapture);  }
  else if(obj.attachEvent){   obj.detachEvent(evtName,function(){eval(fnCall);});  }  else{     eval(obj+"."+evtName +"='';");  }  }








/*=============================================
--  Start of Printer Friendly
===============================================*/



function print_Page() {
	var finalURL;
	var append = document.URL;
	if(append!=''){
	finalURL=append + "?type=print";			
	window.open(finalURL);
	}
}



/*===========================================================
-- Function acting in the page for opening the print window
===============================================================*/



function pageType() {
	
	
  var str = document.URL;
	
  
  point = str.lastIndexOf("?");
  var suffix = (str.substring(point+1,str.length));

  if ( (suffix == "type=print") || (str.indexOf("printerFriendly.html") > 0 ) ) {
	
	document.write('<link rel="stylesheet" type="text/css" href="/Styles/print.css" />');
		
this.window.print();

  }


}

/*======================
-- End of Function
=======================*/

/*=============================================
--  End of Printer Friendly
===============================================*/


//Image rollover
//image filenames must be in the format 'filename.ext' and 'filename-on.ext'

Rollover = function()
{
	//empty constructor
}

//Static function turns on the rollover image
Rollover.turnOn = function(element)
{

	//Get the image element
	var img = element;

	//Get the filename portion minus the extension
	var filename = img.substr(0, img.lastIndexOf('.'));
        
	//Get the extension portion
	var extension = img.substr(img.length - 4, 4);
        
	//insert '-on' between the filename and extension and set it as the new src
	
          document.getElementById("btnNext").src = filename + '-on' + extension;
}

//Static function turns off the rollover image
Rollover.turnOff = function(element)
{
	// //Get the image element
	var img = element;

	//Get the filename portion minus the extension, also removed the '-on'
	var filename = img.substr(0, img.lastIndexOf('.'));
	
	//Get the extension portion
	var extension = img.substr(img.length - 4, 4);
	
	//Set the combined name as the new img src
	//img.src = filename + extension;
	document.getElementById("btnNext").src = filename + extension;
}



function attachRollOverFunctions(node)
{

    if((node.tagName == "img") || (node.tagName == "IMG"))
	{
		
	   if(node.id.indexOf("btnNext")>-1 )
	    {
	    	//hEvnt(node,'onmouseover','Rollover.turnOn(this)');
	    	//hEvnt(node,'onmouseout','Rollover.turnOff(this)');
		
		hEvnt(node,'onmouseover','Rollover.turnOn("'+node.src+'")');
	    	hEvnt(node,'onmouseout','Rollover.turnOff("'+node.src+'")');
	    }
	 }
	 
	var children = node.childNodes;
        
    for ( var i = 0; i < children.length; i++ )
    {
        attachRollOverFunctions(children[i]);
    }
	 
}





/*===================================
-- Begin text sizing functions
====================================*/
//Resets all the text-size images and sets the correct font
function styleSizer(whichStyle){
	//reset all the images
	
	//reset all the images
	MM_swapImage('smallTextButton','','/PublishingImages/text_small.gif',1);
	MM_swapImage('mediumTextButton','','/PublishingImages/text_medium.gif',1);
	MM_swapImage('largeTextButton','','/PublishingImages/text_large.gif',1);
	//then set the correct font
	if(whichStyle=="Small Text"){
		setActiveStyleSheet('Small Text'); 
		MM_swapImage('smallTextButton','','/PublishingImages/text_small_selected.gif',1);
	}else if(whichStyle=="Medium Text"){
		setActiveStyleSheet('Medium Text');
		MM_swapImage('mediumTextButton','','/PublishingImages/text_medium_selected.gif',1);
	}else if(whichStyle=="Large Text"){
		setActiveStyleSheet('Large Text');
		MM_swapImage('largeTextButton','','/PublishingImages/text_large_selected.gif',1);
	}
}

//writeImages writes out what image should be live on page load
function writeImages(){
	 var cookie = readCookie("style");
 	 var title = cookie ? cookie : getPreferredStyleSheet();
	//regularFont, largerFont, largestFont
	if(title==null || title=='Small Text'){
		return('<a href="#" onClick="javascript:styleSizer(\'Small Text\');"><img src="/PublishingImages/text_small_selected.gif" alt="Small text" id="smallTextButton" name="smallTextButton" width="17" height="25" style="padding-right: 1px;" /></a><a href="#" onClick="javascript:styleSizer(\'Medium Text\');"><img src="/PublishingImages/text_medium.gif" alt="Medium text" id="mediumTextButton" name="mediumTextButton" width="17" height="25" style="padding-right: 1px;" /></a><a href="#" onClick="javascript:styleSizer(\'Large Text\');"><img src="/PublishingImages/text_large.gif" alt="Large text" id="largeTextButton" name="largeTextButton" width="21" height="25" style="padding-right: 1px;" /></a>');
	}else if(title=='Medium Text'){
		return('<a href="#" onClick="javascript:styleSizer(\'Small Text\');"><img src="/PublishingImages/text_small.gif" alt="Small text" id="Img1" name="smallTextButton" width="17" height="25" style="padding-right: 1px;"  /></a><a href="#" onClick="javascript:styleSizer(\'Medium Text\');"><img src="/PublishingImages/text_medium_selected.gif" alt="Medium text" id="Img2" name="mediumTextButton" width="17" height="25" style="padding-right: 1px;" /></a><a href="#" onClick="javascript:styleSizer(\'Large Text\');"><img src="/PublishingImages/text_large.gif" alt="Large text" id="Img3" name="largeTextButton" width="21" height="25" style="padding-right: 1px;" /></a>');
	}else if(title=='Large Text'){
		return('<a href="#" onClick="javascript:styleSizer(\'Small Text\');"><img src="/PublishingImages/text_small.gif" alt="Small text" id="Img4" name="smallTextButton" width="17" height="25" style="padding-right: 1px;" /></a><a href="#" onClick="javascript:styleSizer(\'Medium Text\');"><img src="/PublishingImages/text_medium.gif" alt="Medium text" id="Img5" name="mediumTextButton" width="17" height="25" style="padding-right: 1px;" /></a><a href="#" onClick="javascript:styleSizer(\'Large Text\');"><img src="/PublishingImages/text_large_selected.gif" alt="Large text" id="Img6" name="largeTextButton" width="21" height="25" style="padding-right: 1px;" /></a>');
	}else{
		return('<a href="#" onClick="javascript:styleSizer(\'Small Text\');"><img src="/PublishingImages/text_small_selected.gif" alt="Small text" id="Img7" name="smallTextButton" width="17" height="25" style="padding-right: 1px;" /></a><a href="#" onClick="javascript:styleSizer(\'Medium Text\');"><img src="/PublishingImages/text_medium.gif" alt="Medium text" id="Img8" name="mediumTextButton" width="17" height="25" style="padding-right: 1px;" /></a><a href="#" onClick="javascript:styleSizer(\'Large Text\');"><img src="/PublishingImages/text_large.gif" alt="Large text" id="Img9" name="largeTextButton" width="21" height="25" style="padding-right: 1px;" /></a>');
}
}


// 1. Loop through every link element in the document.
// 2. Disable all preferred and alternate style sheets that we don’t want active.
// 3. Enable all preferred and alternate style sheets that we do want active.
function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}
//Return the current style sheet
function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}
//Find out which style sheet is the preferred style sheet.
function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}
//Create a cookie to store the preferred style sheet.
function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = '; expires='+date.toGMTString();
  }
  else expires = '';
  document.cookie = name+'='+value+expires+'; path=/';
}
//Read the cookie to return the prefered style sheet.
function readCookie(name) {
  var nameEQ = name + '=';
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}
//On page load get the value of previous style sheeet or use preferred styles sheet.
window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);


}
//Save the cookie in the onunload event
window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);
/*===================================
-- End text sizing functions
====================================*/

/*===================================
-- Begin Email a Friend function
====================================*/

function eaf()
{
	var currentSite = window.location.href;
	    currentSite = currentSite.toLowerCase();	

	var strauthUrl="-authoring.rf.lilly.com";
	var strstgUrl="-staging.rf.lilly.com";
	var strpseUrl="-pseudo.rf.lilly.com";
        var url = "";

  if (currentSite.indexOf(strauthUrl.toLowerCase()) >= 0 || currentSite.indexOf(strstgUrl.toLowerCase()) >= 0|| currentSite.indexOf(strpseUrl.toLowerCase()) >= 0) 
	{
          url = "https://emailafriend-d6.xh1.lilly.com/servlet/EmailAFriendServlet?url=" + currentSite;
		

        } 

	else 
	{
          url = "https://emailafriend.lilly.com/servlet/EmailAFriendServlet?url=" + currentSite;
        }
	
        window.open(url, 'EmailAFriend', 'height=500, resizable=yes, scrollbars=yes, width=650');
}
/*===================================
-- End Email a Friend functions
====================================*/



/*Functions used to capture vote for Pagerating Flash*/

function storeMyVote( objVote )
{
	
    var strVoteURL = new String('');
	strVoteURL = "/pages/" +sitePageName; 
    createCookie(strVoteURL, objVote);
}



function getMyVote()
{	
    
    var strPvoteURL = new String('');
	strPvoteURL = "/pages/" + sitePageName;  
    
	var intPVote = readCookie(strPvoteURL);	
	if(intPVote != null)
		return intPVote;
	else
		return "";
}



/*========================================
-- Default MOSS Search Functionality 
===========================================*/



function searchfunc()
{

 var searchValue = document.getElementById('searchInputField').value; 
 document.getElementById('ctl00_head_PlaceHolderSearchArea_ctl01_SABFBB873_InputKeywords').value = searchValue; 
 SABFBB873_Submit();
 	
}


/*========================================
-- End of MOSS Search 
===========================================*/


/*============================================================
--  Triggering Search Functionality on Clicking Enter Key 
=============================================================*/


function checkEnter(event1) { 
var kCode = String.fromCharCode(event1.keyCode);
if(kCode == "\n" || kCode == "\r")
{   
searchfunc();
}
}

/*====================================================================================================
Functions to display searched value in "Search" Text box
=====================================================================================================*/

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.getElementById("searchInputField").value = queryString(key); 
}
}

/*==========================================
--  End of  Triggering Search Functionality
============================================*/



/*============================================================
--  Featured Entrees & Featured Desserts Functionality 
=============================================================*/


function fnToggleRecipes(objItem)
{
	//alert(objItem);
	for( i=0; i< 13; i++)
    {
	//alert(i);
        if(objItem == i)
        {
           document.getElementById('arrow' + i).src = '/PublishingImages/redArrowDown.gif';
           document.getElementById('recipe' + i).style.display = 'block';
        }
        else
        {
           document.getElementById('arrow' + i).src = '/PublishingImages/grayArrow.gif';
           document.getElementById('recipe' + i).style.display = 'none';
        }
    }
    
    var recipeName = new String('');
    
    switch (objItem.toString())
    {
    case '1':
        recipeName = 'select_entree_chicken_spinach_salad';
        break;
    case '2':
        recipeName = 'select_entree_shrimp_garlic';
        break;
    case '3':
        recipeName = 'select_entree_sirloin_tips';
        break;
    case '4':
        recipeName = 'select_entree_glazed_pork_chops';
        break;                        
    case '5':
        recipeName = 'select_entree_enchilada_casserole';
        break;
    case '6':
        recipeName = 'select_entree_chicken_stir_fry';
        break;
    case '7':
        recipeName = 'select_entree_blacked_halibut';
        break;
    case '8':
        recipeName = 'select_dessert_cheesecake';
        break;
    case '9':
        recipeName = 'select_dessert_banana_bread';
        break;
    case '10':
        recipeName = 'select_dessert_cchip_cookies';
        break;
    case '11':
        recipeName = 'select_dessert_oatmeal_cookies';
        break;
    case '12':
        recipeName = 'select_dessert_mocha_smoothie';
        break;                
    }
	//alert('Recipename is: ' + recipeName);
       //launchTrackWindowHTML('','','','Diabetes-Friendly-Recipes_clicked', recipeName );
	callDCS(recipeName, 'Diabetes-Friendly-Recipes_clicked')
}

/*============================================================
--  End of Featured Entrees & Featured Desserts Functionality 
=============================================================*/

/*============================================================
--  Rollover Functionality on Exercise-Examples page
=============================================================*/

/// <reference path="jquery-1.2.6-vsdoc.js">

$(document).ready(function() {
    for (var i = 0; i < 12; i++) {
        $("#exercise" + i).hide();
        $("#arrow" + i).attr("src", "/PublishingImages/arrow-right.gif");
    }
});

function showTip(numTip) {
    //if the tip is already visible, just hide it
    if ($("#exercise" + numTip).css("display") != "none") {
        $("#exercise" + numTip).hide();
        $("#arrow" + numTip).attr("src", "/PublishingImages/arrow-right.gif");
        return;
    }

    //hide and reset all divs first
    for (var i = 0; i < 12; i++) {
        $("#exercise" + i).hide();
        $("#arrow" + i).attr("src", "/PublishingImages/arrow-right.gif");
        if (i == numTip) {
            $("#exercise" + i).show();
            $("#arrow" + i).attr("src", "/PublishingImages/arrow-down.gif");
        }
    }
    $("#tip" + numTip).focus();
    return false;
}


function launchTrackWindowHTML(strDL){
	var launchArgs = launchTrackWindowHTML.arguments;
	//alert(launchArgs.count());
	//if(launchArgs.count() > 0)
	
	window.open(launchArgs[0],'winPopupPDF'); 
	return false;
}




/*===================================
Function for webtrends 
====================================*/

function callDCS(linkUrl, linkText) 
{ 
	var domain = window.location.hostname; 
	dcsMultiTrack('DCS.dcssip', domain, 'DCS.dcsuri', linkUrl, 'WT.ti', linkText); 
} 



//Download PDFs of Different Languages
function dlPDF( objTar )
{
	var tarObj = document.getElementById(objTar);
	//alert( tarObj.selectedIndex );
	if(tarObj.selectedIndex != 0)
	{
		if(tarObj.value != '')
		{
			//alert( tarObj.value );
			//dcsMultiTrack('DCS.dcsuri', tarObj.value, 'WT.ti', 'Downloadable Materials');
			callDCS(tarObj.value, 'Downloadable Materials'); 
			window.open( tarObj.value, 'pdfDL');
		}
		else
			alert('No PDF to download yet.');
	}

}





function call_DCS(linkText) 
{ 


var domain = window.location.hostname; 

var linktextParameter = sitePageName + " - " + linkText;


dcsMultiTrack('DCS.dcssip', domain, 'DCS.dcsuri', sitePageName, 'WT.ti', linktextParameter); 
} 


















