function OpenPopup(AURL, ATitle, AWidth, AHeight, AResizable)
{
  if (AResizable == true)
  {
    x = window.open(AURL, 'FlashPresentation', 'resizable=yes,scrollbars=yes,menubar=no,toolbar=no,statusbar=no,locationbar=no,width=' + AWidth + ',height=' + AHeight);
  }
  else
  {
    x = window.open(AURL, 'FlashPresentation', 'resizable=no,scrollbars=no,menubar=no,toolbar=no,statusbar=no,locationbar=no,width=' + AWidth + ',height=' + AHeight);
  }
}

function OpenPicPopup(AURL, ATitle)
{
  
  //set defaults
  var borderSize = 10;
  
  //open window
  imgPopup = window.open('', 'PicPopup', 'resizable=no,scrollbars=no,menubar=no,toolbar=no,statusbar=no,locationbar=no');

  //create html
  imgPopup.document.open(); 
  imgPopup.document.writeln('<html>'); 
  imgPopup.document.writeln('<head>');
  imgPopup.document.writeln('<title>' + ATitle + '</title>'); 
  imgPopup.document.writeln('</head>');
  
  //add body
  imgPopup.document.writeln('<body onload="autosizeWindow()"' +
                            'style="background: #f6f6f6; margin:0; border:0; padding:0">' ); 

  //add table and image  
  imgPopup.document.writeln('<table cellspacing="' + String(borderSize) + '" cellpadding="0" border="0">');
  imgPopup.document.writeln('<tr><td>');
  imgPopup.document.writeln('<img id="image1" border="1" src="' + AURL + '" alt="' + ATitle + '" />'); 
  imgPopup.document.writeln('</td><tr>');
  imgPopup.document.writeln('</table>');

  //add resize function
  imgPopup.document.writeln('<script language="javascript" type="text/javascript">');
  imgPopup.document.writeln('  <!--');
  imgPopup.document.writeln('    function autosizeWindow()');
  imgPopup.document.writeln('{');

  imgPopup.document.writeln('//calculate width and height of document');
  imgPopup.document.writeln('var NS = (navigator.appName=="Netscape")?true:false;');  
  imgPopup.document.writeln('iWidth = (NS)?window.innerWidth:document.body.clientWidth;');
  imgPopup.document.writeln('iHeight = (NS)?window.innerHeight:document.body.clientHeight;');
  imgPopup.document.writeln('iWidth = document.images[0].width - iWidth + ' + String(borderSize*2) + ';');
  imgPopup.document.writeln('iHeight = document.images[0].height - iHeight + ' + String(borderSize*2) + ';');
  imgPopup.document.writeln('window.resizeBy(iWidth, iHeight-1);');
  imgPopup.document.writeln('}'); 
  imgPopup.document.writeln('  // -->');
  imgPopup.document.writeln('</script>');

  //finish html
  imgPopup.document.writeln('</body>'); 
  imgPopup.document.writeln('</html>'); 

  //close document 
  imgPopup.document.close(); 


  //focus
  imgPopup.focus();

};

function ReloadDoc(ALocation, reloadEntireDoc)
{
  //get top parent if needed}
  if ((reloadEntireDoc == true) && (parent))
    parent.location.assign(ALocation);
  else
    window.location.assign(ALocation);
}

function SetTabProps(activePageID)
{
  //set values
  idTabPage = 'tabPage';
  idTabActive = 'tabactive';
  idTabInActive = 'tabinactive';
  
  //process all items and look which are tab pages
  numberOfElements = document.all.length;
  for(i = 0; i < numberOfElements; i++)
  {
    //look if tab item
    if (((document.all[i].id) && (document.all[i].id.search(/ + idTabPage + /i) == 0))== true) //found
    {
      //set tab properties
      isActiveTab = (document.all[i].id.search(/ + idTabPage + activePageID + '_' + /i) == 0);
      if ((isActiveTab) && (document.all[i].className.toLowerCase() == idTabInActive))
        document.all[i].className = idTabActive;

      if ((!isActiveTab) && (document.all[i].className.toLowerCase() == idTabActive))
        document.all[i].className = idTabInActive;

      if ((isActiveTab) && (document.all[i].tagName.toLowerCase() == 'td') && 
         (document.all[i].background) &&
         (document.all[i].background.search(/ + idTabInActive + /i) != -1))
        document.all[i].background = document.all[i].background.replace(/ + idTabInActive + /i, idTabActive);
        
      if ((!isActiveTab) && (document.all[i].tagName.toLowerCase() == 'td') && 
         (document.all[i].background) &&
         (document.all[i].background.search(/ + idTabActive + /i) != -1))
        document.all[i].background = document.all[i].background.replace(/ + idTabActive + /i, idTabInActive);
    }
  }      
}

