
function comment(num,name)
{
document.com.respondtocomment.value=num;
document.com.showTitle.value=name;
}

var min=8;
var max=18;
function increaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
}
function decreaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
}
   var posx;var posy;


function showNote(e,xx){
var note=document.getElementById(xx);
var el = e.target || e.srcElement;
var opacity=10;
// Get mouse click co-ords
var ePos = {x:0, y:0};
if ('number' == typeof e.pageX){
ePos.x = e.pageX;
ePos.y = e.pageY;
} else if ('number' == typeof e.clientX){
ePos.x = e.clientX + document.body.scrollLeft
+ document.documentElement.scrollLeft;
ePos.y = e.clientY + document.body.scrollTop
+ document.documentElement.scrollTop;
}
//alert(ePos.y);
// Get image top left co-ords

                        // gets note1 element
                      
						

                     note.style.left=ePos.x-50;
                     note.style.top=ePos.y+50;
                        // makes note1 element visible
                     //
					 
    note.opacity = (opacity / 100); 
    note.MozOpacity = (opacity / 100); 
    note.KhtmlOpacity = (opacity / 100); 
    note.filter = "alpha(opacity=" + opacity + ")"; note.style.visibility='visible';

            }

            function hideNote(xx){
                        // gets note1 element
                        var note=document.getElementById(xx);
                        // hides note1 element
                        note.style.visibility='hidden';
            }
function AddToBookmarks (url,title) { window.external.AddFavorite(url,title); }


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->

function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag) 
{
  // the highlightStartTag and highlightEndTag parameters are optional
  if ((!highlightStartTag) || (!highlightEndTag)) {
    highlightStartTag = "<font style='color:blue; background-color:yellow;'>";
    highlightEndTag = "</font>";
  }
  
  var newText = "";
  var i = -1;
  var lcSearchTerm = searchTerm.toLowerCase();
  var lcBodyText = bodyText.toLowerCase();
    
  while (bodyText.length > 0) {
    i = lcBodyText.indexOf(lcSearchTerm, i+1);
    if (i < 0) {
      newText += bodyText;
      bodyText = "";
    } else {
      // skip anything inside an HTML tag
      if (bodyText.lastIndexOf(">", i) >= bodyText.lastIndexOf("<", i)) {
        // skip anything inside a <script> block
        if (lcBodyText.lastIndexOf("/script>", i) >= lcBodyText.lastIndexOf("<script", i)) {
          newText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, searchTerm.length) + highlightEndTag;
          bodyText = bodyText.substr(i + searchTerm.length);
          lcBodyText = bodyText.toLowerCase();
          i = -1;
        }
      }
    }
  }
  
  return newText;
}


function highlightSearchTerms(searchText, treatAsPhrase, warnOnFailure, highlightStartTag, highlightEndTag)
{
  if (treatAsPhrase) {
    searchArray = [searchText];
  } else {
    searchArray = searchText.split(" ");
  }
  
  if (!document.body || typeof(document.body.innerHTML) == "undefined") {
    if (warnOnFailure) {
      alert("Sorry, for some reason the text of this page is unavailable. Searching will not work.");
    }
    return false;
  }
  
  var bodyText = document.body.innerHTML;
  for (var i = 0; i < searchArray.length; i++) {
    bodyText = doHighlight(bodyText, searchArray[i], highlightStartTag, highlightEndTag);
  }
  
  document.body.innerHTML = bodyText;
  return true;
}


/*
 * This displays a dialog box that allows a user to enter their own
 * search terms to highlight on the page, and then passes the search
 * text or phrase to the highlightSearchTerms function. All parameters
 * are optional.
 */
function searchPrompt(defaultText, treatAsPhrase, textColor, bgColor)
{
  // This function prompts the user for any words that should
  // be highlighted on this web page
  if (!defaultText) {
    defaultText = "";
  }
  
  // we can optionally use our own highlight tag values
  if ((!textColor) || (!bgColor)) {
    highlightStartTag = "";
    highlightEndTag = "";
  } else {
    highlightStartTag = "<font style='color:" + textColor + "; background-color:" + bgColor + ";'>";
    highlightEndTag = "</font>";
  }
  
  return highlightSearchTerms(defaultText, treatAsPhrase, true, highlightStartTag, highlightEndTag);
}

 
function highlightGoogleSearchTerms(referrer)
{
  // This function has only been very lightly tested against
  // typical Google search URLs. If you wanted the Google search
  // terms to be automatically highlighted on a page, you could
  // call the function in the onload event of your <body> tag, 
  // like this:
  //   <body onload='highlightGoogleSearchTerms(document.referrer);'>
  
  //var referrer = document.referrer;
  if (!referrer) {
    return false;
  }
  
  var queryPrefix = "q=";
  var startPos = referrer.toLowerCase().indexOf(queryPrefix);
  if ((startPos < 0) || (startPos + queryPrefix.length == referrer.length)) {
    return false;
  }
  
  var endPos = referrer.indexOf("&", startPos);
  if (endPos < 0) {
    endPos = referrer.length;
  }
  
  var queryString = referrer.substring(startPos + queryPrefix.length, endPos);
  // fix the space characters
  queryString = queryString.replace(/%20/gi, " ");
  queryString = queryString.replace(/\+/gi, " ");
  // remove the quotes (if you're really creative, you could search for the
  // terms within the quotes as phrases, and everything else as single terms)
  queryString = queryString.replace(/%22/gi, "");
  queryString = queryString.replace(/\"/gi, "");
  
  return highlightSearchTerms(queryString, false);
}


var cache1, cache2;
cache1 = new Image();
cache2 = new Image();
cache1.src ='plus.gif';
cache2.src ='minus.gif';
// open/close a section of the Tree
function ToggleDisplay(divName, buttonID)
{
	if (divName.style.display == 'none')
		SetDisplay(1, divName, buttonID);
	else
		SetDisplay(0, divName, buttonID);
}
// open/close a section of the Tree
function SetDisplay(OnOff, divName, buttonID)
{
	if (OnOff)
	{
		if(buttonID.style.display == '')
		{
			divName.style.display = '';
			buttonID.src = cache2.src;
		}
	}
	else
	{	
		divName.style.display = 'none';
			buttonID.src = cache1.src;
	}
}



function SetDisplaylf(nm)
{
			SEARCH.style.display = '';
			NEWS.style.display = 'none';
			nw.className="backrt";
			se.className="forward";
		}
		
	function SetDisplayrt(nm)
{
			NEWS.style.display = '';
			SEARCH.style.display = 'none';
			se.className="backlf";
			nw.className="forward";
		}

