// Puts the exit icon by all external links

function exitLink()

{

	if (document.getElementById && document.all)

	{

		var browser="IE";

	}

	else

	{

		var browser="notIE";

	}

  var e = document.getElementById('content');

  if (e)

	{

    var a=e.getElementsByTagName('a');

    for (var i=0;i<a.length;i++)

		{

			if (browser == "IE")

			{

				if (a[i].getAttribute('href') != null && a[i].getAttribute('href').lastIndexOf(".pdf",a[i].length) == -1 && a[i].getAttribute('href',2).indexOf("://") >= 0 && a[i].getElementsByTagName('img').length == 0 && (a[i].getAttribute('href').indexOf("claimsandbenefits.com") == -1 || a[i].getAttribute('href').indexOf("offSite=y") >= 0))

				{

					var icon = document.createElement('img');

					icon.src = '../images/external.gif';

					icon.border = '0';

					icon.alt = 'This link takes you to an external website.';

					var iconLink = document.createElement('a');

					iconLink.href = a[i].href;

					var space = document.createTextNode(String.fromCharCode(160));

					iconLink.appendChild(icon);

					a[i].title = 'This link takes you to an external website.';	

					a[i].appendChild(space);
					a[i].appendChild(space);
					a[i].appendChild(space);
					a[i].appendChild(space);
					a[i].appendChild(icon);
										
				}

			}

			else

			{

				if (a[i].getAttribute('href') != null && a[i].getAttribute('href').lastIndexOf(".pdf",a[i].length) == -1 && a[i].getAttribute('href').indexOf("://") >= 0 && a[i].getElementsByTagName('img').length == 0 && (a[i].getAttribute('href').indexOf("claimsandbenefits.com") == -1 || a[i].getAttribute('href').indexOf("offSite=y") >= 0))

				{

					a[i].className+=a[i].className?' external':'external';
					a[i].title='This link takes you to an external website.';

				}			

			}

    }

  }
  
  }

// Puts the pdf icon by all pdf links

function pdfLink()

{

	if (document.getElementById && document.all)

	{

		var browser="IE";

	}

	else

	{

		var browser="notIE";

	}

  var e = document.getElementById('content');

  if (e)

	{

    var a=e.getElementsByTagName('a');

    for (var i=0;i<a.length;i++)

		{

			if (browser == "IE")

			{

				if (a[i].getAttribute('href') != null && a[i].getAttribute('href').lastIndexOf(".pdf",a[i].length) >= 0)

				{

					var icon = document.createElement('img');

					icon.src = '../images/pdf.gif';

					icon.border = '0';

					icon.alt = 'This link opens a pdf document.';

					var iconLink = document.createElement('a');

					iconLink.href = a[i].href;					

//Uncomment for popup
//					iconLink.onclick = function(){newWin=window.open(this.href,'pdf'+new Date().getTime(), 'toolbar=no, location=yes, resizable=yes, top=300, left=300, height=500, width=600');if(window.focus){newWin.focus()} return false;}

					var space = document.createTextNode(String.fromCharCode(160));

					
					a[i].appendChild(space);
					a[i].appendChild(icon);
					a[i].title += 'This link opens a pdf document.';
//Uncomment for popup
//					a[i].onclick = function(){newWin=window.open(this.href,'pdf'+new Date().getTime(), 'toolbar=no, location=yes, resizable=yes, top=300, left=300, height=500, width=600');if(window.focus){newWin.focus()} return false;}

					if (a[i].innerHTML.toLowerCase().indexOf("<img ",0) == -1)

					{
						
						a[i].appendChild(icon);	
									

					}

				}

			}		

			else

			{

				if (a[i].getAttribute('href') != null && a[i].getAttribute('href').lastIndexOf(".pdf",a[i].length) >= 0)

				{

          if (a[i].innerHTML.toLowerCase().indexOf("<img ",0) == -1)

					{					

						a[i].className +=a[i].className?' pdf':'pdf';

					}

					a[i].title += 'This link opens a pdf document.';
// Uncomment for popup
//					a[i].onclick = function(){newWin=window.open(this.href,'pdf'+new Date().getTime(), 'toolbar=no, location=yes, resizable=yes, top=300, left=300, height=500, width=600');if(window.focus){newWin.focus()} return false;}

				}

			}

	}

 }

}

window.onload = function()

{

	if (document.getElementById)

	{

		exitLink();

		pdfLink()
	}
}