What does $_GET['loadpage'] return as far as the possible values? If it's a number that corresponds to the tab number you wish to be selected (ie 1=1st tab), then you'd simply use PHP to dynamically generate this line within the script:
Code:
var initialtab=[1, "sc1"]
Changing 1 and "sc1" to the tab and tab content ID you want selected, respectively. To output JavaScript dynamically using PHP, you'd write out the surrounding <script> tags, plus the body of the JavaScript that should be dynamic. In this case, something like:
Code:
echo '<script type="text/javascript">\n';
echo 'var initialtab=[' . $_GET['loadpage'] . ',sc"' . $_GET['loadpage'] . '"]\n';
echo '<\/script>';
The above should proceed the reminder of the Tab Content script, which is just static. Also, be sure to delete the original line:
Code:
var initialtab=[1, "sc1"]
inside the script, so it doesn't override the dynamically generated one above.
For 2), doesn't the menu already behave this way? In the default demo for example, if you move your mouse over the "CSS" tabs, it stays there and doesn't snap back to the currently selected tab onmouseout of the menu.
Bookmarks