//<<< START SHOW & HIDE SCRIPT >>>//
function showHide(theID)
{
	var list = document.getElementById(theID);

	list.style.display = (list.style.display == 'none') ? 'block' : 'none';
}
//<<< END SHOW & HIDE SCRIPT >>>//

//<<< START SECONDARY NAV COLLAPSE SCRIPT >>>//

      function SubNav(theID) {
	  	
		var myID = document.getElementById(theID);	  
		var liID = document.getElementById(theID+'_sub');
	  
    		var list = document.getElementById('secondary_nav');
   			var items = list.getElementsByTagName("a");
			
			//Lets's make an array
			var allIds = new Array();
			
			
			//alert(items.length);
			
			
		    for (var i = 0; i < items.length; i++) {
		    
				//alert(items[i].getAttribute("id"));
        		if (items[i].getAttribute("id") != null & items[i].getAttribute("id") != '') 
				{	
					allIds[allIds.length] = items[i].getAttribute("id")
				}
		    }
			
		for (var i=0;i<allIds.length;i++){
			var allMainIds = document.getElementById(allIds[i]);
			var allSubIds = document.getElementById(allIds[i]+'_sub');
			
				//allMainIds.style.borderBottomColor = '#C3D6E8';
				//allSubIds.style.display = 'none';
		}		
		
		//myID.style.borderBottomColor = (myID.style.borderBottomColor == 'white') ? '#C3D6E8' : 'white';
		//myID.style.fontWeight = (myID.style.fontWeight == 'bold') ? 'normal' : 'bold';
		
		liID.style.display = (liID.style.display == 'none') ? 'block' : 'none';
					  
      }
	
	 //function check(theID) {
		//var myID = document.getElementById(theID);	  
		//var liID1 = document.getElementById(theID+'_sub');
		//if (liID1.style.display = 'block') { liID1.style.display = 'block' else liID1.style.display = 'none' }
		//	}
	
	  
//<<< END SECONDARY NAV COLLAPSE SCRIPT >>>//

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



//<<< START NEWS FEED SCRIPT: SHAREHOLDERS.COM >>>//

var months = new Array();
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";
	
	
function getNewsFeed()
{
	var isLastNewsItem = 0;
	var count = 0;
	var index = 1;
	var theURL = null;
	var theTitle = null;
	var newsItem = null;
	
	var theMonth = null;
	var theDate = null;
	var theYear = null;
	
	
	// Getting the current century because of y2k bug, 05 returns 1905 instead.
	// Therefore, getting the current century and appending it to 05 to form 2005.
	var currDateObj = new Date();
	var currCentury = new String(currDateObj.getFullYear());
	currCentury = currCentury.substring(0,2);
	currDateObj = null;
	
	try
	{
		
		count = RecordCount;								// get record count of press releases from Shareholder.com
		
		for(i = 1; (i<=count)&&(i != 3); i++)				// loop through and display only 3 press releases
		{
			theURL = eval("URL" + i);						// get URL from shareholder.com
			theTitle = eval("Title" + i);					// get Press Release Title from shareholder.com

			theDate = new Date(eval("Date" + i));			// get the date from shareholder.com and create a date object
			
			theYear = new String(theDate.getFullYear());	// get year	of news item
			theYear = theYear.substring(2,4);				// strip starting century because of y2k bug
			theMonth = months[theDate.getMonth()];			// get month string

			newsItem = "<p>" + theMonth + " " + theDate.getDate() + ", " + currCentury + theYear + "<br/>"+ theTitle +". <a href='" + theURL + "'>More &raquo;</a></p>";
				document.write(newsItem);
		}
	}
	catch(e)
	{
		document.write("<p>An error has occurred with the news feed script.</p>");
	}
}
//<<< END NEWS FEED SCRIPT: SHAREHOLDERS.COM >>>//



function getHTTPObject() {
	if (window.ActiveXObject)
		return new ActiveXObject("Microsoft.XMLHTTP");
	else if (window.XMLHttpRequest)
		return new XMLHttpRequest();
	else {
		alert("Your browser does not support AJAX.");
		return null;
	}
}

function getNews(loc) {
	httpObject = getHTTPObject();

	url = '/includes/ajax-news.asp?loc=' + escape(loc);

	if (httpObject != null) {
		var now = new Date();

		httpObject.open("GET", url, true);
		httpObject.send(null);
		httpObject.onreadystatechange = getNewsDetails;

	}
}


function getNewsDetails() {
	if(httpObject.readyState == 4) {
		document.getElementById("ajax-first").innerHTML = "";
		document.getElementById("ajax-news").innerHTML = "";
		document.getElementById("ajax-news-details").innerHTML = httpObject.responseText;
	}
}

