//**************************************************************** 
// You are free to copy the "Folder-Tree" script as long as you  
// keep this copyright notice: 
// Script found in: http://www.fromnorway.net/yaylas/skjuladr.js
// Author: Satilmis Yayla (email is hidden in the code) 2002-Oct. 
//**************************************************************** 
 
// Log of changes: 
//   20021025 - Original version 
//     mail-to link with hidden email address
//     forms with mail-to fields with email address
//     progressbar 
//         
// *************************************************************** 

 
// Javascript functions offered 
// ****************************
//     
//  progressbar(prosentferdig)
//     
//  hideFormRecipient( epostnr, formnr, inputnr, confirm )
//     for use with email forms that need an input field with prefilled address
//       epostnr : number of the email already among the globals below
//       formnr  : number of the form in the page
//       inputnr : number of the field in that form
//       confirm : nonempty if an alert with the chosen email address is to be shown
//     
//  hideMailtoLink( epostnr, subjekt, linktekst, other )
//     for use with mailto: links 
//       epostnr   : number of the email already among the globals below
//       subject   : the subject of the email (may be dropped together with class)
//       linktekst : text to appear on the page as link
//       other     : in case CSS is used this may be 'class="class1"'



// Global variables 
// **************** 
 
        var usr0  = 'satilmis.yayla';
        var domn0 = 'nav'+String.fromCharCode(46)+'no';
 
        var usr1  = 'yayla';
        var domn1 = 'online'+String.fromCharCode(46)+'no';

        var usr2  = 'fnugg';
        var domn2 = 'online'+String.fromCharCode(46)+'no';

        var usr3  = 'lisa'+String.fromCharCode(46)+'yayla';
        var domn3 = 'statped'+String.fromCharCode(46)+'no';

        var usr4  = 'yayla';
        var domn4 = 'online'+String.fromCharCode(46)+'no';

        var usr5  = 'yayla';
        var domn5 = 'online'+String.fromCharCode(46)+'no';

        var first  = 'ma';
        var second = 'il';
        var third = 'to:';


// Javascript functions' code 
// *************************



        function progressbar(prosentferdig)
        {
           document.write('<!-- PROGRESS BAR START -->');
           document.write('<center><p><table cellspacing=0 cellpadding=0>');
           document.write('  <tr>');
           document.write('    <td nowrap colspan=5 bgcolor=black><img src=nothing.gif height=1><\/td>');
           document.write('  <\/tr>');
           document.write('   <tr>');
           document.write('     <td colspan=5 bgcolor=white>');
           document.write('       <table width="100%" border="0">');
           document.write('         <tr height=5>');
           document.write('           <td bgcolor=blue height=5 width='+prosentferdig+'%><font face=arial size=-2>&#160;<\/font><\/td>');
           document.write('           <td><font face=arial size=-2>&#160;<\/font><\/td>');
           document.write('         <\/tr>');
           document.write('      <\/table>');
           document.write('    <\/td>');
           document.write('   <\/tr>');
           document.write('  <tr>');
           document.write('    <td nowrap colspan=5 bgcolor=black><img src=nothing.gif height=1></td>');
           document.write('  <\/tr>');
           document.write('   <tr>');
           document.write('     <td width=40><font face=arial size=-2>0%<\/font><\/td>');
           document.write('     <td width=20 align=center><font face=arial size=-2>25%<\/font><\/td>');
           document.write('     <td width=80 align=center><font face=arial size=-2>50%<\/font><\/td>');
           document.write('     <td width=20 align=center><font face=arial size=-2>75%<\/font><\/td>');
           document.write('     <td width=40 align=right><font face=arial size=-2>100%<\/font><\/td>');
           document.write('   <\/tr>');
           document.write(' <\/table>');
           document.write('<p><\/center>');
           document.write('<!-- PROGRESS BAR END -->');
        }



        function hideMailtoLink( epostnr, subjekt, linktekst, other )
        {
           if (epostnr=='0') {
              document.write('<a href="'+first+second+third+usr0+String.fromCharCode(64)+domn0);
              if (subjekt!='') document.write('&amp;subject='+subjekt+'"'); else document.write('"');
           } else
           if (epostnr=='1') {
              document.write('<a href="'+first+second+third+usr1+String.fromCharCode(64)+domn1);
              if (subjekt!='') document.write('&amp;subject='+subjekt+'"'); else document.write('"');
           } else
           if (epostnr=='2') {
              document.write('<a href="'+first+second+third+usr2+String.fromCharCode(64)+domn2);
              if (subjekt!='') document.write('&amp;subject='+subjekt+'"'); else document.write('"');
           } else
           if (epostnr=='3') {
              document.write('<a href="'+first+second+third+usr3+String.fromCharCode(64)+domn3);
              if (subjekt!='') document.write('&amp;subject='+subjekt+'"'); else document.write('"');
           } else
           if (epostnr=='4') {
              document.write('<a href="'+first+second+third+usr4+String.fromCharCode(64)+domn4);
              if (subjekt!='') document.write('&amp;subject='+subjekt+'"'); else document.write('"');
           } else
           if (epostnr=='5') {
              document.write('<a href="'+first+second+third+usr5+String.fromCharCode(64)+domn5);
              if (subjekt!='') document.write('&amp;subject='+subjekt+'"'); else document.write('"');
           } else {
           document.write('<a href="Javascript:alert(\'The email address specified for this link is not in the list.\')"');
           }
           document.write(' title="Click to send an email using the mail program on your system"');
           document.write(' '+other);
           document.write('>'+linktekst+'<\/a>');
        }


        function hideFormRecipient( epostnr,formnr,inputnr,confirm )
        {
           if (epostnr=='0') {
              document.forms[formnr].elements[inputnr].value = usr0+String.fromCharCode(64)+domn0  ;
              if (confirm!='')
              alert('The address this form will be sent to : '+usr0+String.fromCharCode(64)+domn0) ;
           } else
           if (epostnr=='1') {
              document.forms[formnr].elements[inputnr].value = usr1+String.fromCharCode(64)+domn1  ;
              if (confirm!='')
              alert('The address this form will be sent to : '+usr1+String.fromCharCode(64)+domn1) ;
           } else
           if (epostnr=='2') {
              document.forms[formnr].elements[inputnr].value = usr2+String.fromCharCode(64)+domn2  ;
              if (confirm!='')
              alert('The address this form will be sent to : '+usr2+String.fromCharCode(64)+domn2) ;
           } else
           if (epostnr=='3') {
              document.forms[formnr].elements[inputnr].value = usr3+String.fromCharCode(64)+domn3  ;
              if (confirm!='')
              alert('The address this form will be sent to : '+usr3+String.fromCharCode(64)+domn3) ;
           } else
           if (epostnr=='4') {
              document.forms[formnr].elements[inputnr].value = usr4+String.fromCharCode(64)+domn4  ;
              if (confirm!='')
              alert('The address this form will be sent to : '+usr4+String.fromCharCode(64)+domn4) ;
           } else
           if (epostnr=='5') {
              document.forms[formnr].elements[inputnr].value = usr5+String.fromCharCode(64)+domn5  ;
              if (confirm!='')
              alert('The address this form will be sent to : '+usr5+String.fromCharCode(64)+domn5) ;
           } else {
              alert('The address this form is to be sent to is not in the list.') ;
           }
        }




// End 
// **************** 
 








