function Print()
{
	window.print();
}
function TabPageClick(oBtn)
{
	aNameParts = oBtn.id.split('_');
	iBtnClickedIndex = parseInt( aNameParts[2] );         // the index of the clicked button
	if( oBtn.className == "navUnselected" )	{ return true;}
	
	oBtn.className = "navUnselected";
	
	for(i=1; i <= 5; i++ )
	{
		if(i == iBtnClickedIndex )
		{
			document.getElementById("Tab_"+ aNameParts[1] +"_"+ iBtnClickedIndex).style.display="block"; // show the clicked layer
			continue;
		}
		
		oBtn = document.getElementById("TabControl_"+ aNameParts[1] +"_"+ i);
		if(oBtn)
		{
			document.getElementById("Tab_"+ aNameParts[1] +"_"+ i).style.display="none";
			oBtn.className = "navSelected";
		}
		else
		{break;}
	}
}
function PopupWindow(WinToOpen)
{
	var windowpop = "toolbar=0,location=0,directories=0,status=0, " +
	"menubar=0,scrollbars=1,resizable=0,width=400,height=600";
	window.open(WinToOpen, "Help", windowpop);
}

function sendEmail(encodedEmail)
{
  // The encodedEmail is a string that contains the email address.
  // Each character in the email address has been converted into 
  // a two digit number (hex / base16). This function converts the
  // series of numbers back into the email address and displays the 
  // email client with the mailto: protocol.

  // holds the decoded email address
  var email = "";

  // go through and decode the email address
  for (i=0; i < encodedEmail.length;)
  {
    // holds each letter (2 digits)
    var letter = "";
    letter = encodedEmail.charAt(i) + encodedEmail.charAt(i+1)

    // build the real email address
    email += String.fromCharCode(parseInt(letter,16));
    i += 2;
  }

  // do the mailto: link
  location.href = "mailto:" + email;
}