Location: PHPKode > scripts > html.class.php > html-class-php/html.class.php
<?php
/**
* PHP class made to write HTML code Made on the 04.september.2004 by Tristan Carron Version 1.0 Principal functions for HTML encoding every function existe with is own name. This file has been developed under GPL licence 
*
* @package html.class.php
* @author Tristan Carron
* @version 1.4
* @abstract
* @copyright GPL licence
*/

/**
 * Define the content of the class html.class.php
 * @package html.class.php
 *
 */
class HTML {
	/**
     * functions for table production TblsStart : start of the table, we open the tag
     *
     * @param integer $bordure define the size of the border
     * @param integer $width define the width of the table
     * @param integer $height define the height of the table
     * @param integer $espCell define the space between cell
     * @param integer $rempCell define the remp between cell
     * @param string $bordercolor define the color of the border of the table
     * @param string $class use a pre define style for the table
     */
    
    function TblStart ($bordure = "1", $width = -1, $height = -1, $espCell = "2",
        $rempCell = "4", $bordercolor = -1, $class = -1)
    {
        $optionClasse = "" ;
        $optionWidth = "" ;
        $optionHeight = "" ;
        if ($bordercolor != -1)
            $optionClasse = " BORDERCOLOR =\"$bordercolor\"" ;
        if ($class != -1)
            $optionClasse .= " CLASS =\"$class\"" ;
        if ($width != -1)
            $optionWidth = " WIDTH =\"$width\"" ;
        if ($height != -1)
            $optionHeight = " HEIGHT =\"$height\"" ;

        echo "<TABLE BORDER =\"$bordure\"" . " CELLSPACING =\"$espCell\" CELLPADDING =\"$rempCell\" "
         . $optionWidth . $optionHeight . $optionClasse . ">\n" ;
    } 
    
    /**
     * function to close the table tag
     *
     */
    
    function TblEnd()
    {
        echo "</TABLE>\n" ;
    } 
    
    
    /**
     * Function to close the tag <table>
     *
     * @param string $align
     * @param string $bg
     * @param string $action
     * @param string $class
     */
    
    function TblStartLine($align = -1, $bg = -1, $action = -1, $class = -1)
    {
        $optionClasse = "" ;
        switch ($align) {
            case "bottom" :
                $optionClasse .= " VALIGN =\"$align\"" ;
                break ;
            case "top" :
                $optionClasse .= " VALIGN =\"$align\"" ;
                break ;
            case "left" :
                $optionClasse .= " ALIGN =\"$align\"" ;
                break ;
            case "right" :
                $optionClasse .= " ALIGN =\"$align\"" ;
                break ;
            case "center" :
                $optionClasse .= " ALIGN =\"$align\"" ;
                break ;
        }
        // choose between the background image or color
        if ($bg != -1)
        {
            if ($bg[0] != "#")
                $optionClasse .= " BACKGROUND =\"$bg\"" ;
            else
                $optionClasse .= " BGCOLOR =\"$bg\"" ;
        }
        if ($class != -1)
            $optionClasse .= " CLASS =\"$class\"" ;

        if($action != -1)
                echo "<TR" . $optionClasse . " " . $action . ">\n";
        else
                echo "<TR" . $optionClasse . ">\n";
    }
    
    /**
     * function to close the tag of the new line
     *
     */
    
    function TblEndLine()
    {
        echo "</TR>\n" ;
    } 
    
    
    /**
     * the tag to add an entete in the table
     *
     * @param string $content
     * @param string $bg
     * @param integer $nbLig
     * @param integer $nbCol
     */
    
    function TblEntete($content, $bg = -1, $nbLig = 1, $nbCol = 1)
    {
        if ($bg != -1)
            $optionClasse = " BACKGROUND =\"$bg\"" ;
        echo "<TH" . $optionClasse . " ROWSPAN =\"$nbLig\" COLSPAN =\"$nbCol\">$content</TH>\n" ;
    }
    
    /**
     * the function to start a new cell only
     *
     * @param integer $width
     * @param integer $height
     * @param string $bg
     * @param string $align
     * @param integer $nbLig
     * @param integer $nbCol
     * @param string $class
     */
    
    function TblStartCell($width = -1, $height = -1, $bg = -1, $align = -1, $nbLig = -1, $nbCol = -1, $class = -1)
    {
        $optionClasse = "" ;
        if ($width != -1)
            $optionClasse = " WIDTH =\"$width\"" ;
        if ($height != -1)
            $optionClasse .= " HEIGHT =\"$height\"" ;
        // choose between the background image or color
        if ($bg != -1) {
            if ($bg[0] != "#")
                $optionClasse .= " BACKGROUND =\"$bg\"" ;
            else
                $optionClasse .= " BGCOLOR =\"$bg\"" ;
        } 

        if ($align != -1) {
            switch ($align) {
                case "center" :
                    $optionClasse .= " ALIGN =\"$align\"" ;
                    break ;
                case "bottom" :
                    $optionClasse .= " VALIGN =\"$align\"" ;
                    break ;
                case "top" :
                    $optionClasse .= " VALIGN =\"$align\"" ;
                    break ;
                case "left" :
                    $optionClasse .= " ALIGN =\"$align\"" ;
                    break ;
                case "right" :
                    $optionClasse .= " ALIGN =\"$align\"" ;
            } 
        } 
        if ($nbLig != -1)
            $optionClasse .= " ROWSPAN =\"$nbLig\"" ;
        if ($nbCol != -1)
            $optionClasse .= " COLSPAN =\"$nbCol\"" ;
        if ($class != -1)
            $optionClasse .= " CLASS =\"$class\"" ;
        echo "<TD" . $optionClasse . ">" ;
    } 
    
    /**
     * the tag to close the new cell
     *
     */
    
    function TblEndCell()
    {
        echo "</TD>\n" ;
    } 
   
    /**
     * tag just to add a new cell
     *
     * @param string $contenu
     * @param integer $width
     * @param integer $height
     * @param string $bg
     * @param integer $align
     * @param integer $nbLig
     * @param integer $nbCol
     * @param string $class
     */
    
    function TblCell($contenu, $width = -1, $height = -1, $bg = -1, $align = -1, $nbLig = -1, $nbCol = -1, $class = -1)
    {
        $options = "" ;
        $optionClasse = "" ;
        // choose between the background image or color
        if ($bg != -1) {
            if ($bg[0] != "#")
                $optionClasse .= " BACKGROUND =\"$bg\"" ;
            else
                $optionClasse .= " BGCOLOR =\"$bg\"" ;
        } 

        switch ($align) {
            case "bottom" :
                $options .= " VALIGN =\"$align\"" ;
                break ;
            case "top" :
                $options .= " VALIGN =\"$align\"" ;
                break ;
            case "left" :
                $options .= " ALIGN =\"$align\"" ;
                break ;
            case "right" :
                $options .= " ALIGN =\"$align\"" ;
                break ;
            case "center" :
                $options .= " ALIGN =\"$align\"" ;
                break ;
        }
        if ($width != -1)
            $options .= " WIDTH =\"$width\"" ;
        if ($height != -1)
            $options .= " HEIGHT =\"$height\"" ;
        if ($class != -1)
            $options .= " CLASS =\"$class\"" ;
        if ($nbLig != -1)
            $options .= " ROWSPAN =\"$nbLig\"" ;
        if ($nbCol != -1)
            $options .= " COLSPAN =\"$nbCol\"" ;

        echo "   <TD$options>$contenu</TD>\n" ;
    }
    
    /**
     * All the HTML tags from the HTML 4. The anchor tag defines either a link or an anchor in a document. The anchor tag must contain either a NAME attribute or an HREF attribute, or both.
     *
     * @param string $url
     * @param string $text
     * @param string $class
     */
    
    function Anchor($url, $text, $class = -1)
    {
        $optionClasse = "" ;
        if ($class != -1)
            $optionClasse = " CLASS =\"$class\"" ;

        echo "<A HREF =\"$url\"" . "$optionClasse>$text</A>" ;
    } 
    
    /**
     * The inline image tag displays an image referred to by a URL. It must contain at least an SRC attribute.
     *
     * @param string $url
     * @param integer $width
     * @param integer $height
     * @param integer $border
     * @param string $title
     * @param integer $map
     * @param string $name
     * @param string $class
     */
    
    function Image($url, $width = -1, $height = -1, $border = -1, $title = -1, $map = -1, $name = -1, $class = -1)
    {
        $options = "" ;
        if ($width != -1)
            $options = " WIDTH =\"$width\"" ;
        if ($height != -1)
            $options .= " HEIGHT =\"$height\"" ;
        if ($border != -1)
            $options .= " BORDER =\"$border\"" ;
        if ($title != -1)
            $options .= " TITLE =\"$title\"" ;
        if ($map != -1)
            $options .= " USEMAP =\"#$map\"" ;
        if ($name != -1)
            $options .= " NAME =\"$name\"" ;
        if ($class != -1)
            $options .= " CLASS =\"$class\"" ;

        echo "<IMG SRC =\"$url\"" . $options . ">" ;
    } 
    
    
    /**
     * The comment tag includes the actual comment text
     *
     * @param string $text
     */
    
    function Comment($text)
    {
        echo "<!-- $text -->\n" ;
    } 
    
    
    /**
     * The <A HREF> tag is used to link pages together It must contain both parameteres
     *
     * @param string $url
     * @param string $txtLinks
     * @param string $action
     * @param string $class
     */
    
    function A($url, $txtLinks, $action = -1, $class = -1)
    {
        $optionclasse = "" ;
        if($class != -1)
            $optionclasse = " CLASS=\"$class\"" ;
        if($action != -1)
                echo "<A HREF=\"$url\" " . $action . $optionclasse . ">$txtLinks</a>" ;
        else
                echo "<A HREF=\"$url\" " . $optionclasse . ">$txtLinks</a>" ;
    }
    
    
    /**
     * The <A HREF> tag is used to link pages together It must contain both parameteres
     *
     * @param string $url
     * @param string $action
     * @param string $class
     */
    
    function AStart($url, $action = -1, $class = -1)
    {
        $optionclasse = "" ;
        if($class != -1)
            $optionclasse = " CLASS=\"$class\"" ;
        if($action != -1)
                echo "<A HREF=\"$url\" " . $action . $optionclasse .">" ;
        else
                echo "<A HREF=\"$url\" " . $optionclasse . ">" ;
    }

    
    /**
     * The tag is made to close the <A HREF> tag
     *
     */
    
    function AEnd()
    {
        echo "</A>" ;
    }
    
    
    /**
     * put the text in bold
     *
     * @param string $text
     * @param string $class
     */
    
    function Bold($text, $class = -1)
    {
        $optionclasse = "" ;
        if($class != -1)
            $optionclasse = " CLASS=\"$class\"" ;

        echo "<B " . $optionclasse . ">$text</B>" ;
    } 
    
    
    /**
     * to do a line return
     *
     * @param integer $nbr
     */
    
    function Br($nbr = -1)
    {
        if($nbr != -1)
            {
                for($i = 0 ; $i < $nbr; $i++)
                echo "<BR>" ;
            }
        else
            echo "<BR>" ;
    } 
    
    
    /**
     * The form tag introduces a form, which is made up of INPUT elements, described in the sections that follow. A form may be inside structural HTML tags and may also contain structural tags. Using tables and other elements a form can take on various shapes and looks
     *
     * @param string $action
     * @param string $method
     * @param string $class
     */
    
    function Form($action, $method = -1, $class = -1)
    {
        $optionclasse = "" ;
        $attrMethod = "" ;
        if($class != -1)
            $optionclasse = " CLASS=\"$class\"" ;
        if ($method != -1)
            $attrMethod = " METHOD =\"$method\"" ;

        echo "<FORM ACTION =\"$action\"" . $attrMethod . $optionclasse . ">\n" ;
    } 
    
    
    /**
     * function to close the tag form
     *
     */
    
    function FormEnd()
    {
        echo "</FORM>\n" ;
    } 
    
    
    /**
     * The select tag specifies a multiple line selection box field within the form that contains it. The user can select one or more lines if the attribute MULTIPLE is specified. The NAME attribute is a required field and is used to identify the data for the field. The SIZE attribute specifies the number of lines of selections that are to be displayed
     *
     * @param string $text
     * @param string $name
     * @param integer $selected
     * @param integer $size
     * @param string $id
     * @param string $class
     */
    
    function Select($text = array(), $name = -1, $selected = -1, $size = -1, $id = -1, $class = -1)
    {
        $options = "" ;
        $attrSelected = "" ;
        if ($name != -1)
            $options = " NAME =\"$name\"" ;
        if ($size != -1)
            $options .= " SIZE =\"$size\"" ;
        if ($id != -1)
            $options .= " ID =\"$id\"" ;
        if ($class != -1)
            $options .= " CLASS =\"$class\"" ;

        echo "<SELECT" . $options . ">\n" ;

        for($i = 0 ; $i < sizeof($text) ; $i++) {
            if ($i == $selected-1)
                $attrSelected = " SELECTED" ;

            echo "  <OPTION" . $attrSelected . ">$text[$i]</OPTION>\n" ;
        } 

        echo "</SELECT>\n" ;
    }
    
    /**
     * the input tag must be between to form tags and it must contain the type, text, password, checkbox, radio submit, reset, file, hidden, image or button
     *
     * @param string $type
     * @param string $name
     * @param string $value
     * @param integer $size
     * @param integer $maxLength
     * @param integer $checked
     * @param string $title
     * @param string $id
     * @param string $class
     */
    
    function Input($type = -1, $name = -1, $value = -1, $size = -1, $maxLength = -1, $checked = -1, $title = -1, $id = -1, $class = -1)
    {
        $options = "" ;
        if ($type != -1)
            $options = " TYPE =\"$type\"" ;
        if ($name != -1)
            $options .= " NAME =\"$name\"" ;
        if ($value != -1)
            $options .= " VALUE =\"$value\"" ;
        if ($size != -1)
            $options .= " SIZE =\"$size\"" ;
        if ($maxLength != -1)
            $options .= " MAXLENGTH =\"$maxLength\"" ;
        if ($checked != -1)
            $options .= " CHECKED" ;
        if ($title != -1)
            $options .= " TITLE =\"$title\"" ;
        if ($id != -1)
            $options .= " ID =\"$id\"" ;
        if ($class != -1)
            $options .= " CLASS =\"$class\"" ;

        echo "<INPUT" . $options . ">" ;
    } 
    
    /**
     * The text area tag specifies a multiple line text area field within the form that contains it. The NAME attribute is a required field and is used to identify the data for the field. The COLS attribute specifies the width in characters of the text area. The ROWS attribute specifies the number of lines the text area contains. The content is used as an initial value for the field. The field can be scrolled beyond the COLS and ROWS size to allow for larger amounts of text to be entered. The wrap attribute can have values of OFF, SOFT and HARD
     *
     * @param string $text
     * @param string $name
     * @param integer $cols
     * @param integer $rows
     * @param string $wrap
     * @param string $class
     */
    
    function TextArea($text, $name = -1, $cols = -1, $rows = -1, $wrap = -1, $class = -1)
    {
        $options = "" ;
        if ($name != -1)
            $options = " NAME =\"$name\"" ;
        if ($cols != -1)
            $options .= " COLS =\"$cols\"" ;
        if ($rows != -1)
            $options .= " ROWS =\"$rows\"" ;
        if ($wrap != -1)
            $options .= " WRAP =\"$wrap\"" ;
        if ($class != -1)
            $options .= " CLASS =\"$class\"" ;

        echo "<TEXTAREA " . $options . ">$text</TEXTAREA>\n" ;
    } 
    
    
    // 
    /**
     * The heading tag defines a level heading. It is typically shown in a very large bold font with several blank lines around it
     *
     * @param string $text
     * @param integer $size
     */
    
    function H($text, $size = -1)
    {
        $attrSize = "" ;
        if ($size != -1)
            $attrSize = $size ;
        echo "<H$attrSize>$text</H$attrSize>" ;
    }
    
    /**
     * The horizontal rule tag causes a horizontal line to be drawn across the screen. There is no </HR> tag
     *
     * @param string $align
     * @param integer $width
     * @param integer $size
     * @param integer $shade
     * @param string $color
     * @param string $class
     */
    
    function Hr($align = -1, $width = -1, $size = -1, $shade = -1, $color = -1, $class = -1)
    {
        $options = "" ;
        if ($align != -1)
            $options = "ALIGN =\"$align\"" ;
        if ($size != -1)
            $options .= " SIZE =\"$size\"" ;
        if ($width != -1)
            $options .= " WIDTH =\"$width\"" ;
        if ($shade == 1)
            $options .= " NOSHADE" ;
        if ($color != -1)
            $options .= " COLOR =\"$color\"" ;
        if ($class != -1)
            $options .= " CLASS =\"$class\"" ;

        echo "<HR " . $options . ">\n" ;
    }
    
    /**
     * The italic tag defines text that should be shown in italics
     *
     * @param string $text
     */
    
    function I($text)
    {
        echo "<I>$text</I>" ;
    } 
    
    /**
     * The unordered list tag introduces an unordered (bulleted) list, which is made up of List Item (LI) tags
     *
     * @param string $type
     * @param string $text
     * @param string $value
     * @param string $class
     */
    
    function Ul($type = -1, $text = array(), $value = -1, $class = -1)
    {
        $options = "" ;
        if ($type != -1)
            $options = " TYPE =\"$type\"" ;
        if ($value != -1)
            $options .= " VALUE =\"$value\"" ;
        if ($class != -1)
            $options .= " CLASS =\"$class\"" ;

        echo "<UL" . $options . ">\n" ;

        for($i = 0 ; $i < sizeof($text) ; $i++)
        echo "  <LI>$text[$i]\n" ;

        echo "</UL>\n" ;
    }
    
    /**
     * The ordered list tag introduces an ordered (numbered) list, which is made up of List Item (LI) tags the type of bullets are 1, a, i, A, I
     *
     * @param string $type
     * @param string $text
     * @param string $start
     * @param string $value
     * @param string $class
     */
    
    function Ol($type = -1, $text = array(), $start = -1, $value = -1, $class = -1)
    {
        $options = "" ;
        if ($type != -1)
            $options = " TYPE =\"$type\"" ;
        if ($start != -1)
            $options .= " START =\"$start\"" ;
        if ($value != -1)
            $options .= " VALUE =\"$value\"" ;
        if ($class != -1)
            $options .= " CLASS =\"$class\"" ;

        echo "<OL" . $options . ">\n" ;

        for($i = 0 ; $i < sizeof($text) ; $i++)
        echo "  <LI>$text[$i]\n" ;

        echo "</OL>\n" ;
    } 
    
    /**
     * The small text tag defines text that should be displayed in a smaller font than usual
     *
     * @param string $text
     * @param string $class
     */
    
    function Small($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<SMALL" . $options . ">$text</SMALL>" ;
    }
    
    /**
     * The strikethrough tag defines text that should be shown with a horizontal line through it
     *
     * @param string $text
     * @param string $class
     */
    
    function Strike($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<STRIKE" . $options . ">$text</STRIKE>" ;
    }
       
    /**
     * The strong tag defines text that should be strongly emphasized -- most browsers will display it in boldface
     *
     * @param string $text
     * @param string $class
     */
    
    function Strong($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<STRONG" . $options . ">$text</STRONG>" ;
    } 
    
    /**
     * The subscript tag defines text that should be displayed in a smaller font than usual, lower on the line than usual
     *
     * @param string $text
     * @param string $class
     */
    
    function Sub($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<SUB" . $options . ">$text</SUB>" ;
    } 
     
    /**
     * The superscript tag defines text that should be displayed in a smaller font than usual higher on the line than usual
     *
     * @param string $text
     * @param string $class
     */
    
    function Sup($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<SUP" . $options . ">$text</SUP>" ;
    } 
    
    /**
     * The underlined tag defines text that should be shown with a line underneath it
     *
     * @param string $text
     * @param string $class
     */
    
    function U($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<U" . $options . ">$text</U>" ;
    } 
    
    /**
     * The teletype tag defines text that should be shown in a fixed width font
     *
     * @param string $text
     * @param string $class
     */
    
    function Tt($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<TT" . $options . ">$text</TT>" ;
    } 
    

    /**
     * The meta tag, which is only valid in a HEAD section, declares HTTP meta name/value pairs that are associated with the HTML document. These are used to extend the HTTP header information returned by the HTTP server. The support of the meta information is HTTP server specific. If a name attribute is not specified the HTTP-EQUIV attribute is used as the name. This tag can also be used to trigger client side behaviour
     *
     * @param string $author
     * @param string $keywords
     * @param string $descr
     * @param string $lang
     * @param string $robots
     * @param string $reply
     * @param string $httpequiv
     */
    
    function Meta($author = -1, $keywords = array(), $descr = -1, $lang = -1, $robots = -1, $reply = -1, $httpequiv = array())
    {
        $text = "" ;
        if ($author != -1)
            echo "<META NAME =\"author\" CONTENT =\"$author\">\n" ;
        if ($descr != -1)
            echo "<META NAME =\"description\" CONTENT =\"$descr\">\n" ;
        if ($lang != -1)
            echo "<META NAME =\"language\" CONTENT =\"$lang\">\n" ;
        if ($robots != -1)
            echo "<META NAME =\"robots\" CONTENT =\"$robots\">\n" ;
        if ($reply != -1)
            echo "<META NAME =\"reply-to\" CONTENT =\"$reply\">\n" ;
        if ($httpequiv[0] != -1)
            echo "<META HTTP-EQUIV =\"refresh\" CONTENT =\"$httpequiv[0] ;  URL = $httpequiv[1]\">\n" ;

        if (sizeof($keywords) != 0) {
            for($i = 0 ; $i < sizeof($keywords) ; $i++)
            $text .= $keywords[$i] . " " ;

            echo "<META NAME =\"keywords\" CONTENT =\"$text\">\n" ;
        } 
    } 
	
    /**
     * The tag to include a style sheet
     *
     * @param string $url
     */
    
    function Style($url)
    {
        echo "<LINK HREF=\"$url\" REL=\"stylesheet\" type=\"text/css\">\n" ;
    }
    
    
    /**
     * The HTML tag defines an HTML document. The <HTML> tag should be the first in the entire document, and the </HTML> tag should be the last
     *
     */
    
    function HtmlStart()
    {
        echo "<HTML>\n" ;
    } 
    
    /**
     * the function to close the <HTML> tag
     *
     */
    
    function HtmlEnd()
    {
        echo "</HTML>\n" ;
    }
    
    /**
     * The body tag introduces the body of the document. It should appear after the head section and occupy the remainder of the document
     *
     * @param string $action
     */
    
    function Body($action = -1)
    {
     if($action != -1)
        echo "<BODY " . $action . ">\n" ;
     else
        echo "<BODY>\n" ;
    }
    
    /**
     * the function to close the <BODY> tag
     *
     */
    
    function BodyEnd()
    {
        echo "</BODY>\n" ;
    }
    
    /**
     * These escape sequences are used to enter characters such as <, >, &, and " into HTML documents
     *
     * @param integer $nbr
     */
    
    function Sp($nbr = -1)
    {
        if($nbr != -1)
            {
                for($i = 0 ; $i < $nbr; $i++)
                echo "&nbsp;" ;
            }
        else
            echo "&nbsp;" ;
    } 
    
    /**
     * The abbreviation tag defines an abbreviation. It is typically displayed just like normal text, but is used by automatic indexers
     *
     * @param string $text
     * @param string $class
     */
    
    function Abbr($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<ABBR" . $options . ">$text</ABBR>" ;
    } 
    
    /**
     * The acronym tag defines an acronym. It is typically displayed just like normal text, but is used by automatic indexers
     *
     * @param string $text
     * @param string $class
     */
    
    function Acronym($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<ACRONYM" . $options . ">$text</ACRONYM>" ;
    }
    
    /**
     * The address tag defines text that gives an address or other contact information. It is typically displayed in italics, slightly indented, and is used by automatic indexers
     *
     * @param string $text
     * @param string $class
     */
    
    function Address($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<ADDRESS" . $options . ">$text</ADDRESS>" ;
    } 
    
    /**
     * The Java applet tag runs a Java applet referred to by a URL. applet-content consists of optional PARAM tags, ordinary text and markup to be displayed by browsers that cannot run Java applets, and a TEXTFLOW tag if no ordinary text and markup is included WARNING does not work with all the browser...
     *
     * @param string $code
     * @param string $name
     * @param string $codeBase
     * @param integer $width
     * @param integer $height
     * @param string $title
     * @param string $param
     * @param string $paramData
     * @param string $class
     */
    
    function Applet($code = -1, $name = -1, $codeBase = -1, $width = -1, $height = -1, $title = -1, $param = array(), $paramData = array(), $class = -1)
    {
        $options = "" ;
        if ($code != -1)
            $options = " CODE =\"$code\"" ;
        if ($name != -1)
            $options .= " NAME =\"$name\"" ;
        if ($codeBase != -1)
            $options .= " CODEBASE =\"$codeBase\"" ;
        if ($width != -1)
            $options .= " WIDTH =\"$width\"" ;
        if ($height != -1)
            $options .= " HEIGHT =\"$height\"" ;
        if ($title != -1)
            $options .= " TITLE =\"$title\"" ;
        if ($class != -1)
            $options .= " CLASS =\"$class\"" ;

        echo "<APPLET" . $options . ">\n";

        for($i = 0 ; $i < sizeof($param) ; $i++)
        echo "  <PARAM NAME =" . $param[$i] . " VALUE =" . $paramData[$i] . ">\n" ;

        echo "</APPLET>\n" ;
    } 
   
    /**
     * The background sound tag identifies a .wav, .au, or .mid resource that will be played when the page is opened. The optional LOOP attribute will cause the resource to be played n times. LOOP="INFINITE" will cause the resource to be played continuously as long as the page is open WARNING works only with Internet Explorer
     *
     * @param string $url
     * @param string $loop
     */
    
    function BgSound($url = -1, $loop = -1)
    {
        $options = "" ;
        if ($url != -1)
            $options = " SRC =\"$url\"" ;
        if ($loop != -1)
            $options .= " LOOP =\"$loop\"" ;

        echo "<BGSOUND" . $options . ">" ;
    } 
    
    /**
     * The big text tag defines text that should be displayed in a larger font than usual
     *
     * @param string $text
     * @param string $class
     */
    
    function Big($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<BIG" . $options . ">$text</BIG>" ;
    } 
    
    /**
     * The blink tag highlights the text by having it blink on and off
     *
     * @param string $text
     * @param string $class
     */
    
    function Blink($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<BLINK" . $options . ">$text</BLINK>" ;
    }
    
    /**
     * The font tag defines text with a smaller or larger font than usual. The normal font size corresponds to 3; smaller values of number will produce a smaller font, and larger values of number will produce a larger font the diferent fonts are : Times, Arial, Courier, Verdana, Geneva and Georgia
     *
     * @param string $text
     * @param string $face
     * @param string $color
     * @param integer $size
     */
    
    function Font($text, $face = -1, $color = -1, $size = -1)
    {
        $options = "" ;
        if ($face != -1) {
            switch ($face) {
                case "Times" :
                    $options = " FACE =\"Times New Roman, Times, serif\"" ;
                    break ;
                case "Arial" :
                    $options = " FACE =\"Arial, Helvetica, sans-serif\"" ;
                    break ;
                case "Courier" :
                    $options = " FACE =\"Courier New, Courier, mono\"" ;
                    break ;
                case "Georgia" :
                    $options = " FACE =\"Georgia, Times New Roman, Times, serif\"" ;
                    break ;
                case "Verdana" :
                    $options = " FACE =\"Verdana, Arial, Helvetica, sans-serif\"" ;
                    break ;
                case "Geneva" :
                    $options = " FACE =\"Geneva, Arial, Helvetica, sans-serif\"" ;
                    break ;
            } 
        }
        if ($color != -1)
            $options .= " COLOR =\"$color\"" ;
        if ($size != -1)
            $options .= " SIZE =\"$size\"" ;

        echo "<FONT" . $options . ">$text</FONT>" ;
    }
        
    /**
     * The FontStart tag defines text with a smaller or larger font than usual. The normal font size corresponds to 3; smaller values of number will produce a smaller font, and larger values of number will produce a larger font the diferent fonts are : Times, Arial, Courier, Verdana, Geneva and Georgia you can pass the text after the FrontStart tag.
     *
     * @param string $face
     * @param string $color
     * @param integer $size
     */
    
    function FontStart($face = -1, $color = -1, $size = -1)
    {
        $options = "" ;
        if ($face != -1) {
            switch ($face) {
                case "Times" :
                    $options = " FACE =\"Times New Roman, Times, serif\"" ;
                    break ;
                case "Arial" :
                    $options = " FACE =\"Arial, Helvetica, sans-serif\"" ;
                    break ;
                case "Courier" :
                    $options = " FACE =\"Courier New, Courier, mono\"" ;
                    break ;
                case "Georgia" :
                    $options = " FACE =\"Georgia, Times New Roman, Times, serif\"" ;
                    break ;
                case "Verdana" :
                    $options = " FACE =\"Verdana, Arial, Helvetica, sans-serif\"" ;
                    break ;
                case "Geneva" :
                    $options = " FACE =\"Geneva, Arial, Helvetica, sans-serif\"" ;
                    break ;
            }
        }
        if ($color != -1)
            $options .= " COLOR =\"$color\"" ;
        if ($size != -1)
            $options .= " SIZE =\"$size\"" ;

        echo "<FONT" . $options . ">" ;
    }
       
    /**
     * The FontEnd tag close the FontStart tag
     *
     */
    function FontEnd()
    {
        echo "</FONT>\n" ;
    }
    
    /**
     * The head tag introduces text that describes an HTML document. Most documents have only a TITLE tag in the head section you can add a script too example : JavaScript
     *
     * @param string $title
     * @param string $typeScript
     * @param string $script
     */
    
    function Head($title = -1, $typeScript = -1, $script = -1)
    {
        $attrTitle = "" ;
        $attrScript = "" ;
        $attrType = "" ;
        if ($title != -1)
            $attrTitle = "<TITLE>$title</TITLE>\n" ;
        if ($typeScript != -1)
            $attrType = " LANGUAGE =\"$typeScript\"" ;
        if ($script != -1)
            $attrScript = "<SCRIPT" . $attrType . ">\n$script\n</SCRIPT>\n" ;

        echo "<HEAD>\n" . $attrTitle . $attrScript;
    } 
    
    /**
     * the function to close the <HEAD> tag
     *
     */
    
    function HeadEnd()
    {
        echo "</HEAD>\n" ;
    }
    
    /**
     * The au tag defines text that names the author of a document. It is typically displayed just like normal text, but is used by automatic indexers
     *
     * @param string $text
     * @param string $class
     */
    
    function Au($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<AU" . $options . ">$text</AU>" ;
    } 
    
    /**
     * The author tag defines text that names the author of a document. It is typically displayed just like normal text, but is used by automatic indexers
     *
     * @param string $text
     * @param string $class
     */
    
    function Author($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<AUTHOR" . $options . ">$text</AUTHOR>" ;
    }
    
    /**
     * The deleted text tag marks text that has been deleted, for example in a group authoring situation or a legal document
     *
     * @param string $text
     * @param string $class
     */
    
    function Del($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<DEL" . $options . ">$text</DEL>" ;
    } 
        
    /**
     * The center tag defines text that should be centered
     *
     * @param string $text
     * @param string $class
     */
    
    function Center($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<CENTER" . $options . ">$text</CENTER>" ;
    }
    
    /**
     * // The citation tag defines text that cites a book or other work -- most browsers will display it in italics
     *
     * @param string $text
     * @param string $class
     */
    
    function Cite($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<CITE" . $options . ">$text</CITE>" ;
    } 
    
    /**
     * The map tag defines a client side image map It gives a name to a collection of AREA tags that are superimposed over an inline image to connect user clicks with URLs the different shape for the area are : rect, circle, poly and the target are : _self, _blank, _parent, _top
     *
     * @param string $name
     * @param string $shape
     * @param integer $coords
     * @param string $url
     * @param string $alt
     * @param string $title
     * @param string $target
     * @param string $class
     */
    
    function Map($name, $shape = -1, $coords = -1, $url = -1, $alt = -1, $title = -1, $target = -1, $class = -1)
    {
        $options = "" ;
        if ($shape != -1)
            $options = " SHAPE =\"$shape\"" ;
        if ($coords != -1)
            $options .= " COORDS =\"$coords\"" ;
        if ($url != -1)
            $options .= " HREF =\"$url\"" ;
        if ($alt != -1)
            $options .= " ALT =\"$alt\"" ;
        if ($title != -1)
            $options .= " TITLE =\"$title\"" ;
        if ($target != -1)
            $options .= " TARGET =\"$target\"" ;
        if ($class != -1)
            $options .= " CLASS =\"$class\"" ;

        echo "<MAP NAME =\"$name\">\n" ;

        echo "  <AREA" . $options . ">" ;

        echo "</MAP>\n" ;
    }
    
    /**
     * The base tag, which is valid only in the HEAD section, defines the base address of an HTML document, which is used to determine the full address of relative URL"s that appear in the document. The typical use for this is to move an HTML document to another site without moving all the images and related documents with it: the base URL can be set to the directory where those images and documents remain. The "default target" will become the target for all links unless specified explicitly the different target are : _parent, _top, _self, _blank
     *
     * @param string $url
     * @param string $target
     */
    
    function Base($url, $target = -1)
    {
        $options = "" ;
        if ($target != -1)
            $options = " TARGET =\"$target\"" ;

        echo "<BASE HREF =\"$url\"" . $options . ">\n" ;
    }
    
    /**
     * The base font tag defines the base that relative FONT changes are based on. (Default is 3.) WARNING this tag as to be put in the head section
     *
     * @param string $text
     * @param string $face
     * @param string $color
     * @param integer $size
     */
    
    function BaseFont($text, $face = -1, $color = -1, $size = -1)
    {
        $options = "" ;
        if ($face != -1) {
            switch ($face) {
                case "Times" :
                    $options = " FACE =\"Times New Roman, Times, serif\"" ;
                    break ;
                case "Arial" :
                    $options = " FACE =\"Arial, Helvetica, sans-serif\"" ;
                    break ;
                case "Courier" :
                    $options = " FACE =\"Courier New, Courier, mono\"" ;
                    break ;
                case "Georgia" :
                    $options = " FACE =\"Georgia, Times New Roman, Times, serif\"" ;
                    break ;
                case "Verdana" :
                    $options = " FACE =\"Verdana, Arial, Helvetica, sans-serif\"" ;
                    break ;
                case "Geneva" :
                    $options = " FACE =\"Geneva, Arial, Helvetica, sans-serif\"" ;
                    break ;
            }
        }
        if ($color != -1)
            $options .= " COLOR =\"$color\"" ;
        if ($size != -1)
            $options .= " SIZE =\"$size\"" ;

        echo "<BASEFONT" . $options . ">$text\n" ;
    } 
    
    /**
     * The code tag defines text that should be shown in a fixed width font. It can be nested with other idiomatic or typographic tags but some browsers will respect only the innermost tag. Many browsers use the same font for the KBD, SAMP, TT and CODE tags. For many lines of fixed width text, with the line breaks and other whitespace specified by the page author, use the PRE tag
     *
     * @param string $text
     * @param string $class
     */
    
    function Code($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<CODE" . $options . ">$text</CODE>" ;
    } 
    
    /**
     * The definition tag defines text that defines a term -- many browsers will display it in italics, though others will ignore it. It can be nested with other idiomatic or typographic tags but some browsers will respect only the innermost tag
     *
     * @param string $text
     * @param string $class
     */
    
    function Dfn($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<DFN" . $options . ">$text</DFN>" ;
    } 
    
    /**
     * The embed element is used to embed a plugin into a document. The OBJECT tag can also be used to embed objects the loop parametre will be false if anything is set the play parametre will be false if anything is set the different quality are : Low, Auto Low, Auto High, High the scale parametre are : Default(show all), No border, Exact fit
     *
     * @param string $url
     * @param integer $width
     * @param integer $height
     * @param string $loop
     * @param string $play
     * @param string $quality
     * @param string $scale
     */
    
    function Embed($url, $width = -1, $height = -1, $loop = -1, $play = -1, $quality = -1, $scale = -1)
    {
        $options = "" ;
        if ($width != -1)
            $options = " WIDTH =\"$width\"" ;
        if ($height != -1)
            $options .= " HEIGHT =\"$height\"" ;
        if ($loop != -1)
            $options .= " LOOP =\"$loop\"" ;
        if ($play != -1)
            $options .= " PLAY =\"$play\"" ;
        if ($quality != -1)
            $options .= " QUALITY =\"$quality\"" ;
        if ($scale != -1)
            $options .= " SCALE =\"$scale\"" ;

        echo "<EMBED SRC =\"$url\"" . $options . ">\n" ;
    }
    
    /**
     * The inserted text tag marks text that has been inserted, for example in a group authoring situation or a legal document
     *
     * @param string $text
     * @param string $class
     */
    
    function Ins($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<INS" . $options . ">$text</INS>" ;
    } 
    
    /**
     * The keyboard tag defines text that should be shown in a fixed width font. It can be nested with other idiomatic or typographic tags but some browsers will respect only the innermost tag
     *
     * @param string $text
     * @param string $class
     */
    
    function Kbd($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<KBD" . $options . ">$text</KBD>" ;
    } 
    
    /**
     * The no break tag defines a block of text which will have no line breaks except those explicitly requested with BR or suggested with WOBR
     *
     * @param string $text
     * @param string $class
     */
    
    function NoBr($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options .= " CLASS =\"$class\"" ;

        echo "<NOBR" . $options . ">$text</NOBR>" ;
    } 
    
    /**
     * The NOFRAMES tag specifies HTML that can be used by browsers that do not support frames. Everything between the start and end tag is ignored by browsers that understand frames should be put before the <body> tag
     *
     */
    function NoFrame()
    {
        echo "<NOFRAME>\n" ;
    }
    
    /**
     * function to close the <NOFRAME> tag should be put after the closed </body> tag
     *
     */
    function NoFrameEnd()
    {
        echo "</NOFRAME>\n" ;
    }
    
    /**
     * function to open a div tag to align or put classes
     *
     * @param string $align
     */
    
    function Div($align = -1)
    {
        $options = "" ;
        if ($align != -1)
            $options = " ALIGN =\"$align\"" ;

        echo "<DIV" . $options . ">\n" ;
    } 
    
    /**
     * function to close the div tag
     *
     */
    
    function DivEnd()
    {
        echo "</DIV>\n" ;
    } 
    
    /**
     * function to invert a texte with the prams. rtl : right to left ltr : left to right
     *
     * @param string $text
     * @param string $direction
     * @param string $lang
     * @param string $class
     */
    
    function Bdo($text, $direction = -1, $lang = -1, $class = -1)
    {
        $options = "" ;
        if ($direction != -1)
            $options = " DIR =\"$direction\"" ;
        if ($lang != -1)
            $options .= " LANG =\"$lang\"" ;
        if ($class != -1)
            $options .= " CLASS =\"$class\"" ;

        echo "<BDO" . $options . ">$text</BDO>\n" ;
    }
    
    /**
     * The <blockquote> tag is supposed to contain only block-level elements within it, and not just plain text.
     *
     * @param string $text
     * @param string $class
     */
    
    function BlockQuote($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<BLOCKQUOTE" . $options . ">\n<P>$text</P>\n</BLOCKQUOTE>\n" ;
    }
    
    /**
     * Defines a push button. Inside a button element you can put content, like text or images. This is the difference between this element and buttons created with the input element. the type can be : submit, reset, button
     *
     * @param string $text
     * @param string $type
     * @param string $name
     * @param string $value
     * @param string $action
     * @param string $nameAction
     * @param string $disabled
     * @param string $class
     */
    
    function Button($text, $type = -1, $name = -1, $value = -1, $action = -1, $nameAction = -1, $disabled = -1, $class = -1)
    {
        $options = "" ;
        if ($type != -1)
            $options = " TYPE =\"$type\"" ;
        else
            $options = " TYPE =\"button\"" ;

        if ($name != -1)
            $options .= " NAME =\"$name\"" ;
        if ($value != -1)
            $options .= " VALUE =\"$value\"" ;

        switch ($action) {
            case 'onBlur' :
                $options .= " onBlur =\"$nameAction\"" ;
                break ;
            case 'onClick' :
                $options .= " onClick =\"$nameAction\"" ;
                break ;
            case 'onDblClick' :
                $options .= " onDblClick =\"$nameAction\"" ;
                break ;
            case 'onFocus' :
                $options .= " onFocus =\"$nameAction\"" ;
                break ;
            case 'onMouseDown' :
                $options .= " onMouseDown =\"$nameAction\"" ;
                break ;
            case 'onMouseUp' :
                $options .= " onMouseUp =\"$nameAction\"" ;
                break ;
            case 'onMouseOver' :
                $options .= " onMouseOver =\"$nameAction\"" ;
                break ;
            case 'onMouseMove' :
                $options .= " onMouseMove =\"$nameAction\"" ;
                break ;
            case 'onMouseOut' :
                $options .= " onMouseOut =\"$nameAction\"" ;
                break ;
            case 'onKeyPress' :
                $options .= " onKeyPress =\"$nameAction\"" ;
                break ;
            case 'onKeyDown' :
                $options .= " onKeyDown =\"$nameAction\"" ;
                break ;
            case 'onKeyUp' :
                $options .= " onKeyUp =\"$nameAction\"" ;
                break ;
        }
        if ($disabled != -1)
            $options .= " DISABLED" ;
        if ($class != -1)
            $options .= " CLASS =\"$class\"" ;

        echo "<BUTTON" . $options . ">$text</BUTTON>\n" ;
    }
    
    /**
     * This element defines a table caption. The <caption> tag must be inserted immediately after the <table> tag. You can specify only one caption pertable. Usually the caption will be centered above the table.
     *
     * @param string $text
     * @param string $class
     */
    
    function Caption($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<CAPTION" . $options . ">$text</CAPTION>\n" ;
    } 
    
    /**
     * Defines the attribute values for one or more columns in a table. You can only use this element inside a colgroup. Use this element when you want to specify different attribute values to a column inside a colgroup. Without a col element a column will inherit all its attribute values from the column group.
     *
     * @param string $span
     * @param integer $width
     */
    
    function ColGroup($span = -1, $width = array())
    {
        $options = "" ;
        if ($span != -1)
            $options = " SPAN =\"$span\"" ;

        echo "<COLGROUP" . $options . ">\n" ;

        for($i = 0 ; $i < sizeof($width) ; $i++)
        echo "    <COL WIDTH =\"$width[$i]\"></COL>\n" ;

        echo "</COLGROUP>\n" ;
    } 
    
    /**
     * The <dd> tag defines the description of a term in a definition list.
     *
     * @param string $text
     */
    
    function Dd($text)
    {
        echo "        <DD>$text</DD>\n" ;
    }
    
    /**
     * The <dt> tag defines the start of a term in a definition list.
     *
     * @param string $text
     */
    
    function Dt($text)
    {
        echo "    <DT>$text</DT>\n" ;
    } 
    
    /**
     * The <dl> tag defines a definition list.
     *
     * @param string $compact
     */
    
    function DlStart($compact = -1)
    {
        $options = "" ;
        if ($compact != -1)
            $options = " COMPACT" ;

        echo "<DL" . $options . ">\n" ;
    } 
    
    /**
     * The </dl> tag defines the end of a definition list.
     *
     */
    
    function DlEnd()
    {
        echo "</DL>\n" ;
    } 
    
    /**
     * The fieldset element draws a box around its containing elements.
     *
     * @param string $class
     */
    
    function FieldSetStart($class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<FIELDSET" . $options . ">\n" ;
    }
    
    /**
     * The fieldSetEnd() close the fieldset tag
     *
     */
    
    function FieldSetEnd()
    {
        echo "</FIELDSET>\n" ;
    } 
    
    /**
     * Defines a label to a control. If you click the text within the label element, it is supposed to toggle the control.
     *
     * @param string $text
     * @param string $for
     * @param string $class
     */
    
    function Label($text, $for, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<LABEL FOR=\"$for\" " . $options . ">$text</LABEL>\n" ;
    }
    
    /**
     * The legend element defines a caption for a fieldset. param align = center, left, right
     *
     * @param string $text
     * @param string $align
     * @param string $class
     */
    
    function Legend($text, $align = -1, $class = -1)
    {
        $options = "" ;
        if ($align != -1)
            $options = " ALIGN =\"$align\"" ;
        if ($class != -1)
            $options .= " CLASS =\"$class\"" ;

        echo "<LEGEND" . $options . ">$text</LEGEND>\n" ;
    }
    
    /**
     * The noscript element is used to define an alternate content (text) if a script is NOT executed. This tag is used for browsers that recognizes the <script> tag, but does not support the script in it.
     *
     * @param string $text
     */
    
    function NoScript($text)
    {
        echo "<NOSCRIPT>$text</NOSCRIPT>\n" ;
    }
    
    /**
     * The <p> tag defines a paragraph.
     *
     * @param string $text
     * @param string $class
     */
    
    function P($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<P" . $options . ">$text</P>\n" ;
    }
    
    /**
     * The pre element defines preformatted text. The text enclosed in the pre element usually preserves spaces and line breaks. The text renders in a fixed-pitch font.
     *
     * @param string $text
     * @param integer $width
     * @param string $class
     */
    
    function Pre($text, $width = -1, $class = -1)
    {
        $options = "" ;
        if ($width != -1)
            $options = " WIDTH =\"$width\"" ;
        if ($class != -1)
            $options .= " CLASS =\"$class\"" ;

        echo "<PRE" . $options . ">$text</PRE>\n" ;
    }
    
    /**
     * The <q> tag defines the start of a short quotation.
     *
     * @param string $text
     * @param string $class
     */
    
    function Q($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<Q" . $options . ">$text</Q>\n" ;
    }
    
    /**
     * The strikethrough tag defines text that should be shown with a horizontal line through it
     *
     * @param string $text
     * @param string $class
     */
    
    function S($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<S" . $options . ">$text</S>\n" ;
    }
    
    /**
     * Defines sample computer code
     *
     * @param string $text
     * @param string $class
     */
    
    function Samp($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<SAMP" . $options . ">$text</SAMP>\n" ;
    } 
    
    /**
     * Defines a script, such as a JavaScript.
     *
     * @param string $type
     * @param string $language
     */
    
    function ScriptStart($type, $language)
    {
        echo "<SCRIPT LANGUAGE=\"$language\" TYPE=\"$type\">\n" ;
    }
 
    /**
     * Defines a script, such as a JavaScript.
     *
     */
    function ScriptEnd()
    {
        echo "</SCRIPT>\n" ;
    }
    
    /**
     * The <span> tag is used to group inline-elements in a document. one way to put color in document : style="color:#FF0000"
     *
     * @param string $text
     * @param string $style
     * @param string $class
     */
    
    function Span($text, $style = -1, $class = -1)
    {
        $options = "" ;
        if ($style != -1)
            $options = " STYLE =\"$style\"" ;
        if ($class != -1)
            $options .= " CLASS =\"$class\"" ;

        echo "<SPAN" . $options . ">$text</SPAN>\n" ;
    } 
    
    /**
     * Defines a variable
     *
     * @param string $text
     * @param string $class
     */
    
    function V($text, $class = -1)
    {
        $options = "" ;
        if ($class != -1)
            $options = " CLASS =\"$class\"" ;

        echo "<VAR" . $options . ">$text</VAR>\n" ;
    }
    
    /**
     * Define the Frame and frameset tag to create multiple pages the scrolling  param must 'YES', 'NO', 'AUTO'
     *
     * @param string $url
     * @param string $align
     * @param integer $frameborder
     * @param integer $width
     * @param integer $height
     * @param integer $longdesc
     * @param integer $marginheight
     * @param integer $marginwidth
     * @param string $name
     * @param string $scroll
     */
    function Iframe($url, $align = -1, $frameborder = -1, $width = -1, $height = -1, $longdesc = -1, $marginheight = -1,
                        $marginwidth = -1, $name = -1, $scroll = -1)
    {
     $options = "" ;
     if($align != -1)
        $options = " ALIGN =\"$align\"" ;
     if($frameborder != -1)
        $options .= " FRAMEBORDER =\"$frameborder\"" ;
     if($width != -1)
        $options .= " WIDTH =\"$width\"" ;
     if($height != -1)
        $options .= " HEIGHT =\"$height\"" ;
     if($longdesc != -1)
        $options .= " LONGDESC =\"$longdesc\"" ;
     if($marginheight != -1)
        $options .= " MARGINHEIGHT =\"$marginheight\"" ;
     if($marginwidth != -1)
        $options .= " MARGINWIDTH =\"$marginwidth\"" ;
     if($name != -1)
        $options .= " NAME =\"$name\"" ;
     if($scroll != -1)
        $options .= " SCROLLING =\"$scroll\"" ;

     echo "<IFRAME SRC=\"$url\"" . $options . "></IFRAME>\n" ;
    }
    
    /**
     * The framesetCols tag define a new set of frame sort by collone
     *
     * @param integer $cols
     */
    
    function FrameSetCols($cols = array())
    {
     
     if($cols != -1)
        {
        echo "<FRAMESET COLS =\"" ;
        for($i=0 ; $i<sizeof($cols) ; $i++)
                {
                 if($i == sizeof($cols)-1)
                        echo $cols[$i] ;
                 else
                        echo $cols[$i] . ", " ;
                }
         echo "\">\n" ;
        }
    }
    
    /**
     * The framesetrows tag define a new set of frame sort by rows
     *
     * @param integer $rows
     */
    
    function FrameSetRows($rows = array())
    {

     if($rows != -1)
        {
        echo "<FRAMESET ROWS =\"" ;
        for($i=0 ; $i<sizeof($rows) ; $i++)
                {
                 if($i == sizeof($rows)-1)
                        echo $rows[$i] ;
                 else
                        echo $rows[$i] . ", " ;
                }
         echo "\">\n" ;
        }
    }
    
    /**
     * The frame tag to define the page to load
     *
     * @param string $url
     * @param string $name
     * @param string $noresize
     * @param string $scrolling
     * @param integer $frameborder
     * @param integer $longdesc
     * @param integer $marginheight
     * @param integer $marginwidth
     */
    
    function Frame($url, $name = -1, $noresize = -1, $scrolling = -1, $frameborder = -1, $longdesc = -1,
    $marginheight = -1, $marginwidth = -1)
    {
     $options = "" ;
     if($name != -1)
        $options = " NAME =\"$name\"" ;
     if($noresize != -1)
        $options .= " NORESIZE" ;
     if($scrolling != -1)
        $options .= " SCROLLING =\"$scrolling\"" ;
     if($frameborder != -1)
        $options .= " FRAMEBORDER =\"$frameborder\"" ;
     if($longdesc != -1)
        $options .= " LONGDESC =\"$longdesc\"" ;
     if($marginheight != -1)
        $options .= " MARGINHEIGHT =\"$marginheight\"" ;
     if($marginwidth != -1)
        $options .= " MARGINWIDTH =\"$marginwidth\"" ;

    echo "<FRAME SRC =\"$url\"" . $options . ">\n" ;
    }
    
    /**
     * The tag to close the frameset
     *
     */
    
    function FrameSetEnd()
    {
     echo "</FRAMESET>\n" ;
    }
}

?>
Return current item: html.class.php