<!-- Part of javalessons.com (c)2007 SEMM(NL) All rights reserved Author:P.Hamaker For educational purposes only.-->
<html>
<head>
<!--  <script type="text/javascript" src="separatefile.js"></script> -->
<script type="text/javascript">
function rep( s, n )
{
 var i=0;
 while ( i < n )
 {
  document.write( s );
  i++ ;
 }
}
function repret( s, n )
{
 var i, str='' ;
 for ( i = 0;  i < n ; i++ )
 {
  str += s ;
 }
 return str ;
}
function calcpow( nr, pw )
{
 var res = 0 ;
 if ( pw == 0 ) return 1 ;
 if ( pw == 1 ) return nr ;
 res = nr ;
 for ( var i = 2 ;  i <= pw ; i++ )
 {
  res = res * nr ;
 }
 return res ;
}
function addVAT( amt )
{
 var vatperc = 0.20 ;
 var amtinc = amt * ( 1 + vatperc ) ;
 amtinc = amtinc.toFixed(2);
 return amtinc ;
}

</script>
</head>
<body style="font-family: sans-serif; font-size: large; margin-left: 20; margin-top: 30">
JavaScript Lesson Functions<p>

<script type="text/javascript">
rep( '=', 7 ) ;
document.write( '<br>' );
var str = repret( 'ha', 4  ) ;
document.write( str );
document.write( '<br>' + repret( '@', 5  ) );

document.write( '<br>' + calcpow( 10 , 6 )  );
document.write( '<br>' + calcpow( 0.2 , 8 )  );

document.write( '<br>' + addVAT( 11.11 )  );
</script>
<p><a href="http://javalessons.com" target="_top"><tt>JavaLessons.com</tt></a>
</body></html>