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 setCookie(name, value, expires, path, domain, secure) {
  document.cookie = name + "=" + escape(value) +
  ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
  ((path == null) ? "" : "; path=" + path) +
  ((domain == null) ? "" : "; domain=" + domain) +
  ((secure == null) ? "" : "; secure");
}

// An adapxation of Dorcht's function for deleting a cookie.
function delCookie (name,path,domain) {
  if (readCookie(name)) {
    document.cookie = name + "=" +
    ((path == null) ? "" : "; path=" + path) +
    ((domain == null) ? "" : "; domain=" + domain) +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}
function delAllCookie() {
if (document.cookie != "")
    {
        var cookieInfo, cookieData;
        var expireDate = new Date();
       // if (confirm("Are you sure you want to delete the cookies?"))
        //{
            cookieInfo = document.cookie.split("; ");
            // Set the expiration date to yesterday
            expireDate.setDate(expireDate.getDate() - 1);
            for (counter=0; counter<cookieInfo.length; counter++)
            {
                // Get the cookie name
                cookieData = cookieInfo[counter].split("=")[0];
                // Add a null value and the expiration date
                cookieData += "=;expires=" + expireDate.toGMTString();
                // Expire the cookie
                document.cookie = cookieData; 
           // }
        }
    }
  }   
function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
 
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}
function check(someArray, someValue) {
 for (var j = 0; j < someArray.length; j++) {  
      if (someArray[j] == someValue.toLowerCase() ) 
	 //alert(someArray[j]+ someValue.toLowerCase());
	     return true; 
     } return false; 
 }
  
function increase(fontIncrease, orig){ 
var currentElement, currentFontSize, newFontSize, orig;  
 
if (document.getElementsByTagName)  
   {  
      tags1 =   new Array ('div','h2' ,'p', 'a','span','td', "ul");  
      tags2 =  new Array ('h1');
	  tags = tags1.concat(tags2);
      for (j = 0; j < tags.length; j ++)  
      {  

        var tagElements = document.getElementById('maintextcontainer').getElementsByTagName(tags[j]);  
        
         for (i = 0; i < tagElements.length; i ++)  
         {  
            currentElement = tagElements[i]; 
		
            if(check(tags2,currentElement.tagName)){				
		    if (parseInt(orig)) currentFontSize = (parseInt(12))+ 'px'; 
		else{
			   if(parseInt(readCookie(currentElement.tagName))>0){ 			    
			    currentFontSize=(parseInt(readCookie(currentElement.tagName))) + 'px';			 
			   } else{
			   if(parseInt(currentElement.style.fontSize)>0)
			   currentFontSize = parseInt(currentElement.style.fontSize); 
			   else
			    currentFontSize = (parseInt(12))+ 'px'; 
			  }
			 } 
			 
			}else{
             // currentFontSize = parseInt(currentElement.style.fontSize); 
              if (parseInt(orig)) currentFontSize = (parseInt(11)); 
		else{
  //  alert(parseInt(fontIncrease));
if(parseInt(readCookie(currentElement.tagName))>0 && parseInt(fontIncrease)==0 ){ 
			
				currentFontSize=(parseInt(readCookie(currentElement.tagName))) + 'px';			
				} else{
			    if(parseInt(currentElement.style.fontSize)>0)
			     currentFontSize = parseInt(currentElement.style.fontSize); 
			   else
			    currentFontSize = (parseInt(11))+ 'px'; 
				}
			}

			 }
//alert(currentFontSize);
        
            newFontSize = parseInt(currentFontSize) + parseInt(fontIncrease); // alert(newFontSize); 
			//alert(parseInt(currentElement.style.fontSize));
          if (!parseInt(currentElement.style.fontSize)) currentElement.style.fontSize ='11px'; 
 if (parseInt(currentElement.style.fontSize)>10 && parseInt(fontIncrease)==parseInt('-1') ) {
            currentElement.style.fontSize = newFontSize + 'px'; 
		    setCookie(currentElement.tagName, newFontSize);  
}
 if (parseInt(currentElement.style.fontSize)<17 && parseInt(fontIncrease)==parseInt('1') ) {
            currentElement.style.fontSize = newFontSize + 'px'; 
		    setCookie(currentElement.tagName, newFontSize);  
}
if(parseInt(fontIncrease)==0) {
currentElement.style.fontSize = newFontSize + 'px'; 
		    setCookie(currentElement.tagName, newFontSize);  
}
         }  
      } 
       
   } 
 }  