function SetFontSize(NewFontSize)
   {    
   document.getElementById('page').className = NewFontSize;
   WriteCookie("FontSize",NewFontSize,1000);
   }

function SetFontSizeSmall()
   {    
   var NewFontSize ='small';
   document.getElementById('page').className = NewFontSize;
   WriteCookie("FontSize",NewFontSize,1000);
   }

function SetFontSizeMedium()
   {    
   var NewFontSize ='medium';
   document.getElementById('page').className = NewFontSize;
   WriteCookie("FontSize",NewFontSize,1000);
   }

function SetFontSizeLarge()
   {    
   var NewFontSize ='xlarge';
   document.getElementById('page').className = NewFontSize;
   WriteCookie("FontSize",NewFontSize,1000);
   }

function ApplyFontSize()
   {
   var CurrentFontSize ='medium';
   if ( ReadCookie('FontSize') ) 
      {
      var CurrentFontSize = ReadCookie('FontSize');
      SetFontSize(CurrentFontSize);
      }
   else
      {
      SetFontSize(CurrentFontSize);
      }
   }

function WriteCookie(cookie_name,value,days)
   {
   if ( days )
      {
      var date = new Date();
      date.setTime(date.getTime()+(days*24*60*60*1000));  
      var expires = "; expires="+date.toGMTString();
      }
   else 
      expires = "";
   
   document.cookie = cookie_name+"="+value+expires+"; path=/";
   }
   
function ReadCookie(cookie_name)
   {
   var regexpr = cookie_name+ '=(.*?)(;|$)';
   var results = document.cookie.match (regexpr);
   if ( results )
      {
      return ( unescape ( results[1] ) );
      }
   else 
      { 
      return null;
      }
   }

function ShowImage(val1)
{
   var page = val1;
   var prop = 'width=500, height=500, left=20, top=20, location=no, scrollbars=yes, menubar=no, toolbar=no, resizable=yes';
   var win  = window.open(page,"Image", prop);
   win.focus();
}

function OpenWin(val1,val2,val3,val4,val5,val6)
{
   var page = val1;
   var prop = 'width=' + val2 + ', height=' + val3 + ', left=' + val4 + ', top=' + val5 + ', location=no, scrollbars=yes, menubar=no, toolbar=no, resizable=yes';
   var win  = window.open(page,val6, prop);
   win.focus();
}
