/* Optional: Temporarily hide the "tabber" class so it does not "flash"
   on the page as plain HTML. After tabber runs, the class is changed
   to "tabberlive" and it will appear. */


function ptab_onload ( max )
{
    var i;

    /* If a cookie was previously set, restore the active tab */
    i = GetCookie ( 'ptab' );

    if ( i )
    {
	if ( ! document.getElementById ( i ) ) i = 'sc1';

	previoustab = i;

	for ( var j = 1 ; j <= 10; j++ )
	{
	    var tab = document.getElementById ( 'sc' + j );
	    var title = document.getElementById ( 'lisc' + j );

	    if ( 'sc' + j == i )
	    {
		if ( tab ) tab.style.display = 'block';
		if ( title ) title.className = 'current';
	    }
	    else
	    {
		if ( tab ) tab.style.display = 'none';
		if ( title ) title.className = 'unselected';
	    }

	}
    }
}

function ptab_onclick ( i )
{
    SetCookie ( 'ptab', i );
}


function SetCookie (name, value)
{
    var aujourdhui = new Date() ;
    var expdate = new Date() ;
    expdate.setTime( aujourdhui.getTime() + ( 365*24*60*60*1000 ) )
    document.cookie = name + "=" + value + ";expires=" + expdate.toGMTString() ;
}


function GetCookie ( name )
{
    var cookValue = "" ;
    var cookName = "" ;

    var cook = document.cookie;

    do
    {
	var egal = cook.indexOf( "=" ) ;
	cookName = cook.substring ( 0, egal ) ;
	if ( cookName == name )
	{
	    if ( fin = cook.indexOf( ";" ) )
	    {
		return cook.substring ( egal + 1, fin ) ;
	    }
	    else
	    {
		return cook.substring ( egal + 1 );
	    }
	}
    }
    while ( cook = cook.indexOf( ";" ) );

    return '';
}
