<?php

	$toto = 5;
?>

<link href="http://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>

<script>

$.fn.addTab = function (name) {
    $('ul', this).append('<li><a href="#tab-' + name + '">' + name + '</a></li>');
    $(this).append("<div id='tab-" + name + "'></div>");
    $(this).tabs("refresh");
};

// Test code
$(document).ready(function () {
    $("#tabs").tabs();
    $("#tabs").addTab("New Tab");
    $("#add-tab").click(function () {
        var count = $("#tabs ul li").length + 1;
        $("div#tabs").addTab( count);
    });
});

</script>



<div id='tabs'>
    <ul>
        <li><a href='#tab1'>1</a>
        </li>
    </ul>
    <div id='tab1'></div>
</div>
<button id='add-tab'>Add tab</button>