/* Compiled by Carlos Simoes from Cb2 Web Design for Webmates and WebsAwards

Suggested use:

<a href="#top" onClick="linearize(); disableInlineStyles; disableStyle(); return false; " title="Text Version">Text Version</a>

You can select functions to be used. For instance, do not use removeImages() if you still want the images to be displayed.

You can also add the following link-specific functions: disableTargetBlank(); addLinkInfo();

Based on NILS Accessibility Toolbar, available at:

http://www.nils.org.au/web_access.htm

Keep this notice here!

*/

function linearize(){
var H=[],Y={TABLE:1,TR:1,TD:1,TH:1,CAPTION:1,DIV:1},d=[],p; function R(N){var a,x,i,t; if(t=N.tagName){ t=t.toUpperCase(); for (i=0;a=H[i];++i)if(N.getAttribute(a))N.removeAttribute(a); for(i=0;x=N.childNodes[i];++i)R(x); if (Y[t])d.push(N); } } R(document.documentElement); for (i=0;N=d[i];++i) { p=N.parentNode; while(N.firstChild)p.insertBefore(N.firstChild,N); p.removeChild(N); } }

function disableStyle() {
if (!document.getElementsByTagName) return;var anchors = document.getElementsByTagName("link");for (var i=0; i<anchors.length; i++) {var anchor = anchors[i];if (anchor.getAttribute("rel") == "stylesheet") anchor.disabled = "true";}}

function disableInlineStyles() {
var H=["style"],Y={},d=[],p;function R(N){var a,x,i,t;if(t=N.tagName){t=t.toUpperCase();for(i=0;a=H[i];++i)if(N.getAttribute(a))N.removeAttribute(a);for(i=0;x=N.childNodes[i];++i)R(x);if(Y[t])d.push(N);}}R(document.documentElement);for(i=0;N=d[i];++i){p=N.parentNode;while(N.firstChild)p.insertBefore(N.firstChild,N);p.removeChild(N);}}

function removeImages() {
if(document.images.length>0){(function(){function to(c){var a,k;a=new Array;for(k=0;k<c.length;++k)a[k]=c[k];return a;}var im,img,xt;im=to(document.images);for(var i=0;i<im.length;++i){img=im[i];e=document.createElement('span');void(e.style.background='#f5deb3');void(e.style.color='navy');if(img.attributes.alt.specified!=true){xt=document.createTextNode('NoAlt!')}else{xt=document.createTextNode(img.alt+' ')}e.appendChild(xt);img.parentNode.replaceChild(e,img)}})();}else{history.go()} }

function disableTargetBlank() { 
 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("target") == "_blank") 
     anchor.target = ""; 
 } 
}

function addLinkInfo() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if(!anchor.title)
	   anchor.title='Select to open linked page'
   if(!anchor.tabIndex)
	   anchor.tabIndex= i
 } 
}

/* Generic Text-Version script ends here, code below is site-specific */

function PageTitle() {
document.write (document.title)
}

function getCurrentPageLink()
{
if (!document.getElementsByTagName) return; 
navElements=document.getElementsByTagName("div");
  for( var i = 0; i < navElements.length; i++ )
    if (navElements(i).className == 'mainbody')
	{
      navAnchors=navElements(i).getElementsByTagName("a");
      for( var i = 0; i < navAnchors.length; i++ )
	  {
      
	   if(!navAnchors(i).title)
	   navAnchors(i).title='Select to open linked page'
	   
	   if(!navAnchors(i).tabIndex)
	   navAnchors(i).tabIndex= 30+i

	    if (navAnchors(i).href == document.location.href)
		 {
          navAnchors(i).className = 'currentlink';
		  navAnchors(i).title= 'You are here...'
		 }
		}
	}
}

