


function init() 
{
 	if (!document.getElementsByTagName) 
 		return;
 
 	var anchors = document.getElementsByTagName("a");
 	for (var i=0; i<anchors.length; i++) 
 	{
   		var anchor = anchors[i];
   		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
   		{
     		anchor.target = "_blank";
 		}	
     	else if (anchor.className.match("print")) 
     	{
        	anchor.onclick = function() 
        	{
          		printPage();
          		return false;
        	};
    	}    	
 	}
 	
 	initTables();
}
window.onload = init;


function printPage() 
{
  	if (window.print)
		window.print()
	else
		alert("Sorry, your browser doesn't support the print feature. Use the File menu on your browser to select Print.");
	return false;
}

function initTables()
{
	var tables = document.getElementsByTagName("table");
	
	for (var i = 0; i < tables.length; i++)
	{
		var tbody = tables[i].getElementsByTagName("tbody")[0];
		var trs = tbody.getElementsByTagName("tr");
		
		for (var j = 1; j < trs.length; j += 2)
		{
			if (trs[j].className == "")
			{
				trs[j].className = "alt";
			}
			else
			{
				trs[j].className += " alt";
			}
		}
	}
	
	return true;
};

