<?php
//************************************************
//
// Tab Pane Class (alright, it's not a class yet)
//
// Created By:    Kenneth Brill <kbrill@multi.com>
// Javascript By: Erik Arvidsson
//
// Copyright: 2002
// Website:www.multi.com/coding
//
// ToDo: Make it a class
//************************************************

// Global Varibles
$TabID=0;
$WinID=0;

function StartTabPage($title) {
echo " <html> \n";
echo " <head> \n";
echo " <link id=\"luna-tab-style-sheet\" type=\"text/css\" rel=\"stylesheet\" href=\"include/tab/css/tab.winclassic.css\" disabled=\"disabled\" /> \n";
echo " <!-- the id is not needed. It is used here to be able to change css file at runtime --> \n";
echo "  \n";
echo " <style type=\"text/css\"> \n";
echo "  \n";
echo " .dynamic-tab-pane-control .tab-page { \n";
echo "         height:                200px; \n";
echo " } \n";
echo "  \n";
echo " .dynamic-tab-pane-control .tab-page .dynamic-tab-pane-control .tab-page { \n";
echo "         height:                150px; \n";
echo " } \n";
echo "  \n";
echo " form { \n";
echo "         margin:        0; \n";
echo "         padding:        0; \n";
echo " } \n";
echo "  \n";
echo " /* over ride styles from webfxlayout */ \n";
echo "  \n";
echo " .dynamic-tab-pane-control h2 { \n";
echo "         text-align:        center; \n";
echo "         width:                auto; \n";
echo " } \n";
echo "  \n";
echo " .dynamic-tab-pane-control h2 a { \n";
echo "         display:        inline; \n";
echo "         width:                auto; \n";
echo " } \n";
echo "  \n";
echo " .dynamic-tab-pane-control a:hover { \n";
echo "         background: transparent; \n";
echo " } \n";
echo "  \n";
echo "  \n";
echo "  \n";
echo " </style> \n";
echo " <script type=\"text/javascript\" src=\"include/tab/js/tabpane.js\"></script> \n";
echo " <script type=\"text/javascript\"> \n";
echo "  \n";
echo " function setLinkSrc( sStyle ) { \n";
echo "         document.getElementById( \"luna-tab-style-sheet\" ).disabled = sStyle != \"luna\"; \n";
echo "  \n";
echo "         document.documentElement.style.background = \n";
echo "         document.body.style.background = sStyle == \"webfx\" ? \"white\" : \"ThreeDFace\"; \n";
echo " } \n\n";
echo "function chgBg(obj,color){\n";
echo " if (document.all || document.getElementById)\n";
echo "   obj.style.backgroundColor=color;\n";
echo " else if (document.layers)\n";
echo "   obj.bgColor=color;\n";
echo "}\n";
echo "  \n";
echo " setLinkSrc( \"luna\" ); \n";
echo "  \n";
echo " </script> \n";
}

function StartTabWindow($WindowID) {
  global $NewTabWindow, $WinID;
  $NewTabWindow=0;
  $WinID++;
  $strWinID="TabPane" . $WinID;
  echo "\n<div class=\"tab-pane\" id=\"" . $strWinID . "\">\n";
  echo "<script type=\"text/javascript\">\n";
  echo "$WindowID = new WebFXTabPane( document.getElementById( \"" . $strWinID . "\" ) );\n";
  echo "</script>\n\n";
}

function EndTabWindow() {
   echo "</div></div>\n";
}

function AddTab($TabName,$WindowID) {
   global $NewTabWindow, $TabID;
   if($NewTabWindow==0) {
     $NewTabWindow=1;
   } else {
     echo "</div>\n";
   }
   $TabID++;
   $strTabID="Tab" . $TabID;
   echo "<div class=\"tab-page\" id=\"" . $TabName . "\">\n";
   echo "<h2 class=\"tab\">" . $TabName . "</h2>\n";
   echo "<script type=\"text/javascript\">" . $WindowID . ".addTabPage( document.getElementById( \"" . $TabName . "\" ) );</script>\n";
}
?> 
