
function decode_url(url)
{ 
 return unescape(url.replace(/\%2A/g,'')); 
} 

function refreshDiv(content,divname)
{
  if (document.layers)
  {
    el = document.layers[divname].document;
    with (el)
    {
      open();
      write(content);
      close();
    }
  }
  else
  {
    if (document.all)
    {
      el = document.all[divname];
      el.innerHTML = content;
    }
    else
    {
      if (document.getElementById)
      {
        el = document.getElementById(divname);
        el.innerHTML = content;
      }
    }
  }
}


function GetValueOfField(aTable,aRow,aField)
{
  if ( (aTable != "") && (aTable != null) )
    {
      var i;
       for (i=0; i <= aTable[0].length; i++)
        if (aTable[0][i] == aField)
        { 
         return aTable[aRow][i]
         break;
        }  
     }
}      
 
var theTable;
var i;
var cursus = "";


function refresh_scrollanle(content,functie,argument){
  var el;
  if (document.layers)
  {
    el = document.layers["scrollanle"].document;
  }
  else
  {
    if (document.all)
    {
      el = document.all["scrollanle"];
    }
    else
    {
      if (document.getElementById)
      {
        el = document.getElementById("scrollanle");
      }
    }
  }    
  el.scrollTop = 0;
  refreshDiv(content,"scrollanle")
}

function move_scrollanle_top() {
  var el;
  if (document.layers)
  {
    el = document.layers["scrollanle"].document;
  }
  else
  {
    if (document.all)
    {
      el = document.all["scrollanle"];
    }
    else
    {
      if (document.getElementById)
      {
        el = document.getElementById("scrollanle");
      }
    }
  }    
  el.scrollTop = 0;
}
 
function OnClickReferentie(filter) 
  {
    theTable = Folder
    theTable = Where(theTable,"Referentie","=",filter);
    content =  '<table width="560" cellSpacing="0" cellPadding="0"><tbody><tr><td  class="cursustitle">'
    content += theTable[2][sys_getFieldIndex(theTable,"cursustitel")] + '</td></tr><tr><td class="cursussubtitle">'
    content += theTable[2][sys_getFieldIndex(theTable,"cursussubtitel")] + '</td></tr><tr><td height="20" class="cursusmet">'
    content += 'met</td></tr><tr><td class="cursuslesgever">' + theTable[2][sys_getFieldIndex(theTable,"lesgever")] 
    content += '</td></tr><tr><td height="20">&nbsp;</td></tr><tr><td class="cursustekst">'
    content += theTable[2][sys_getFieldIndex(theTable,"cursustekst")] + '</td></tr><tr><td height="20"></td></tr><tr><td>'
    content += '<table cellSpacing="0" cellPadding="0" width="560"><tbody><tr><td width="40%" class="cursusinfo">'
    content += 'Datum:</td><td width="60%" class="cursusinfo">' + theTable[2][sys_getFieldIndex(theTable,"datumveld")]
    content += '</td></tr></tbody></table></td></tr><tr><td height="20"></td></tr><tr><td>'
    content += '<table cellSpacing="0" cellPadding="0" width="560"><tbody><tr><td width="40%"  class="cursusinfo">'
    content += 'Prijs:</td><td width="60%"  class="cursusinfo">'
    content += '€'+ theTable[2][sys_getFieldIndex(theTable,"prijsL")]+ ' leden, €'+ theTable[2][sys_getFieldIndex(theTable,"prijsNL")]+' niet-leden'
    content += '</td></tr></tbody></table></td></tr><tr><td><table cellSpacing="0" cellPadding="0" width="560"><tbody><tr>'
    content += '<td width="40%"  class="cursusinfo">Betaald voor '+ theTable[2][sys_getFieldIndex(theTable,"kortingsdatum")] + '</td>'
    content += '<td width="60%"  class="cursusinfo">€'+theTable[2][sys_getFieldIndex(theTable,"prijsLk")]+' leden, €'+ theTable[2][sys_getFieldIndex(theTable,"prijsNLk")] + ' niet-leden'
    content += '</tr></tbody></table></td></tr><tr><td height="20"></td></tr><tr><td><table cellSpacing="0" cellPadding="0" width="560">'
    content += '<tbody><tr><td width="40%"  class="cursusinfo">Meebrengen:</td><td width="60%"  class="cursusinfo">'
    content += theTable[2][sys_getFieldIndex(theTable,"meeneemveld")] + '</td></tr></tbody></table></td></tr><tr><td height="20"></td></tr><tr><td>'
    content += '<table cellSpacing="0" cellPadding="0" width="560"><tbody><tr><td width="40%"  class="cursusinfo">'
    content += 'Codenummer:</td><td width="60%" class="cursusinfo">' + theTable[2][sys_getFieldIndex(theTable,"Referentie")] + '</td></tr></tbody></table>'
    content += '</td></tr><tr><td height="20"></td></tr><tr ><td><table cellSpacing="0" cellPadding="0" width="560"><tbody><tr>'
    content += '<td width="40%" class="cursusinfo">Plaats:</td><td width="60%" class="cursusinfo">'
    content += '<a href="javascript:'+ 'OnClickWegbeschrijving' +'(&quot;'+theTable[2][sys_getFieldIndex(theTable,"plaats")]+'&quot;);">'
    content += theTable[2][sys_getFieldIndex(theTable,"plaatsveld")] + '</a></td></tr></tbody></table></td></tr><tr><td height="21"></td></tr><tr>'
    content += '<td height="21" valign="middle" align="center">'
    content += '</td></tr><tr><td height="21"></td></tr></tbody></table>'
    refresh_scrollanle(content,"OnClickReferentie",filter)
    cursus = filter;
  }

  function OnClickInfoLesgever(filter) 
  {
   content = 'informatie over lesgever <BR>' + filter + '<BR>nog te bepalen'
   refresh_scrollanle(content,"OnClickInfoLesgever",filter)

  }

  function OnClickWegbeschrijving(filter) 
  {
    window.location.href = "../menu_route/index.html"
  }



  function OnClickLocatie(filter) 
  {
	theTable = centra  
    theTable = Where(theTable,"plaats","=",filter)
    var locatie = theTable[2][sys_getFieldIndex(theTable,"locatie")]
    theTable = Select( Folder,'lesgever','cursustitel','Referentie','Begindatum','thema','Aantallessen','plaats', 'plaatsveld');
    theTable = Where(theTable,"plaats","=",filter);
    theTable = OrderBy(theTable,'Id',"ASC");
    content = DisplayResults(locatie)
    refresh_scrollanle(content,"OnClickLocatie",filter)
  }


  function OnClickThema(filter) 
  {
    theTable = Select( Folder,'lesgever','cursustitel','Referentie','Begindatum','thema','Aantallessen');
    theTable = Where(theTable,"thema","=",filter);
    theTable = OrderBy(theTable,'Id',"ASC");
    content = DisplayResults(filter)
    refresh_scrollanle(content,"OnClickThema",filter)
  }

  function OnClickRubriek(filter) 
  {
    theTable = Select( Folder,'lesgever','cursustitel','Referentie','Begindatum','rubriek','subrubriek','Aantallessen');
    theTable = Where(theTable,"subrubriek","=",filter);
    theTable = OrderBy(theTable,'Id',"ASC");
    content = DisplayResults(filter)
    refresh_scrollanle(content,"OnClickRubriek",filter)
  }

  function OnClickCursustitel(filter) 
  {
    theTable = Select( Folder,'lesgever','cursustitel','Referentie','Begindatum','thema','Aantallessen');
    theTable = Where(theTable,"cursustitel","=",filter);
    theTable = OrderBy(theTable,'Id',"ASC");
    content = DisplayResults(filter)
    refresh_scrollanle(content,"OnClickCursustitel",filter)
  }

  function OnClickLesgever(filter) 
  {
    theTable = Select( Folder,'lesgever','cursustitel','Referentie','Begindatum','Aantallessen');
    theTable = Where(theTable,"lesgever","=",filter);
    theTable = OrderBy(theTable,'Id',"ASC");
    content = DisplayResults(filter)
    refresh_scrollanle(content,"OnClickLesgever",filter)

  }


function DisplayLesgever(filter) 
  {
  var content = ""
  var RecordsCount = theTable.length - HEADROWS;
  content +=  '<BR><BR><p class="cursusmenutitle">LESGEVERS - ALFABETISCH OP ACHTERNAAM<BR>'
  if ( filter != null) {
    content += 'voor zoekterm ' 
    content += '<BR>' + filter + '<BR></p>'
  }  
  else
    content += '</p><BR>'
 
  for (i=HEADROWS; i < theTable.length; i++)
      {
         content +='<p class="cursusmenu"><A href="javascript:'+ 'OnClickLesgever'+'(&quot;'+theTable[i][sys_getFieldIndex(theTable,"lesgever")]+'&quot;);">'
         content +=formatField( theTable[i][0], theTable[1][0]);
         content +="</A></p>";
      }
   return content;   
  }

function DisplayThema() 
  {
  var content = ""
  var RecordsCount = theTable.length - HEADROWS;
  content =  '<BR><BR><p class="cursusmenutitle">THEMA - ALFABETISCH<BR></p>'
  for (i=HEADROWS; i < theTable.length; i++)
      {
      for (j=0; j < theTable[0].length; j++)
        {
          content +='<p class="cursusmenu"><A href="javascript:'+ 'OnClickThema'+'(&quot;'+theTable[i][sys_getFieldIndex(theTable,"thema")]+'&quot;);">'
          content +=formatField( theTable[i][j], theTable[1][j]);
          content +="</A></p>";
        }
      }
   return content;   
  }

function DisplayRubriek() 
  {
  var content = ""
  var RecordsCount = theTable.length - HEADROWS;
  content =  '<BR><BR><p class="cursusmenutitle">THEMA - ALFABETISCH<BR></p>'
  for (i=HEADROWS; i < theTable.length; i++)
      {
      for (j=0; j < theTable[0].length; j++)
        {
          content +='<p class="cursusmenu"><A href="javascript:'+ 'OnClickRubriek'+'(&quot;'+theTable[i][sys_getFieldIndex(theTable,"subrubriek")]+'&quot;);">'
          content +=formatField( theTable[i][j], theTable[1][j]);
          content +="</A></p>";
        }
      }
   return content;   
  }


function DisplayCursustitel() 
  {
  var content = ""
  var RecordsCount = theTable.length - HEADROWS;
  content +=  '<BR><BR><p class="cursusmenutitle">ALLE TITELS - ALFABETISCH<BR></p>'
  for (i=HEADROWS; i < theTable.length; i++)
      {
       content +='<p class="cursusmenu"><A href="javascript:'+ 'OnClickCursustitel'+'(&quot;'+theTable[i][sys_getFieldIndex(theTable,"cursustitel")]+'&quot;);">'
       content +=formatField( theTable[i][0], theTable[1][0]);
       content +="</A></p>";
      }
   return content;   
  }

function DisplayLocatie() 
  {
  var content = ""
  var RecordsCount = theTable.length - HEADROWS;
  content +=  '<BR><BR><p class="cursusmenutitle">ALLE LOCATIES - ALFABETISCH<BR></p>'
  for (i=HEADROWS; i < theTable.length; i++)
      {
        content +='<p class="cursusmenu"><a href="javascript:'+ 'OnClickLocatie' +'(&quot;'+theTable[i][sys_getFieldIndex(theTable,"plaats")]+'&quot;);">'
        content +=formatField( theTable[i][sys_getFieldIndex(theTable,"locatie")], theTable[1][sys_getFieldIndex(theTable,"locatie")]);
        content +="</A></p>";
      }
   return content;   
  }

function DisplayResults(voor,wat) 
  {
  var content = ""
  var RecordsCount = theTable.length - HEADROWS;
  content = '<BR><BR><p class="cursusmenutitle">ALLE CURSUSSEN CHRONOLOGISCH<BR>'
  if ( voor != null) {
    content += 'voor '
    if (wat != null)
      content += wat
    content += '<BR>' + voor + '<BR>'
  }  
  else
    content += '</p><BR>'
  for (i=HEADROWS; i < theTable.length; i++)
    {
     if (theTable[i][0] != "" ) 
      {
        if (theTable[i][5] == "1")
          content += '<p class="cursusmenu">op '
        else
          content += '<p class="cursusmenu">vanaf ' 
        content += formatField( theTable[i][3], theTable[1][3]) + '<br>' 
        content +='<A href="javascript:'+ 'OnClickReferentie'+'(&quot;'+theTable[i][sys_getFieldIndex(theTable,"Referentie")]+'&quot;);">'
        content += formatField( theTable[i][1], theTable[1][1]) + '(' + formatField( theTable[i][2], theTable[1][2]) + ')</A><BR>'
        content +='met <A href="javascript:'+ 'OnClickInfoLesgever'+'(&quot;'+theTable[i][sys_getFieldIndex(theTable,"lesgever")]+'&quot;);">'
        
        content += formatField( theTable[i][0], theTable[1][0]) + '</A><BR></P>'
        }  
      }
   return content;   
  }


function DisplayZoekterm() {
  var content = ""
  content += '<form name="queryform" onSubmit="SearchQueryExecute();return false;">'
  content +='<table><tbody><tr><td vAlign="top">&nbsp;</td></tr><tr><td vAlign="top"><p class="cursusmenutitle" align="center">ZOEK RESULTATEN</p></td></tr>'
  content +='<tr><td vAlign="top"><p align="center"><input tabIndex="1" size="55" name="thestring"> &nbsp;</p></td></tr>'
  content +='<tr><td vAlign="top"><div align="center"><table cellSpacing="0" cellPadding="0" width="100%" border="0">'
  content +='<tbody><tr><td width="10%"></td><td width="80%" class="cursustekst"><input tabIndex="2" type="radio" CHECKED value="AND" name="op">'
  content +='met alle woorden</td><td width="10%"></td></tr><tr><td width="10%"></td><td width="80%" class="cursustekst"><input tabIndex="3" type="radio" value="Phrase" name="op">'
  content +='met de exacte woordcombinatie</td><td width="10%"></td></tr><tr><td width="10%"></td><td width="80%" class="cursustekst"><input tabIndex="4" type="radio" value="OR" name="op">'
  content +='met een van deze woorden</td><td width="10%"></td></tr></tbody></table></div></td></tr>'
  content +='<tr><td vAlign="top" align="center"><p class="cursusmenutitle" align="center">in één van de volgende velden</p></td></tr>'
  content +='<tr><td vAlign="top"><div align="center"><table cellSpacing="0" cellPadding="0" width="100%" border="0">'
  content +='<tbody><tr><td width="10%"></td><td width="80%" class="cursustekst"><input tabIndex="6" type="radio" CHECKED value="cursustitel" name="waar">'
  content +='cursustitels</td><td width="10%"></td></tr><tr><td width="10%"></td><td width="80%" class="cursustekst"><input tabIndex="7" type="radio" value="lesgever" name="waar">'
  content +='lesgevers</td><td width="10%"></td></tr><tr><td width="10%"></td><td width="80%" class="cursustekst"><input tabIndex="8" type="radio" value="cursustekst" name="waar">'
  content +='cursustekst</td><td width="10%"></td></tr><tr><td width="10%"></td><td width="80%" class="cursustekst"><input tabIndex="9" type="radio" value="locatie" name="waar">'
  content +='lesplaats</td><td width="10%"></td></tr></tbody></table></div></td></tr><tr><td vAlign="top">'
  content +='<p align="center">&nbsp;</p></td></tr><tr><td vAlign="top">'
  content +='<p align="center"><input onclick="SearchQueryExecute();" type="button" value="zoeken"></p></td></tr>'
  content +='</tbody></table></form>'
  return content;
}

function refreshScrollanle(a){


var content = ""
if (a != "inschrijven") 
  cursus = ""
if (a=="algemeen") {
  content +='<p>Het hele jaar door organiseren  we cursussen<br>en trainingen op het vlak van persoonlijke groei,<br>'
  content +='bewustwording,  natuurlijke geneeswijzen, massage,<br>lichaamswerk, dans, stemwerk&hellip;</p>'
  content +='<p>Met bovenstaande knoppen kan je \'surfen\'<br>door ons actuelen <a href="thema.html" target="_self">aanbod</a>.</p>'
  content +='<p>We kunnen ook op aanvraag cursussen verzorgen<br>voor groepen of organisaties.</p>'
  content +='<p>Wil je graag  op de hoogte blijven?<br>Onze activiteitenkalender staat ieder kwartaal<br>in ons <a href="#"> tijdschrift</a>'
  content +=', die je op aanvraag gratis<br>toegestuurd kan krijgen.</p><p><a href="javascript:refreshScrollanle(&quot;inschrijven&quot;)" class="style3">INSCHRIJVEN &gt;&gt;</a> </p>'
  }
if (a=="thema") {
  theTable = Distinct("thema", Folder);
  theTable = OrderBy(theTable,'thema',"ASC");
  content = DisplayThema();
  }
if (a=="rubriek") {
  theTable = Distinct("subrubriek", Folder);
  theTable = OrderBy(theTable,'subrubriek',"ASC");
  content = DisplayRubriek();
  }
if (a=="lesgever") {
  theTable = lesgever
  theTable = OrderBy(theTable,'lesgeverachternaam',"ASC");
  content = DisplayLesgever();
  }
if (a=="cursustitel") {
  theTable =  Distinct("cursustitel", Folder);
  theTable = OrderBy(theTable,'cursustitel',"ASC");
  content = DisplayCursustitel();
  }
  
if (a=="Begindatum")
  {
    theTable = Select( Folder,'lesgever','cursustitel','Referentie','Begindatum','thema','Aantallessen');
    theTable = OrderBy(theTable,'Id',"ASC");
    content = DisplayResults();
  }
if (a=="locatie")
  {
    theTable = centra;
    theTable = OrderBy(theTable,'locatie',"ASC");
    content = DisplayLocatie();
  }  
if (a=="Zoekterm")
  {
  content = DisplayZoekterm();
  }  
if (a =="reply")
  {
   content = "SENDING SENDING OK"
  }  
refresh_scrollanle(content,"refreshScrollanle",a);
if (a=="Zoekterm")
  document.forms["queryform"].thestring.focus();
}

function SearchQueryExecute(theString,theOp,veld)
{

var i=0;

 if (theString == null)  {
   var f = document.forms["queryform"];
   theString = f.thestring.value;
   theOp = "AND";
   while (i<f.op.length)
   {
    if (f.op[i].checked)
      theOp = f.op[i].value;
    i++;
   }
   i = 0;
   veld = ""
   while (i<f.waar.length)
    {
     if (f.waar[i].checked)
      veld = f.waar[i].value;
     i++;
    }
 }  
 theString = theString.replace("+"," ");
 theString = theString.replace(/^\s+/i , ""); //left trim
 theString = theString.replace(/\s+$/i , ""); //right trim
 theString = theString.replace(/\s+/i , " "); //avoids multiple white spaces
 if (theString == "")
 {
   if (SearchQueryExecute.arguments.length == 0)
    alert("Gelieve iets in te geven naar waar gezocht moet worden");
  f.thestring.focus();
  return false;
 }
 
var searchTable

if (veld == "lesgever")
 {
  searchTable = Select( lesgever, 'lesgever');
 } 
else if (veld == "cursustekst")
  {
    searchTable = Select( Folder,'lesgever','cursustitel','Referentie','Begindatum','thema','cursustekst');
  }
else if (veld == "locatie")
  { 
    searchTable = centra;
  }
else
  { 
    searchTable = Select( Folder,'lesgever','cursustitel','Referentie','Begindatum','thema');
  }
 
 var rt = new Array;    // temporary table
 var aRegExp;
 var strArr;

 theTable = searchTable;
 if (theOp=="Phrase")
 {
   aRegExp = "/"+theString+"/gi";
   theTable = Where( theTable, veld, "LIKE", aRegExp );
 }
 else
 {
   strArr=theString.split(' ');
   var k=0;
   while (k<strArr.length)
   {
    aRegExp = "/"+strArr[k]+"/gi";
    rt = Where( theTable, veld, "LIKE", aRegExp );
    if (k==0)
       theTable = From( rt );
    else
    {
     if (theOp=="AND")
         theTable = Intersect( theTable, rt );
     if (theOp=="OR")
         theTable = Union( theTable, rt );
    }
    rt = null;
    ++k;
   }
 }
 var content = ""
 if (veld == "lesgever")
 {
  theTable = OrderBy(theTable,'lesgeverachternaam',"ASC")
  content = DisplayLesgever(theString);
 } 
 else if (veld == "cursustekst")
  {
    theTable = OrderBy(theTable,'Id',"ASC")
    content = DisplayResults(theString,"zoekterm");
  }
 else  if (veld == "locatie")
  { 
    theTable = OrderBy(theTable,'locatie',"ASC")
    content = DisplayLocatie(theString,"zoekterm");
  }
 else
  { 
    theTable = OrderBy(theTable,'Id',"ASC")
    content = DisplayResults(theString,"zoekterm");
  }
  refresh_scrollanle(content,"SearchQueryExecute","Zoekterm",theString,theOp,veld)
}


function CheckTelefoon(input) {
  var chrs = new Array("1","2","3","4","5","6","7","8","9","0","/","(",")",".", " ");
  var ok = true;
  var found = false;
  var chr = ""
  for (var i = 0; i < input.length; i++) 
	{
      chr = input.charAt(i);
      for (var j = 1; j < chrs.length; j++)
	  {
        if (chr == chrs[j]) found = true;
      }
      if (!found) ok = false;
	}
  return(ok);
}

function checkEmail ( addressField ) {
	
    var returnvalue = true;
    if ( stringEmpty ( addressField ) )
        returnvalue = false;
    else if ( noAtSign ( addressField ) )
        returnvalue = false;
    else if ( nothingBeforeAt ( addressField ) )
        returnvalue = false;
    else if ( noLeftBracket ( addressField ) )
        returnvalue = false;
    else if ( noRightBracket ( addressField ) )
       returnvalue = false;
	else if ( noValidPeriod ( addressField ) )
       returnvalue = false;
    else if ( noValidSuffix ( addressField ) )
       returnvalue = false;
    return(returnvalue);
}

function linkCheckValidation ( formField ) {
    if ( checkValidation ( formField ) == true ) {
        alert ( 'E-Mail Address Validates OK' );
    }

    return ( false );
}

function stringEmpty ( address ) {
    // CHECK THAT THE STRING IS NOT EMPTY
    if ( address.length < 1 ) {
        return ( true );
    } else {
        return ( false );
    }
}

function noAtSign ( address ) {
    // CHECK THAT THERE IS AN '@' CHARACTER IN THE STRING
    if ( address.indexOf ( '@', 0 ) == -1 ) {
        return ( true )
    } else {
        return ( false );
    }
}

function nothingBeforeAt ( address ) {
    // CHECK THERE IS AT LEAST ONE CHARACTER BEFORE THE '@' CHARACTER
    if ( address.indexOf ( '@', 0 ) < 1 ) {
        return ( true )
    } else {
        return ( false );
    }
}

function noLeftBracket ( address ) {
    // IF EMAIL ADDRESS IN FORM 'user@[255,255,255,0]', THEN CHECK FOR LEFT BRACKET
    if ( address.indexOf ( '[', 0 ) == -1 && address.charAt ( address.length - 1 ) == ']' ) {
        return ( true )
    } else {
        return ( false );
    }
}

function noRightBracket ( address ) {
    // IF EMAIL ADDRESS IN FORM 'user@[255,255,255,0]', THEN CHECK FOR RIGHT BRACKET
    if ( address.indexOf ( '[', 0 ) > -1 && address.charAt ( address.length - 1 ) != ']' ) {
        return ( true );
    } else {
        return ( false );
    }
}

function noValidPeriod ( address ) {
    // IF EMAIL ADDRESS IN FORM 'user@[255,255,255,0]', THEN WE ARE NOT INTERESTED
    if ( address.indexOf ( '@', 0 ) > 1 && address.charAt ( address.length - 1 ) == ']' )
        return ( false );

    // CHECK THAT THERE IS AT LEAST ONE PERIOD IN THE STRING
    if ( address.indexOf ( '.', 0 ) == -1 )
        return ( true );

    return ( false );
}

function noValidSuffix ( address ) {
    // IF EMAIL ADDRESS IN FORM 'user@[255,255,255,0]', THEN WE ARE NOT INTERESTED
    if ( address.indexOf ( '@', 0 ) > 1 && address.charAt ( address.length - 1 ) == ']' )
        return ( false );

    // CHECK THAT THERE IS A TWO OR THREE CHARACTER SUFFIX AFTER THE LAST PERIOD
    var len = address.length;
    var pos = address.lastIndexOf ( '.', len - 1 ) + 1;
    if ( ( len - pos ) < 2 || ( len - pos ) > 3 ) {
        return ( true );
    } else {
        return ( false );
    }
}

function trim(value) {
  value = value.replace(/^\s+/,'');
  value = value.replace(/\s+$/,'');
  return value;
}

function WriteDiv() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
myHeight = myHeight - 270;
var contents='<div align=center id=scrollanle style="OVERFLOW: auto; WIDTH: 600px; HEIGHT:' + myHeight + 'px" >';
document.write(contents);
}

function WriteIFrame(page) {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
myHeight = myHeight - 290;
var contents="<br><iframe frameborder='0' src='" + page + "' width='590px' height='" + myHeight + "px' scrolling='yes' ALLOWTRANSPARENCY  style='overflow-x: hidden; overflow-y: scroll;'></iframe>"
refresh_scrollanle(contents);
}