
<!-- Copyright 2002 Bontrager Connection, LLC

function getCalendarDate()
{
   var months = new Array(13);
   months[0]  = "January";
   months[1]  = "February";
   months[2]  = "March";
   months[3]  = "April";
   months[4]  = "May";
   months[5]  = "June";
   months[6]  = "July";
   months[7]  = "August";
   months[8]  = "September";
   months[9]  = "October";
   months[10] = "November";
   months[11] = "December";
   var now         = new Date();
   var monthnumber = now.getMonth();
   var monthname   = months[monthnumber];
   var monthday    = now.getDate();
   var year        = now.getYear();
   if(year < 2000) { year = year + 1900; }
   var dateString = monthname +
                    ' ' +
                    monthday +
                    ', ' +
                    year;
   return dateString;
}

<!--
		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];}
		}
		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];}}
		}

		// mouseover script homepage nav and icons
		function m_in(cid,showIcon) {
			if(showIcon) {
				var iconSource="http://knowledge.wharton.upenn.edu/images/icon-"+cid+"_glow.gif";
				eval("document.images.icon"+cid).src=iconSource;			
			}
			eval("document.getElementById("+"'tdcat"+cid+"'"+").bgColor='ffffff'");
		}
		// mouseout script homepage nav and icons
		function m_out(cid,showIcon) {
			if(showIcon) {
				var iconSource="http://knowledge.wharton.upenn.edu/images/icon-"+cid+".gif";
				eval("document.images.icon"+cid).src=iconSource;
			}
			eval("document.getElementById("+"'tdcat"+cid+"'"+").bgColor='#F3E8CC'");
		}

		//clears input text box
		function ClearField (thefield) {
			thefield.value = "";
			var changecolor = returnObjById("navsearch");
			changecolor.style.color = "black";
		}
	
	
		//cross browser ID retriever
		function returnObjById( elementId ) 
		{ 
		    if (document.getElementById) 
        		var returnVar = document.getElementById(elementId); 
		    else if (document.all) 
		        var returnVar = document.all[elementId]; 
		    else if (document.layers) 
        		var returnVar = document.layers[elementId]; 
		    return returnVar; 
		} 
	
		// css make the hidden div's disappear and appear
		//also sends the block or div to the back z-index
		function disappear(whichLayer){
			var styleOff = returnObjById(whichLayer);
			styleOff.style.zIndex = "-3";
			styleOff.style.display ="none";
		}
		function appear(whichLayer){
			var styleOn = returnObjById(whichLayer);
			styleOn.style.zIndex = "2";
			styleOn.style.display ="block";
		}		
	
		//shows a css layer...
		function layerOn(whichLayer){
			var styleOn = returnObjById(whichLayer);
			styleOn.style.display = "block";
		}

		//hides a css layer...
		function layerOff(whichLayer){
			var styleOff = returnObjById(whichLayer);
			styleOff.style.display = "none";
		}

		//generic element "Toggler"
		function toggleLayer(whichLayer){
				var styleToggle = returnObjById(whichLayer);
				styleToggle.style.display = styleToggle.style.display? "":"block";

		}
				
		// CLOSES all the divs for the key word matches on the related articles
		function closeKeywords(numofelements){
			for(var i=1;i<=numofelements;i++)
			{	
				var styleoff = returnObjById("key"+i);
				styleoff.style.display = "none";
				var textstyleoff = returnObjById("key"+i+"text");		
				textstyleoff.style.fontWeight = "normal";		
			
			}

		}

		// OPENS all the divs for the key word matches on the related articles
		function openKeywords(numofelements){
			for(var i=1;i<=numofelements;i++)
			{	
				var styleon = returnObjById("key"+i);
				styleon.style.display = "block";
				var textstyleon = returnObjById("key"+i+"text");		
				textstyleon.style.fontWeight = "bold";	
			}

		}		

		//this function closes all the related keyword divs and then opens the one selected
		function toggleRelated(whichLayer, numofelements){
			closeKeywords(numofelements);
			var style2 = returnObjById(whichLayer);
			var textstyleon = returnObjById(whichLayer+"text");
			style2.style.display = "block";
			textstyleon.style.fontWeight = "bold";
			//textstyleon.style.color = "black";		
		}
		
		//printer friendly function	
		function printpage() {
			window.print();  
		}
		
		/* 	DYNAMIC ROTATING CONTENT JAVASCRIPT
		  	COMMENTED OUT FOR NOW

		if (document.all || document.getElementById){ //if IE4 or NS6+
			document.write('<style type="text/css">\n')
			document.write('.dyncontent{display: none;}\n')
			//document.write('.dyncontent1{display: none;}\n')
			document.write('</style>')
			
		}

		var curcontentindex=0
		var messages=new Array()
		
		function getElementByClass(classname){
		var inc=0
		var alltags=document.all? document.all : document.getElementsByTagName("*")
		for (i=0; i<alltags.length; i++){
		if (alltags[i].className==classname)
		messages[inc++]=alltags[i]
		}
		}
		
		function rotatecontent(){
		//get current message index (to show it):
		curcontentindex=(curcontentindex<messages.length-1)? curcontentindex+1 : 0
		//get previous message index (to hide it):
		prevcontentindex=(curcontentindex==0)? messages.length-1 : curcontentindex-1
		messages[prevcontentindex].style.display="none" //hide previous message
		messages[curcontentindex].style.display="block" //show current message
		}
		
		
		window.onload=function(){
			if (document.all || document.getElementById){
				getElementByClass("dyncontent")
				setInterval("rotatecontent()", 4000)
			}
		}

		*/




// Cookie functions		

		// this function gets the cookie, if it exists
		function getCookie(name) {
			var start = document.cookie.indexOf( name + "=" );
			var len = start + name.length + 1;
			if ( ( !start ) &&
				( name != document.cookie.substring( 0, name.length ) ) )
			{
			return null;
			}
			if ( start == -1 ) return null;
			var end = document.cookie.indexOf( ";", len );
			if ( end == -1 ) end = document.cookie.length;
			return unescape( document.cookie.substring( len, end ) );
		}


		// this function will set the cookie of 'name' with 'value' passed to it
		function setCookie(name, value) {
		  var curCookie = name + "=" + escape(value) + "; expires=Wed, 07-Jun-2023 11:07:25 GMT; path=/; domain=.knowledge.wharton.upenn.edu";
		  document.cookie = curCookie;
		}
		
		function changeFontSize (newfontsize) {
			var newdoc = returnObjById("bodytext");
			newdoc.style.fontSize = newfontsize+"pt";
			setCookie('TEXTSIZE',newfontsize+"pt");
			location.reload();  
			//self.location.href = self.location.href; //window.location.href = window.location.href;
		}
		
	// -->
